new approach for type definitions

This commit is contained in:
Kevin Jahns
2016-03-10 17:49:36 +01:00
parent ba4f444f32
commit d79e3102fc
7 changed files with 121 additions and 64 deletions

View File

@@ -259,11 +259,18 @@ module.exports = function (Y/* :any */) {
}
},
encode: function (op) {
return {
var e = {
struct: 'List',
id: op.id,
type: op.type
}
if (op.requires != null) {
e.requires = op.requires
}
if (op.info != null) {
e.info = op.info
}
return e
},
requiredOps: function () {
/*
@@ -332,12 +339,19 @@ module.exports = function (Y/* :any */) {
}
},
encode: function (op) {
return {
var e = {
struct: 'Map',
type: op.type,
id: op.id,
map: {} // overwrite map!!
}
if (op.requires != null) {
e.requires = op.requires
}
if (op.info != null) {
e.info = op.info
}
return e
},
requiredOps: function () {
return []