node-opcua-generator
Advanced tools
Comparing version 0.2.1 to 0.2.2
exports.registerObject = require("./src/generator").registerObject; | ||
exports.unregisterObject = require("./src/generator").unregisterObject; |
{ | ||
"name": "node-opcua-generator", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "pure nodejs OPCUA SDK - module -generator", | ||
@@ -11,15 +11,15 @@ "main": "index.js", | ||
"node-opcua-assert": "^0.2.0", | ||
"node-opcua-basic-types": "^0.2.1", | ||
"node-opcua-basic-types": "^0.2.2", | ||
"node-opcua-constants": "^0.2.0", | ||
"node-opcua-debug": "^0.2.0", | ||
"node-opcua-factory": "^0.2.1", | ||
"node-opcua-nodeid": "^0.2.0", | ||
"node-opcua-utils": "^0.2.1", | ||
"node-opcua-debug": "^0.2.2", | ||
"node-opcua-factory": "^0.2.2", | ||
"node-opcua-nodeid": "^0.2.2", | ||
"node-opcua-utils": "^0.2.2", | ||
"underscore": "^1.8.3" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-binary-stream": "^0.2.1", | ||
"node-opcua-extension-object": "^0.2.1", | ||
"node-opcua-packet-analyzer": "^0.2.1", | ||
"node-opcua-status-code": "^0.2.1", | ||
"node-opcua-binary-stream": "^0.2.2", | ||
"node-opcua-extension-object": "^0.2.2", | ||
"node-opcua-packet-analyzer": "^0.2.2", | ||
"node-opcua-status-code": "^0.2.2", | ||
"should": "13.2.1" | ||
@@ -26,0 +26,0 @@ }, |
@@ -108,2 +108,15 @@ "use strict"; | ||
function write_complex_fast_construct(f, schema, field, member/*, i*/) { | ||
assert(f instanceof LineFile); | ||
function write() { | ||
f.write.apply(f, arguments); | ||
} | ||
if (field.isArray) { | ||
write(" self." + member + " = null; /* null array */"); | ||
} else { | ||
write(" self." + member + " = null; /* new " + field.fieldType + "(null); */"); | ||
} | ||
} | ||
function write_complex(f, schema, field, member/*, i*/) { | ||
@@ -374,3 +387,2 @@ | ||
write(" options = schema.construct_hook(options); "); | ||
} | ||
@@ -381,4 +393,30 @@ if (baseclass) { | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
// Special case when options === null => fast constructor for deserialization | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
write(" if (options === null) { "); | ||
if (baseclass) { | ||
write(" " + baseclass + ".call(this,options);"); | ||
} | ||
for (i = 0; i < n; i++) { | ||
field = schema.fields[i]; | ||
fieldType = field.fieldType; | ||
member = field.name; | ||
__member = "__" + member; | ||
if (field.category === "enumeration") { | ||
//xx write_enumeration(f, schema, field, member, i); | ||
} else if (field.category === "complex") { | ||
write_complex_fast_construct(f, schema, field, member, i); | ||
} else { | ||
//xx write_basic(f, schema, field, member, i); | ||
} | ||
} | ||
write(" return ;"); | ||
write(" }"); | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
for (i = 0; i < n; i++) { | ||
field = schema.fields[i]; | ||
@@ -603,3 +641,3 @@ | ||
write(" this." + member + " = decodeArray(stream, function(stream) { "); | ||
write(" var obj = new " + field.fieldType + "();"); | ||
write(" var obj = new " + field.fieldType + "(null);"); | ||
write(" obj.decode(stream,options);"); | ||
@@ -606,0 +644,0 @@ write(" return obj; "); |
@@ -0,0 +0,0 @@ "use strict"; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
69961
17
1486
11
Updatednode-opcua-debug@^0.2.2
Updatednode-opcua-factory@^0.2.2
Updatednode-opcua-nodeid@^0.2.2
Updatednode-opcua-utils@^0.2.2