diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 2d197c768c7107..48d83f12e12186 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -252,6 +252,15 @@ return NativeModule._source[id]; }; + NativeModule.wrap = function(script) { + return NativeModule.wrapper[0] + script + NativeModule.wrapper[1]; + }; + + NativeModule.wrapper = [ + '(function (exports, require, module, process, internalBinding) {', + '\n});' + ]; + const getOwn = (target, property, receiver) => { return ReflectApply(ObjectHasOwnProperty, target, [property]) ? ReflectGet(target, property, receiver) :