Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 4316cb7

Browse files
committed
lib: shimming V8-specific code
In order to work around a V8-specific module we'll inject a cache entry which stubs out these methods and prevents them from being parsed.
1 parent d38fe31 commit 4316cb7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/internal/bootstrap_node.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@
2727
// do this good and early, since it handles errors.
2828
setupProcessFatal();
2929

30+
if (process.jsEngine === 'chakracore') {
31+
// This file contains the V8-specific "%<function>" syntax for accessing
32+
// private functions. This is not supported on ChakraCore and causes a
33+
// parser failure. Inject a cache entry to prevent the file from being
34+
// parsed.
35+
NativeModule._cache['internal/v8'] = {
36+
loaded: true,
37+
exports: {
38+
previewMapIterator: function() {},
39+
previewSetIterator: function() {},
40+
},
41+
};
42+
}
43+
3044
setupV8();
3145
setupProcessICUVersions();
3246

0 commit comments

Comments
 (0)