chore: update asar injection for new node internal module loader
This commit is contained in:
parent
9c36576ddd
commit
b1e69e1357
2 changed files with 3 additions and 5 deletions
|
@ -119,7 +119,7 @@ class Archive : public mate::Wrappable<Archive> {
|
||||||
};
|
};
|
||||||
|
|
||||||
void InitAsarSupport(v8::Isolate* isolate,
|
void InitAsarSupport(v8::Isolate* isolate,
|
||||||
v8::Local<v8::Value> process,
|
v8::Local<v8::Value> source,
|
||||||
v8::Local<v8::Value> require) {
|
v8::Local<v8::Value> require) {
|
||||||
// Evaluate asar_init.js.
|
// Evaluate asar_init.js.
|
||||||
v8::Local<v8::Context> context(isolate->GetCurrentContext());
|
v8::Local<v8::Context> context(isolate->GetCurrentContext());
|
||||||
|
@ -134,7 +134,7 @@ void InitAsarSupport(v8::Isolate* isolate,
|
||||||
CHECK(result->IsFunction());
|
CHECK(result->IsFunction());
|
||||||
|
|
||||||
v8::Local<v8::Value> args[] = {
|
v8::Local<v8::Value> args[] = {
|
||||||
process,
|
source,
|
||||||
require,
|
require,
|
||||||
node::asar_value.ToStringChecked(isolate),
|
node::asar_value.ToStringChecked(isolate),
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
;(function () { // eslint-disable-line
|
;(function () { // eslint-disable-line
|
||||||
return function (process, require, asarSource) {
|
return function (source, require, asarSource) {
|
||||||
const source = process.binding('natives')
|
|
||||||
|
|
||||||
// Expose fs module without asar support.
|
// Expose fs module without asar support.
|
||||||
source['original-fs'] = source.fs
|
source['original-fs'] = source.fs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue