@noir-lang/noir_js 1.0.0-beta.4-3261a6b.nightly → 1.0.0-beta.4-a2dd9cf.nightly

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/lib/debug.cjs CHANGED
@@ -36,13 +36,13 @@ function resolveOpcodeLocations(opcodeLocations, debug, files, brilligFunctionId
36
36
  let locations = opcodeLocations.flatMap((opcodeLocation) => getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId));
37
37
  // Adds the acir call stack if the last location is a brillig opcode
38
38
  if (locations.length > 0) {
39
- const runtimeLocations = opcodeLocations[opcodeLocations.length - 1].split('.');
40
- if (runtimeLocations.length === 2) {
41
- const acirCallstackId = debug.acir_locations[runtimeLocations[0]];
39
+ const decomposedOpcodeLocation = opcodeLocations[opcodeLocations.length - 1].split('.');
40
+ if (decomposedOpcodeLocation.length === 2) {
41
+ const acirCallstackId = debug.acir_locations[decomposedOpcodeLocation[0]];
42
42
  if (acirCallstackId !== undefined) {
43
43
  const callStack = debug.location_tree.locations[acirCallstackId];
44
44
  const acirCallstack = getCallStackFromLocationNode(callStack, debug.location_tree.locations, files);
45
- locations = locations.concat(acirCallstack);
45
+ locations = acirCallstack.concat(locations);
46
46
  }
47
47
  }
48
48
  }
@@ -67,7 +67,8 @@ function getCallStackFromLocationNode(callStack, location_tree, files) {
67
67
  });
68
68
  callStack = location_tree[callStack.parent];
69
69
  }
70
- return result;
70
+ // Reverse since we explored the child nodes first
71
+ return result.reverse();
71
72
  }
72
73
  /**
73
74
  * Extracts the call stack from the location of a failing opcode and the debug metadata.
package/lib/debug.mjs CHANGED
@@ -32,13 +32,13 @@ function resolveOpcodeLocations(opcodeLocations, debug, files, brilligFunctionId
32
32
  let locations = opcodeLocations.flatMap((opcodeLocation) => getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId));
33
33
  // Adds the acir call stack if the last location is a brillig opcode
34
34
  if (locations.length > 0) {
35
- const runtimeLocations = opcodeLocations[opcodeLocations.length - 1].split('.');
36
- if (runtimeLocations.length === 2) {
37
- const acirCallstackId = debug.acir_locations[runtimeLocations[0]];
35
+ const decomposedOpcodeLocation = opcodeLocations[opcodeLocations.length - 1].split('.');
36
+ if (decomposedOpcodeLocation.length === 2) {
37
+ const acirCallstackId = debug.acir_locations[decomposedOpcodeLocation[0]];
38
38
  if (acirCallstackId !== undefined) {
39
39
  const callStack = debug.location_tree.locations[acirCallstackId];
40
40
  const acirCallstack = getCallStackFromLocationNode(callStack, debug.location_tree.locations, files);
41
- locations = locations.concat(acirCallstack);
41
+ locations = acirCallstack.concat(locations);
42
42
  }
43
43
  }
44
44
  }
@@ -63,7 +63,8 @@ function getCallStackFromLocationNode(callStack, location_tree, files) {
63
63
  });
64
64
  callStack = location_tree[callStack.parent];
65
65
  }
66
- return result;
66
+ // Reverse since we explored the child nodes first
67
+ return result.reverse();
67
68
  }
68
69
  /**
69
70
  * Extracts the call stack from the location of a failing opcode and the debug metadata.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "contributors": [
4
4
  "The Noir Team <team@noir-lang.org>"
5
5
  ],
6
- "version": "1.0.0-beta.4-3261a6b.nightly",
6
+ "version": "1.0.0-beta.4-a2dd9cf.nightly",
7
7
  "packageManager": "yarn@4.5.2",
8
8
  "license": "(MIT OR Apache-2.0)",
9
9
  "type": "module",
@@ -17,9 +17,9 @@
17
17
  "url": "https://github.com/noir-lang/noir/issues"
18
18
  },
19
19
  "dependencies": {
20
- "@noir-lang/acvm_js": "1.0.0-beta.4-3261a6b.nightly",
21
- "@noir-lang/noirc_abi": "1.0.0-beta.4-3261a6b.nightly",
22
- "@noir-lang/types": "1.0.0-beta.4-3261a6b.nightly",
20
+ "@noir-lang/acvm_js": "1.0.0-beta.4-a2dd9cf.nightly",
21
+ "@noir-lang/noirc_abi": "1.0.0-beta.4-a2dd9cf.nightly",
22
+ "@noir-lang/types": "1.0.0-beta.4-a2dd9cf.nightly",
23
23
  "pako": "^2.1.0"
24
24
  },
25
25
  "files": [