phptest 0.0.3 → 0.0.6

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.3",
2
+ "version": "0.0.6",
3
3
  "name": "phptest",
4
4
  "description": "Test helper library for PHP core runtime components",
5
5
  "keywords": [
@@ -29,16 +29,16 @@
29
29
  "lie": "^3.3.0",
30
30
  "microdash": "^1.4.2",
31
31
  "regexp.escape": "^1.1.0",
32
- "source-map": "^0.7.3"
32
+ "source-map": "^0.8.0-beta.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "phpcore": "^7.1.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "core-js-pure": "^3.21.1",
39
- "mocha": "^9.2.2",
39
+ "mocha": "^10.0.0",
40
40
  "phptoast": "^9.0.1",
41
- "phptojs": "^9.0.0"
41
+ "phptojs": "^9.0.1"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=12"
@@ -28,11 +28,12 @@ var _ = require('microdash'),
28
28
  */
29
29
  module.exports = function (phpCorePath, initRuntime) {
30
30
  var
31
- OpcodeExecutor = require(phpCorePath + '/src/Core/Opcode/Handler/OpcodeExecutor'),
32
- Reference = require(phpCorePath + '/src/Reference/Reference'),
33
- Value = require(phpCorePath + '/src/Value').sync(),
34
- Variable = require(phpCorePath + '/src/Variable').sync(),
35
- runtimeFactory = require(phpCorePath + '/src/shared/runtimeFactory'),
31
+ resolvedPHPCorePath = path.resolve(phpCorePath),
32
+ OpcodeExecutor = require(resolvedPHPCorePath + '/src/Core/Opcode/Handler/OpcodeExecutor'),
33
+ Reference = require(resolvedPHPCorePath + '/src/Reference/Reference'),
34
+ Value = require(resolvedPHPCorePath + '/src/Value').sync(),
35
+ Variable = require(resolvedPHPCorePath + '/src/Variable').sync(),
36
+ runtimeFactory = require(resolvedPHPCorePath + '/src/shared/runtimeFactory'),
36
37
 
37
38
  // A map that allows looking up the source map data for a module later on.
38
39
  moduleDataMap = new WeakMap(),
@@ -243,7 +244,7 @@ module.exports = function (phpCorePath, initRuntime) {
243
244
  stack = stack.replace(
244
245
  // Find stack frames for the transpiled PHP code - source maps would not be handled natively
245
246
  // even if we embedded them in the generated JS, so we need to perform manual mapping
246
- /\(eval at transpile \(.*\/test\/integration\/tools.js:\d+:\d+\), <anonymous>:(\d+):(\d+)\)/g,
247
+ /\(eval at transpile \(.*\/phptest\/src\/createIntegrationTools\.js:\d+:\d+\), <anonymous>:(\d+):(\d+)\)/g,
247
248
  function (all, line, column) {
248
249
  var mappedPosition = sourceMapConsumer.originalPositionFor({
249
250
  // Note: These number casts are required, the source-map library
@@ -272,7 +273,7 @@ module.exports = function (phpCorePath, initRuntime) {
272
273
  stack = stack.replace(/(?:(?:.*\/path\/to\/internal.*)([\r\n]*))+/mg, ' at [Node.js internals]$1');
273
274
 
274
275
  // Normalise PHPCore frames
275
- stack = stack.replace(new RegExp(escapeRegex(phpCorePath), 'g'), '/path/to/phpcore');
276
+ stack = stack.replace(new RegExp(escapeRegex(resolvedPHPCorePath), 'g'), '/path/to/phpcore');
276
277
 
277
278
  return stack;
278
279
  });