node-opcua-address-space 2.177.0 → 2.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/address_space_ts.d.ts +16 -6
- package/dist/source/address_space_ts.js +1 -1
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/helpers/argument_list.js +2 -2
- package/dist/source/helpers/argument_list.js.map +1 -1
- package/dist/source/helpers/call_helpers.js +3 -0
- package/dist/source/helpers/call_helpers.js.map +1 -1
- package/dist/source/helpers/dump_tools.js +6 -2
- package/dist/source/helpers/dump_tools.js.map +1 -1
- package/dist/source/helpers/make_optionals_map.d.ts +3 -1
- package/dist/source/helpers/make_optionals_map.js.map +1 -1
- package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +0 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -1
- package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.js +2 -1
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/source/loader/load_nodeset2.js +39 -17
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.js +26 -7
- package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/loader/parsers/extension_object_parser.d.ts +6 -4
- package/dist/source/loader/parsers/extension_object_parser.js +12 -6
- package/dist/source/loader/parsers/extension_object_parser.js.map +1 -1
- package/dist/source/loader/parsers/localized_text_parser.d.ts +1 -1
- package/dist/source/loader/parsers/nodeid_parser.d.ts +10 -2
- package/dist/source/loader/parsers/nodeid_parser.js.map +1 -1
- package/dist/source/loader/parsers/qualified_name_parser.d.ts +1 -2
- package/dist/source/loader/parsers/variant_parser.d.ts +8 -2
- package/dist/source/loader/parsers/variant_parser.js +11 -8
- package/dist/source/loader/parsers/variant_parser.js.map +1 -1
- package/dist/source/pseudo_session.js +70 -24
- package/dist/source/pseudo_session.js.map +1 -1
- package/dist/source/session_context.js.map +1 -1
- package/dist/source/xml_writer.d.ts +1 -1
- package/dist/src/_instantiate_helpers.js +0 -3
- package/dist/src/_instantiate_helpers.js.map +1 -1
- package/dist/src/_mandatory_child_or_requested_optional_filter.d.ts +3 -2
- package/dist/src/_mandatory_child_or_requested_optional_filter.js +0 -2
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -1
- package/dist/src/address_space.d.ts +7 -2
- package/dist/src/address_space.js +39 -25
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/address_space_private.d.ts +1 -0
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +6 -9
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +6 -6
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +8 -4
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +6 -5
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +3 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/base_node_impl.js +17 -8
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.js +0 -6
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/extension_object_array_node.d.ts +9 -1
- package/dist/src/extension_object_array_node.js +20 -3
- package/dist/src/extension_object_array_node.js.map +1 -1
- package/dist/src/get_basic_datatype.js +3 -1
- package/dist/src/get_basic_datatype.js.map +1 -1
- package/dist/src/historical_access/address_space_historical_data_node.js +2 -4
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/namespace_impl.js +6 -5
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/nodeid_manager.js +4 -5
- package/dist/src/nodeid_manager.js.map +1 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +10 -11
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.js +2 -4
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.js +71 -43
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/private_namespace.js.map +1 -1
- package/dist/src/reference_impl.d.ts +2 -2
- package/dist/src/reference_impl.js +5 -4
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.js +1 -1
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.js +9 -7
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/tool_isSubtypeOf.js.map +1 -1
- package/dist/src/ua_data_type_impl.js +4 -4
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.js +21 -11
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.d.ts +5 -2
- package/dist/src/ua_object_type_impl.js +4 -3
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.js +1 -2
- package/dist/src/ua_reference_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.d.ts +9 -11
- package/dist/src/ua_variable_impl.js +103 -65
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +6 -6
- package/dist/src/ua_variable_impl_ext_obj.js +33 -22
- package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/src/ua_variable_type_impl.js +6 -2
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distHelpers/add_event_generator_object.js +3 -0
- package/distHelpers/add_event_generator_object.js.map +1 -1
- package/distHelpers/boiler_system.js +27 -6
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.js +3 -3
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
- package/distHelpers/date_utils.js.map +1 -1
- package/distHelpers/dump_statemachine.js +1 -1
- package/distHelpers/dump_statemachine.js.map +1 -1
- package/distHelpers/get_address_space_fixture.js +0 -1
- package/distHelpers/get_address_space_fixture.js.map +1 -1
- package/package.json +41 -41
- package/source/address_space_ts.ts +19 -9
- package/source/helpers/argument_list.ts +2 -2
- package/source/helpers/call_helpers.ts +4 -1
- package/source/helpers/dump_tools.ts +7 -3
- package/source/helpers/make_optionals_map.ts +4 -2
- package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +4 -3
- package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +10 -11
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +6 -7
- package/source/interfaces/extension_object_constructor.ts +1 -1
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +0 -1
- package/source/interfaces/state_machine/ua_state_machine_type.ts +0 -1
- package/source/loader/decode_xml_extension_object.ts +3 -3
- package/source/loader/ensure_datatype_extracted.ts +6 -2
- package/source/loader/generateAddressSpaceRaw.ts +5 -4
- package/source/loader/load_nodeset2.ts +45 -18
- package/source/loader/make_xml_extension_object_parser.ts +78 -45
- package/source/loader/namespace_post_step.ts +1 -1
- package/source/loader/parsers/extension_object_parser.ts +36 -27
- package/source/loader/parsers/localized_text_parser.ts +1 -1
- package/source/loader/parsers/nodeid_parser.ts +10 -2
- package/source/loader/parsers/qualified_name_parser.ts +1 -1
- package/source/loader/parsers/variant_parser.ts +53 -40
- package/source/pseudo_session.ts +81 -28
- package/source/session_context.ts +1 -0
- package/source/xml_writer.ts +1 -1
- package/src/_instantiate_helpers.ts +0 -3
- package/src/_mandatory_child_or_requested_optional_filter.ts +3 -4
- package/src/address_space.ts +64 -40
- package/src/address_space_private.ts +2 -0
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +6 -10
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +5 -7
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +20 -13
- package/src/alarms_and_conditions/ua_base_event_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_condition_impl.ts +12 -10
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +8 -5
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +0 -1
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +0 -1
- package/src/apply_condition_refresh.ts +1 -1
- package/src/base_node_impl.ts +30 -35
- package/src/base_node_private.ts +0 -6
- package/src/extension_object_array_node.ts +44 -15
- package/src/get_basic_datatype.ts +4 -1
- package/src/historical_access/address_space_historical_data_node.ts +2 -5
- package/src/namespace_impl.ts +24 -17
- package/src/nodeid_manager.ts +8 -11
- package/src/nodeset_tools/construct_namespace_dependency.ts +18 -15
- package/src/nodeset_tools/dump_to_bsd.ts +6 -8
- package/src/nodeset_tools/nodeset_to_xml.ts +105 -75
- package/src/private_namespace.ts +7 -2
- package/src/reference_impl.ts +11 -10
- package/src/state_machine/finite_state_machine.ts +12 -10
- package/src/state_machine/ua_shelving_state_machine_ex.ts +4 -4
- package/src/state_machine/ua_two_state_variable.ts +12 -9
- package/src/tool_isSubtypeOf.ts +2 -9
- package/src/ua_data_type_impl.ts +4 -4
- package/src/ua_method_impl.ts +24 -14
- package/src/ua_object_type_impl.ts +12 -6
- package/src/ua_reference_type_impl.ts +2 -3
- package/src/ua_variable_impl.ts +142 -96
- package/src/ua_variable_impl_ext_obj.ts +110 -82
- package/src/ua_variable_type_impl.ts +17 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
|
-
// tslint:disable:no-empty-interface
|
|
5
4
|
import type { InstantiateObjectOptions, UAObjectType } from "node-opcua-address-space-base";
|
|
6
5
|
import type { UAProgramStateMachine_Base } from "node-opcua-nodeset-ua";
|
|
7
6
|
import type { UAStateMachineEx } from "./ua_state_machine_type";
|
|
@@ -12,14 +12,14 @@ const debugLog = make_debugLog(__filename);
|
|
|
12
12
|
const _errorLog = make_errorLog(__filename);
|
|
13
13
|
|
|
14
14
|
function encodingNodeIdToDataTypeNode(addressSpace: IAddressSpace, encodingNodeId: NodeId): UADataType {
|
|
15
|
-
const encodingNode = addressSpace.findNode(encodingNodeId)
|
|
15
|
+
const encodingNode = addressSpace.findNode(encodingNodeId);
|
|
16
16
|
|
|
17
17
|
// c8 ignore next
|
|
18
18
|
if (!encodingNode) {
|
|
19
19
|
throw new Error(`findDataTypeNode: Cannot find encoding NodeId${encodingNodeId.toString()}`);
|
|
20
20
|
}
|
|
21
21
|
const refs = encodingNode.findReferences("HasEncoding", false);
|
|
22
|
-
const dataTypes = refs.map((ref) => addressSpace.findNode(ref.nodeId)).filter((obj
|
|
22
|
+
const dataTypes = refs.map((ref) => addressSpace.findNode(ref.nodeId)).filter((obj) => obj !== null);
|
|
23
23
|
// c8 ignore next
|
|
24
24
|
if (dataTypes.length !== 1) {
|
|
25
25
|
throw new Error("Internal Error");
|
|
@@ -60,7 +60,7 @@ export function decodeXmlExtensionObject(
|
|
|
60
60
|
): ExtensionObject | null {
|
|
61
61
|
const definitionMap = makeDefinitionMap(addressSpace);
|
|
62
62
|
|
|
63
|
-
const dataType = encodingNodeIdToDataTypeNode(addressSpace, encodingNodeId)
|
|
63
|
+
const dataType = encodingNodeIdToDataTypeNode(addressSpace, encodingNodeId);
|
|
64
64
|
|
|
65
65
|
// const { name, definition } = definitionMap.findDefinition(dataType.nodeId);
|
|
66
66
|
// const hasOptionalFields = definition.fields!.some((field) => field.isOptional);
|
|
@@ -23,6 +23,10 @@ interface UADataTypePriv extends UADataType {
|
|
|
23
23
|
$partialDefinition?: StructureField[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
interface AddressSpacePrivateWithDataTypeManager extends AddressSpacePrivate {
|
|
27
|
+
$$extraDataTypeManager?: ExtraDataTypeManager;
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
function fixDefinition103(addressSpace: IAddressSpace, namespaceArray: string[], dataTypeManager: ExtraDataTypeManager): void {
|
|
27
31
|
// fix datatype _getDefinition();
|
|
28
32
|
for (let namespaceIndex = 1; namespaceIndex < namespaceArray.length; namespaceIndex++) {
|
|
@@ -48,7 +52,7 @@ function fixDefinition103(addressSpace: IAddressSpace, namespaceArray: string[],
|
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
export async function ensureDatatypeExtracted(addressSpace: IAddressSpace): Promise<ExtraDataTypeManager> {
|
|
51
|
-
const addressSpacePriv
|
|
55
|
+
const addressSpacePriv = addressSpace as AddressSpacePrivateWithDataTypeManager;
|
|
52
56
|
|
|
53
57
|
if (!addressSpacePriv.$$extraDataTypeManager) {
|
|
54
58
|
const dataTypeManager = new ExtraDataTypeManager();
|
|
@@ -108,7 +112,7 @@ export async function ensureDatatypeExtracted(addressSpace: IAddressSpace): Prom
|
|
|
108
112
|
// turn old <=103 structure to have valid DataTypeDefinition
|
|
109
113
|
fixDefinition103(addressSpace, namespaceArray, dataTypeManager);
|
|
110
114
|
}
|
|
111
|
-
return addressSpacePriv.$$extraDataTypeManager;
|
|
115
|
+
return addressSpacePriv.$$extraDataTypeManager as ExtraDataTypeManager;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
export function ensureDatatypeExtractedWithCallback(addressSpace: IAddressSpace, callback: CallbackT<ExtraDataTypeManager>): void {
|
|
@@ -2,7 +2,7 @@ import type { IAddressSpace, RequiredModel } from "node-opcua-address-space-base
|
|
|
2
2
|
import { getMinOPCUADate } from "node-opcua-date-time";
|
|
3
3
|
import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
|
|
4
4
|
import type { CallbackT } from "node-opcua-status-code";
|
|
5
|
-
import { type ReaderStateParser, type ReaderStateParserLike, Xml2Json } from "node-opcua-xml2json";
|
|
5
|
+
import { type ReaderStateParser, type ReaderStateParserLike, Xml2Json, type XmlAttributes } from "node-opcua-xml2json";
|
|
6
6
|
import type { NamespacePrivate } from "../../src/namespace_private";
|
|
7
7
|
import { adjustNamespaceArray } from "../../src/nodeset_tools/adjust_namespace_array";
|
|
8
8
|
import type { NodeSetLoaderOptions } from "../interfaces/nodeset_loader_options";
|
|
@@ -41,7 +41,7 @@ async function parseDependencies(xmlData: string): Promise<NodesetInfo> {
|
|
|
41
41
|
Models: {
|
|
42
42
|
parser: {
|
|
43
43
|
Model: {
|
|
44
|
-
init(_elementName: string, attrs:
|
|
44
|
+
init(_elementName: string, attrs: XmlAttributes) {
|
|
45
45
|
const modelUri = attrs.ModelUri;
|
|
46
46
|
const version = attrs.Version;
|
|
47
47
|
const publicationDate = new Date(Date.parse(attrs.PublicationDate));
|
|
@@ -56,7 +56,7 @@ async function parseDependencies(xmlData: string): Promise<NodesetInfo> {
|
|
|
56
56
|
},
|
|
57
57
|
parser: {
|
|
58
58
|
RequiredModel: {
|
|
59
|
-
init(_elementName: string, attrs:
|
|
59
|
+
init(_elementName: string, attrs: XmlAttributes) {
|
|
60
60
|
const modelUri = attrs.ModelUri;
|
|
61
61
|
const version = attrs.Version;
|
|
62
62
|
const publicationDate = new Date(Date.parse(attrs.PublicationDate));
|
|
@@ -200,7 +200,8 @@ export async function generateAddressSpaceRaw(
|
|
|
200
200
|
for (let index = 0; index < order.length; index++) {
|
|
201
201
|
const nodesetIndex = order[index];
|
|
202
202
|
const nodeset = nodesetDesc[nodesetIndex];
|
|
203
|
-
|
|
203
|
+
// c8 ignore next
|
|
204
|
+
doDebug && debugLog(" loading ", nodesetIndex, nodeset.xmlData.length);
|
|
204
205
|
try {
|
|
205
206
|
await nodesetLoader.addNodeSetAsync(nodeset.xmlData);
|
|
206
207
|
} catch (err) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-statements */
|
|
2
1
|
/**
|
|
3
2
|
* @module node-opcua-address-space
|
|
4
3
|
*/
|
|
@@ -16,7 +15,7 @@ import type {
|
|
|
16
15
|
UAVariable,
|
|
17
16
|
UAVariableType
|
|
18
17
|
} from "node-opcua-address-space-base";
|
|
19
|
-
import { assert
|
|
18
|
+
import { assert } from "node-opcua-assert";
|
|
20
19
|
import { coerceBoolean, coerceByte, coerceInt32, StatusCodes } from "node-opcua-basic-types";
|
|
21
20
|
import { DataTypeIds } from "node-opcua-constants";
|
|
22
21
|
import {
|
|
@@ -221,7 +220,8 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
221
220
|
let performedCalled = false;
|
|
222
221
|
|
|
223
222
|
function _reset_namespace_translation() {
|
|
224
|
-
|
|
223
|
+
// c8 ignore next
|
|
224
|
+
doDebug && debugLog("_reset_namespace_translation");
|
|
225
225
|
namespaceUriTranslationMap.clear();
|
|
226
226
|
foundNamespaceMap.clear();
|
|
227
227
|
namespaceCounter = 0;
|
|
@@ -711,11 +711,13 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
711
711
|
node: { browseName: QualifiedName; nodeClass: NodeClass }
|
|
712
712
|
) => {
|
|
713
713
|
if (isDraft && !options.loadDraftNodes) {
|
|
714
|
-
|
|
714
|
+
// c8 ignore next
|
|
715
|
+
doDebug && debugLog("Ignoring Draft =", NodeClass[node.nodeClass], node.browseName.toString());
|
|
715
716
|
return true;
|
|
716
717
|
}
|
|
717
718
|
if (isDeprecated && !options.loadDeprecatedNodes) {
|
|
718
|
-
|
|
719
|
+
// c8 ignore next
|
|
720
|
+
doDebug && debugLog("Ignoring Deprecate =", NodeClass[node.nodeClass], node.browseName.toString());
|
|
719
721
|
return true;
|
|
720
722
|
}
|
|
721
723
|
return false;
|
|
@@ -806,15 +808,16 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
806
808
|
this.obj.value = makeDefaultVariant(addressSpace, dataTypeNode, valueRank);
|
|
807
809
|
}
|
|
808
810
|
*/
|
|
809
|
-
// eslint-disable-next-line prefer-const
|
|
810
811
|
let capturedVariable: UAVariable | undefined;
|
|
811
812
|
if (this.obj.value && this.obj.value.dataType !== DataType.Null) {
|
|
812
813
|
let capturedValue: VariantOptions | undefined = this.obj.value;
|
|
813
814
|
const task = async (_addressSpace2: IAddressSpace) => {
|
|
814
815
|
if (!capturedVariable) return;
|
|
815
816
|
const cv = capturedVariable;
|
|
817
|
+
// biome-ignore lint/correctness/noConstantCondition: deliberate debug on/off toggle, not dead code
|
|
816
818
|
if (false && doDebug) {
|
|
817
|
-
|
|
819
|
+
// c8 ignore next
|
|
820
|
+
doDebug && debugLog("1 setting value to ", cv.nodeId.toString(), new Variant(capturedValue).toString());
|
|
818
821
|
}
|
|
819
822
|
cv.setValueFromSource(capturedValue as VariantOptions);
|
|
820
823
|
capturedValue = undefined;
|
|
@@ -836,8 +839,10 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
836
839
|
|
|
837
840
|
const value = makeDefaultVariant(addressSpace, dataTypeNode, valueRank, arrayDimensions);
|
|
838
841
|
if (value) {
|
|
842
|
+
// biome-ignore lint/correctness/noConstantCondition: deliberate debug on/off toggle, not dead code
|
|
839
843
|
if (false && doDebug) {
|
|
840
|
-
|
|
844
|
+
// c8 ignore next
|
|
845
|
+
doDebug && debugLog("2 setting value to ", cv.nodeId.toString(), value);
|
|
841
846
|
}
|
|
842
847
|
// a Matrix variable declared with fixed ArrayDimensions but no <Value> is built with
|
|
843
848
|
// an empty value (value=[]) yet non-zero declared dimensions. This is an *uninitialized*
|
|
@@ -1160,17 +1165,30 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
1160
1165
|
chalk.green("DONE")
|
|
1161
1166
|
);
|
|
1162
1167
|
|
|
1163
|
-
|
|
1168
|
+
/**
|
|
1169
|
+
* run every queued post-loading task.
|
|
1170
|
+
*
|
|
1171
|
+
* A task that throws (typically: a `<Value>` in a third-party nodeset that does not
|
|
1172
|
+
* match the declared DataType) is logged and skipped — it must NOT abort the remaining
|
|
1173
|
+
* tasks nor the remaining stages of finalSteps(). Previously the failing task was
|
|
1174
|
+
* re-run inside the catch block, the second throw escaped the loop, finalSteps() was
|
|
1175
|
+
* abandoned and `ensureDatatypeExtracted` was never called: the address space was
|
|
1176
|
+
* left half-initialised (no DataTypeManager) and any later use of a structured
|
|
1177
|
+
* DataType failed with an opaque
|
|
1178
|
+
* "Cannot read properties of undefined (reading 'getExtensionObjectConstructorFromDataType')".
|
|
1179
|
+
*/
|
|
1180
|
+
async function performPostLoadingTasks(stage: string, tasks: Task[]): Promise<void> {
|
|
1164
1181
|
for (const task of tasks) {
|
|
1165
1182
|
try {
|
|
1166
1183
|
await task(addressSpace1);
|
|
1167
1184
|
} catch (err) {
|
|
1168
1185
|
// c8 ignore next
|
|
1169
|
-
// tslint:disable:no-console
|
|
1170
1186
|
if (types.isNativeError(err)) {
|
|
1171
|
-
errorLog(
|
|
1187
|
+
errorLog(
|
|
1188
|
+
`[NODE-OPCUA-W36] generateAddressSpace: post-loading task failed during "${stage}" and was skipped: ${err.message}`
|
|
1189
|
+
);
|
|
1190
|
+
doDebug && debugLog(err);
|
|
1172
1191
|
}
|
|
1173
|
-
await task(addressSpace1);
|
|
1174
1192
|
}
|
|
1175
1193
|
}
|
|
1176
1194
|
tasks.splice(0);
|
|
@@ -1179,11 +1197,11 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
1179
1197
|
/// ----------------------------------------------------------------------------------------
|
|
1180
1198
|
// perform post task
|
|
1181
1199
|
doDebug && debugLog(chalk.bgGreenBright("Performing post loading tasks -------------------------------------------"));
|
|
1182
|
-
await performPostLoadingTasks(postTasks);
|
|
1200
|
+
await performPostLoadingTasks("post tasks", postTasks);
|
|
1183
1201
|
|
|
1184
1202
|
doDebug &&
|
|
1185
1203
|
debugLog(chalk.bgGreenBright("Performing post loading task: Initializing Simple Variables ---------------------"));
|
|
1186
|
-
await performPostLoadingTasks(postTasks0_InitializeVariable);
|
|
1204
|
+
await performPostLoadingTasks("initializing simple variables", postTasks0_InitializeVariable);
|
|
1187
1205
|
|
|
1188
1206
|
doDebug && debugLog(chalk.bgGreenBright("Performing DataType extraction -------------------------------------------"));
|
|
1189
1207
|
assert(!addressSpace1.suspendBackReference);
|
|
@@ -1202,14 +1220,17 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
1202
1220
|
pendingSimpleTypeToRegister.splice(0);
|
|
1203
1221
|
|
|
1204
1222
|
doDebug && debugLog(chalk.bgGreenBright("Performing post loading task: Decoding Pojo String (parsing XML objects) -"));
|
|
1205
|
-
await performPostLoadingTasks(postTasks0_DecodePojoString);
|
|
1223
|
+
await performPostLoadingTasks("decoding XML extension objects", postTasks0_DecodePojoString);
|
|
1206
1224
|
|
|
1207
1225
|
doDebug &&
|
|
1208
1226
|
debugLog(chalk.bgGreenBright("Performing post loading task: Initializing Complex Variables ---------------------"));
|
|
1209
|
-
await performPostLoadingTasks(postTasks1_InitializeVariable);
|
|
1227
|
+
await performPostLoadingTasks("initializing complex variables", postTasks1_InitializeVariable);
|
|
1210
1228
|
|
|
1211
1229
|
doDebug && debugLog(chalk.bgGreenBright("Performing post loading tasks: (assigning Extension Object to Variables) -"));
|
|
1212
|
-
await performPostLoadingTasks(
|
|
1230
|
+
await performPostLoadingTasks(
|
|
1231
|
+
"assigning extension objects to variables",
|
|
1232
|
+
postTasks2_AssignedExtensionObjectToDataValue
|
|
1233
|
+
);
|
|
1213
1234
|
|
|
1214
1235
|
doDebug && debugLog(chalk.bgGreenBright("Performing post variable initialization ---------------------"));
|
|
1215
1236
|
promoteObjectsAndVariables(addressSpace);
|
|
@@ -1218,7 +1239,13 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
|
|
|
1218
1239
|
try {
|
|
1219
1240
|
await finalSteps();
|
|
1220
1241
|
} catch (err) {
|
|
1221
|
-
renderError(
|
|
1242
|
+
// `renderError` was a no-op here, so a failure in the final steps (DataType extraction,
|
|
1243
|
+
// promotion of objects/variables, ...) used to be silently swallowed and the caller was
|
|
1244
|
+
// handed back a half-initialised address space. Surface it: log and re-throw so that
|
|
1245
|
+
// generateAddressSpace() rejects.
|
|
1246
|
+
const message = types.isNativeError(err) ? err.message : String(err);
|
|
1247
|
+
errorLog(`[NODE-OPCUA-E30] generateAddressSpace: final post-loading steps failed: ${message}`);
|
|
1248
|
+
throw err;
|
|
1222
1249
|
}
|
|
1223
1250
|
}
|
|
1224
1251
|
async function addNodeSet(xmlData: string): Promise<void> {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type UInt32,
|
|
12
12
|
type UInt64
|
|
13
13
|
} from "node-opcua-basic-types";
|
|
14
|
-
import { make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
14
|
+
import { checkDebugFlag, make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
15
15
|
import { coerceNodeId, ExpandedNodeId, type INodeId, type NodeId, NodeIdType } from "node-opcua-nodeid";
|
|
16
16
|
import { coerceStatusCode, StatusCodes } from "node-opcua-status-code";
|
|
17
17
|
import { EnumDefinition, StructureDefinition } from "node-opcua-types";
|
|
@@ -31,6 +31,7 @@ import { makeVariantReader } from "./parsers/variant_parser";
|
|
|
31
31
|
|
|
32
32
|
const warningLog = make_warningLog(__filename);
|
|
33
33
|
const debugLog = make_debugLog(__filename);
|
|
34
|
+
const doDebug = checkDebugFlag(__filename);
|
|
34
35
|
|
|
35
36
|
// textual form of an ExpandedNodeId, as found in <ExpandedNodeId><Identifier>...</Identifier></ExpandedNodeId>:
|
|
36
37
|
// an optional server index, an optional namespace uri, then a plain nodeId. see OPC UA part 6.
|
|
@@ -70,18 +71,30 @@ function clamp(value: number, minValue: number, maxValue: number) {
|
|
|
70
71
|
|
|
71
72
|
interface Parser<T> extends ReaderStateParserLike {
|
|
72
73
|
value: T | null;
|
|
73
|
-
parent:
|
|
74
|
+
parent: Parser<unknown>;
|
|
74
75
|
text: string;
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
// generic loose parser-state shape used by the Xml2Json engine: `this` here is a
|
|
79
|
+
// dynamically-populated reader state whose fields (value/parent/text/...) vary by parser,
|
|
80
|
+
// see the `this: any` justification in ReaderStateParserLike itself (node-opcua-xml2json).
|
|
81
|
+
interface AnyParserState extends ReaderStateParserLike {
|
|
82
|
+
value: unknown;
|
|
83
|
+
parent: AnyParserState;
|
|
84
|
+
text: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
obj?: unknown;
|
|
87
|
+
parser: Record<string, AnyParserState>;
|
|
88
|
+
}
|
|
89
|
+
|
|
77
90
|
// <StatusCode><Code>2153644032</Code></StatusCode>
|
|
78
91
|
const statusCode_parser: ReaderStateParserLike = {
|
|
79
|
-
init(this:
|
|
92
|
+
init(this: AnyParserState) {
|
|
80
93
|
this.value = StatusCodes.Good;
|
|
81
94
|
},
|
|
82
95
|
parser: {
|
|
83
96
|
Code: {
|
|
84
|
-
finish(this:
|
|
97
|
+
finish(this: AnyParserState) {
|
|
85
98
|
this.parent.value = coerceStatusCode(parseInt(this.text, 10));
|
|
86
99
|
}
|
|
87
100
|
}
|
|
@@ -92,16 +105,16 @@ const statusCode_parser: ReaderStateParserLike = {
|
|
|
92
105
|
// created when at least one field is present ( <DiagnosticInfo/> stays empty ).
|
|
93
106
|
function _diagnosticInfoField(name: string, convert: (text: string) => unknown): ReaderStateParserLike {
|
|
94
107
|
return {
|
|
95
|
-
finish(this:
|
|
108
|
+
finish(this: AnyParserState) {
|
|
96
109
|
this.parent.value = this.parent.value || {};
|
|
97
|
-
this.parent.value[name] = convert(this.text);
|
|
110
|
+
(this.parent.value as Record<string, unknown>)[name] = convert(this.text);
|
|
98
111
|
}
|
|
99
112
|
};
|
|
100
113
|
}
|
|
101
114
|
|
|
102
115
|
// <DiagnosticInfo><SymbolicId>1</SymbolicId>...<InnerDiagnosticInfo>...</InnerDiagnosticInfo></DiagnosticInfo>
|
|
103
116
|
const diagnosticInfo_parser: ReaderStateParserLike = {
|
|
104
|
-
init(this:
|
|
117
|
+
init(this: AnyParserState) {
|
|
105
118
|
this.value = undefined;
|
|
106
119
|
},
|
|
107
120
|
parser: {
|
|
@@ -112,20 +125,23 @@ const diagnosticInfo_parser: ReaderStateParserLike = {
|
|
|
112
125
|
AdditionalInfo: _diagnosticInfoField("additionalInfo", (text) => text),
|
|
113
126
|
InnerStatusCode: {
|
|
114
127
|
...statusCode_parser,
|
|
115
|
-
finish(this:
|
|
128
|
+
finish(this: AnyParserState) {
|
|
116
129
|
this.parent.value = this.parent.value || {};
|
|
117
|
-
this.parent.value.innerStatusCode = this.value;
|
|
130
|
+
(this.parent.value as Record<string, unknown>).innerStatusCode = this.value;
|
|
118
131
|
}
|
|
119
132
|
}
|
|
120
133
|
}
|
|
121
134
|
};
|
|
122
135
|
// InnerDiagnosticInfo is a DiagnosticInfo in turn: the parser is registered after the
|
|
123
136
|
// fact so that it can refer to the reader being built.
|
|
124
|
-
diagnosticInfo_parser.parser
|
|
137
|
+
if (!diagnosticInfo_parser.parser) {
|
|
138
|
+
throw new Error("internal error: diagnosticInfo_parser.parser must be defined");
|
|
139
|
+
}
|
|
140
|
+
diagnosticInfo_parser.parser.InnerDiagnosticInfo = {
|
|
125
141
|
...diagnosticInfo_parser,
|
|
126
|
-
finish(this:
|
|
142
|
+
finish(this: AnyParserState) {
|
|
127
143
|
this.parent.value = this.parent.value || {};
|
|
128
|
-
this.parent.value.innerDiagnosticInfo = this.value;
|
|
144
|
+
(this.parent.value as Record<string, unknown>).innerDiagnosticInfo = this.value;
|
|
129
145
|
}
|
|
130
146
|
};
|
|
131
147
|
const partials = {
|
|
@@ -238,7 +254,7 @@ const partials = {
|
|
|
238
254
|
},
|
|
239
255
|
|
|
240
256
|
Variant: {
|
|
241
|
-
finish(this:
|
|
257
|
+
finish(this: AnyParserState) {
|
|
242
258
|
/** to do */
|
|
243
259
|
warningLog(" Missing Implemntation contact sterfive.com!");
|
|
244
260
|
}
|
|
@@ -281,7 +297,7 @@ export interface DefinitionMap2 {
|
|
|
281
297
|
findDefinition(dataTypeNodeId: NodeId): TypeInfo;
|
|
282
298
|
}
|
|
283
299
|
|
|
284
|
-
function _clone(a:
|
|
300
|
+
function _clone(a: unknown): unknown {
|
|
285
301
|
if (typeof a === "string" || typeof a === "number" || typeof a === "boolean") {
|
|
286
302
|
return a;
|
|
287
303
|
}
|
|
@@ -294,7 +310,7 @@ function _clone(a: any): any {
|
|
|
294
310
|
if (Array.isArray(a)) {
|
|
295
311
|
return a.map((x) => _clone(x));
|
|
296
312
|
}
|
|
297
|
-
return { ...a };
|
|
313
|
+
return { ...(a as Record<string, unknown>) };
|
|
298
314
|
}
|
|
299
315
|
|
|
300
316
|
function _makeTypeReader(
|
|
@@ -302,7 +318,7 @@ function _makeTypeReader(
|
|
|
302
318
|
definitionMap: DefinitionMap2,
|
|
303
319
|
readerMap: Map<string, ReaderStateParserLike>,
|
|
304
320
|
translateNodeId: (nodeId: string) => NodeId
|
|
305
|
-
): { name: string; reader:
|
|
321
|
+
): { name: string; reader: ReaderStateParserLike } {
|
|
306
322
|
const n = dataTypeNodeId1 as INodeId;
|
|
307
323
|
if (n.identifierType === NodeIdType.NUMERIC && n.namespace === 0 && n.value === 0) {
|
|
308
324
|
// a generic Extension Object
|
|
@@ -311,7 +327,7 @@ function _makeTypeReader(
|
|
|
311
327
|
|
|
312
328
|
if (n.namespace === 0 && n.identifierType === NodeIdType.NUMERIC && n.value < DataType.ExtensionObject) {
|
|
313
329
|
const name = DataType[n.value as number] as string;
|
|
314
|
-
const reader = partials[name as keyof typeof partials] as
|
|
330
|
+
const reader = partials[name as keyof typeof partials] as ReaderStateParserLike;
|
|
315
331
|
return { name, reader };
|
|
316
332
|
}
|
|
317
333
|
|
|
@@ -319,26 +335,32 @@ function _makeTypeReader(
|
|
|
319
335
|
|
|
320
336
|
const dataTypeName = name;
|
|
321
337
|
|
|
322
|
-
let reader: ReaderStateParserLike = readerMap.get(dataTypeName)
|
|
338
|
+
let reader: ReaderStateParserLike | undefined = readerMap.get(dataTypeName);
|
|
323
339
|
|
|
324
340
|
if (reader) {
|
|
325
341
|
return { name, reader };
|
|
326
342
|
}
|
|
327
343
|
|
|
328
344
|
reader = {
|
|
329
|
-
init(this:
|
|
345
|
+
init(this: AnyParserState) {
|
|
330
346
|
// the same reader instance is used for every element of that data type: the value must be
|
|
331
347
|
// reset here, or the element being read would inherit the fields of the previously read one
|
|
332
348
|
// ( or of the enclosing one, when the structure refers to itself ).
|
|
333
349
|
this.value = undefined;
|
|
334
350
|
},
|
|
335
|
-
finish(this:
|
|
351
|
+
finish(this: AnyParserState) {
|
|
336
352
|
/** empty */
|
|
337
353
|
},
|
|
338
354
|
parser: {
|
|
339
355
|
/** empty */
|
|
340
356
|
}
|
|
341
357
|
};
|
|
358
|
+
// `reader.parser` is guaranteed defined: it was just set as a literal above, and the
|
|
359
|
+
// ReaderStateParserLike interface only declares it optional for other unrelated call sites.
|
|
360
|
+
const readerParser = reader.parser;
|
|
361
|
+
if (!readerParser) {
|
|
362
|
+
throw new Error("internal error: reader.parser must be defined");
|
|
363
|
+
}
|
|
342
364
|
|
|
343
365
|
if (definition instanceof StructureDefinition) {
|
|
344
366
|
// the reader must be registered *before* its fields are explored: a structure may refer to
|
|
@@ -363,72 +385,75 @@ function _makeTypeReader(
|
|
|
363
385
|
throw new Error(`??? ${field.dataType} ${field.name}`);
|
|
364
386
|
}
|
|
365
387
|
|
|
366
|
-
|
|
388
|
+
readerParser[field.name || ""] = {
|
|
367
389
|
parser: fieldParser.parser,
|
|
368
390
|
// the field reader borrows the partial's sub-parsers: it must borrow its init
|
|
369
391
|
// too, or the state those sub-parsers write into is never set up.
|
|
370
|
-
init(this:
|
|
392
|
+
init(this: AnyParserState, elementName: string, attrs: XmlAttributes, parent: IReaderState, engine: Xml2Json) {
|
|
371
393
|
if (fieldParser.init) {
|
|
372
394
|
fieldParser.init.call(this, elementName, attrs, parent, engine);
|
|
373
395
|
}
|
|
374
396
|
},
|
|
375
397
|
// endElement: fieldReader.endElement,
|
|
376
|
-
finish(this:
|
|
398
|
+
finish(this: AnyParserState) {
|
|
377
399
|
const elName = lowerFirstLetter(field.name || "");
|
|
378
400
|
if (fieldParser.finish) {
|
|
379
401
|
fieldParser.finish.call(this);
|
|
380
402
|
} else {
|
|
381
|
-
|
|
403
|
+
// c8 ignore next
|
|
404
|
+
doDebug && debugLog(`xxx check ${fieldTypename}`);
|
|
382
405
|
}
|
|
383
406
|
this.parent.value = this.parent.value || Object.create(null);
|
|
384
|
-
this.parent.value[elName] = _clone(this.value);
|
|
407
|
+
(this.parent.value as Record<string, unknown>)[elName] = _clone(this.value);
|
|
385
408
|
}
|
|
386
409
|
};
|
|
387
410
|
} else if (field.valueRank === 1) {
|
|
388
411
|
const listReader: ReaderStateParserLike = {
|
|
389
|
-
init(this:
|
|
412
|
+
init(this: AnyParserState) {
|
|
390
413
|
this.value = [];
|
|
391
414
|
},
|
|
392
415
|
parser: {
|
|
393
416
|
/** empty */
|
|
394
417
|
},
|
|
395
|
-
finish(this:
|
|
396
|
-
const elName = lowerFirstLetter(this.name);
|
|
418
|
+
finish(this: AnyParserState) {
|
|
419
|
+
const elName = lowerFirstLetter(this.name || "");
|
|
397
420
|
this.parent.value = this.parent.value || Object.create(null);
|
|
398
|
-
this.parent.value[elName] = this.value;
|
|
421
|
+
(this.parent.value as Record<string, unknown>)[elName] = this.value;
|
|
399
422
|
this.value = undefined;
|
|
400
423
|
},
|
|
401
424
|
startElement(_name: string, _attrs: XmlAttributes) {
|
|
402
425
|
// empty
|
|
403
426
|
},
|
|
404
|
-
endElement(element: string) {
|
|
405
|
-
this.value.push(_clone(this.parser[element].value));
|
|
427
|
+
endElement(this: AnyParserState, element: string) {
|
|
428
|
+
(this.value as unknown[]).push(_clone(this.parser[element].value));
|
|
406
429
|
}
|
|
407
430
|
};
|
|
408
|
-
listReader.parser
|
|
409
|
-
|
|
431
|
+
const listReaderParser = listReader.parser;
|
|
432
|
+
if (!listReaderParser) {
|
|
433
|
+
throw new Error("internal error: listReader.parser must be defined");
|
|
434
|
+
}
|
|
435
|
+
listReaderParser[fieldTypename] = fieldParser;
|
|
436
|
+
readerParser[field.name || ""] = listReader;
|
|
410
437
|
} else {
|
|
411
438
|
throw new Error("Unsupported ValueRank !");
|
|
412
439
|
}
|
|
413
440
|
}
|
|
414
441
|
return { name, reader };
|
|
415
442
|
} else if (definition instanceof EnumDefinition) {
|
|
416
|
-
const turnToInt = (value:
|
|
443
|
+
const turnToInt = (value: string) => {
|
|
417
444
|
// Green_100
|
|
418
445
|
return parseInt(value.split("_")[1], 10);
|
|
419
446
|
};
|
|
420
447
|
return {
|
|
421
448
|
name,
|
|
422
449
|
reader: {
|
|
423
|
-
finish(this:
|
|
450
|
+
finish(this: AnyParserState) {
|
|
424
451
|
this.value = turnToInt(this.text);
|
|
425
452
|
}
|
|
426
453
|
}
|
|
427
454
|
};
|
|
428
455
|
} else if (definition?.dataType === DataType.Variant) {
|
|
429
456
|
// <Value><String>Foo</String></Value>
|
|
430
|
-
type Task = (addressSpace: any) => Promise<void>;
|
|
431
|
-
|
|
432
457
|
let variantOptions: VariantOptions = Object.create(null);
|
|
433
458
|
|
|
434
459
|
const variantReader = makeVariantReader(
|
|
@@ -444,11 +469,11 @@ function _makeTypeReader(
|
|
|
444
469
|
return {
|
|
445
470
|
name,
|
|
446
471
|
reader: {
|
|
447
|
-
init(this:
|
|
472
|
+
init(this: AnyParserState, _name: string, _attrs: XmlAttributes, _parent: IReaderState, _engine: Xml2Json) {
|
|
448
473
|
this.obj = {};
|
|
449
474
|
},
|
|
450
475
|
...variantReader,
|
|
451
|
-
finish(this:
|
|
476
|
+
finish(this: AnyParserState) {
|
|
452
477
|
this.value = new Variant(variantOptions);
|
|
453
478
|
}
|
|
454
479
|
}
|
|
@@ -456,7 +481,7 @@ function _makeTypeReader(
|
|
|
456
481
|
} else {
|
|
457
482
|
// basic datatype
|
|
458
483
|
const typeName: string = DataType[definition.dataType];
|
|
459
|
-
const reader = partials[typeName as keyof typeof partials] as
|
|
484
|
+
const reader = partials[typeName as keyof typeof partials] as ReaderStateParserLike;
|
|
460
485
|
// c8 ignore next
|
|
461
486
|
if (!reader) {
|
|
462
487
|
throw new Error(`missing parse for ${typeName}`);
|
|
@@ -478,14 +503,22 @@ export function makeXmlExtensionObjectReader(
|
|
|
478
503
|
throw new Error("Expecting StructureDefinition");
|
|
479
504
|
}
|
|
480
505
|
//
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
506
|
+
interface Reader1State extends IReaderState {
|
|
507
|
+
_pojo?: unknown;
|
|
508
|
+
parser: Record<string, AnyParserState>;
|
|
509
|
+
}
|
|
510
|
+
const reader1 = {
|
|
511
|
+
parser: {} as Record<string, AnyParserState>,
|
|
512
|
+
endElement(this: Reader1State) {
|
|
484
513
|
this._pojo = this.parser[name].value;
|
|
485
514
|
}
|
|
486
515
|
};
|
|
487
516
|
const { reader } = _makeTypeReader(dataTypeNodeId, definitionMap, readerMap, translateNodeId);
|
|
488
|
-
reader1.parser
|
|
517
|
+
const reader1Parser = reader1.parser;
|
|
518
|
+
if (!reader1Parser) {
|
|
519
|
+
throw new Error("internal error: reader1.parser must be defined");
|
|
520
|
+
}
|
|
521
|
+
reader1Parser[name] = reader as unknown as AnyParserState;
|
|
489
522
|
|
|
490
|
-
return new ReaderState(reader1);
|
|
523
|
+
return new ReaderState(reader1 as unknown as ReaderStateParser);
|
|
491
524
|
}
|
|
@@ -38,7 +38,7 @@ export async function promoteObjectAndVariablesInNamespace(namespace: INamespace
|
|
|
38
38
|
}
|
|
39
39
|
const before = a.constructor.name;
|
|
40
40
|
|
|
41
|
-
promoter.promoter(a as
|
|
41
|
+
promoter.promoter(a as UAVariable & UAObject);
|
|
42
42
|
const after = a.constructor.name;
|
|
43
43
|
// c8 ignore next
|
|
44
44
|
if (doDebug) {
|