@akashic/headless-driver 2.15.10 → 2.15.11

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/Looper.js CHANGED
@@ -53,9 +53,9 @@ class Looper {
53
53
  this._errorHandler(e);
54
54
  return;
55
55
  }
56
- this._prev = Date.now();
56
+ this._prev = performance.now();
57
57
  this._timerId = setInterval(() => {
58
- const now = Date.now();
58
+ const now = performance.now();
59
59
  try {
60
60
  this._fun(now - this._prev);
61
61
  }
@@ -142,7 +142,6 @@ class Runner {
142
142
  this.timekeeperTimerId = null;
143
143
  }
144
144
  onError(error) {
145
- this.stop();
146
145
  this.errorTrigger.fire(error);
147
146
  }
148
147
  }
@@ -127,7 +127,7 @@ class RunnerManager {
127
127
  runner = new v1_1.RunnerV1(runnerParameter);
128
128
  }
129
129
  runner.errorTrigger.add((err) => {
130
- (0, Logger_1.getSystemLogger)().error(err.message);
130
+ (0, Logger_1.getSystemLogger)().error(err);
131
131
  this.stopRunner(runnerId);
132
132
  return true;
133
133
  });
@@ -41,12 +41,13 @@ class NodeScriptAsset extends engine_files_v1_1.akashicEngine.ScriptAsset {
41
41
  globalThis.g = g;
42
42
  }
43
43
  `, context)(console, execEnv);
44
- (0, vm_1.runInContext)(`
45
- (function(exports, require, module, __filename, __dirname) {
46
- ${this.script}
47
- })(g.module.exports, g.module.require, g.module, g.filename, g.dirname);
48
- `, context, {
49
- filename: `${this.path}`
44
+ (0, vm_1.runInContext)([
45
+ "(function(exports, require, module, __filename, __dirname) {",
46
+ `${this.script}`,
47
+ "})(g.module.exports, g.module.require, g.module, g.filename, g.dirname);"
48
+ ].join("\n"), context, {
49
+ filename: `${this.path}`,
50
+ lineOffset: -1
50
51
  });
51
52
  }
52
53
  catch (e) {
@@ -41,12 +41,13 @@ class NodeScriptAsset extends engine_files_v2_1.akashicEngine.ScriptAsset {
41
41
  globalThis.g = g;
42
42
  }
43
43
  `, context)(console, execEnv);
44
- (0, vm_1.runInContext)(`
45
- (function(exports, require, module, __filename, __dirname) {
46
- ${this.script}
47
- })(g.module.exports, g.module.require, g.module, g.filename, g.dirname);
48
- `, context, {
49
- filename: `${this.path}`
44
+ (0, vm_1.runInContext)([
45
+ "(function(exports, require, module, __filename, __dirname) {",
46
+ `${this.script}`,
47
+ "})(g.module.exports, g.module.require, g.module, g.filename, g.dirname);"
48
+ ].join("\n"), context, {
49
+ filename: `${this.path}`,
50
+ lineOffset: -1
50
51
  });
51
52
  }
52
53
  catch (e) {
@@ -60,13 +60,14 @@ class NodeScriptAsset extends Asset_1.Asset {
60
60
  globalThis.g = g;
61
61
  }
62
62
  `, context)(console, execEnv);
63
- (0, vm_1.runInContext)(`
64
- (function(exports, require, module, __filename, __dirname) {
65
- ${this.script}
66
- ${postScript}
67
- })(g.module.exports, g.module.require, g.module, g.filename, g.dirname);
68
- `, context, {
69
- filename: `${this.path}`
63
+ (0, vm_1.runInContext)([
64
+ "(function(exports, require, module, __filename, __dirname) {",
65
+ `${this.script}`,
66
+ `${postScript}`,
67
+ "})(g.module.exports, g.module.require, g.module, g.filename, g.dirname);"
68
+ ].join("\n"), context, {
69
+ filename: `${this.path}`,
70
+ lineOffset: -1
70
71
  });
71
72
  }
72
73
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akashic/headless-driver",
3
- "version": "2.15.10",
3
+ "version": "2.15.11",
4
4
  "description": "A library to execute contents using Akashic Engine headlessly",
5
5
  "main": "lib/index.js",
6
6
  "author": "DWANGO Co., Ltd.",