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

Commit

Permalink
lib: shimming V8-specific code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kfarnung committed Dec 4, 2017
1 parent d38fe31 commit 4316cb7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@
// do this good and early, since it handles errors.
setupProcessFatal();

if (process.jsEngine === 'chakracore') {
// This file contains the V8-specific "%<function>" syntax for accessing
// private functions. This is not supported on ChakraCore and causes a
// parser failure. Inject a cache entry to prevent the file from being
// parsed.
NativeModule._cache['internal/v8'] = {
loaded: true,
exports: {
previewMapIterator: function() {},
previewSetIterator: function() {},
},
};
}

setupV8();
setupProcessICUVersions();

Expand Down

0 comments on commit 4316cb7

Please sign in to comment.