Created
February 3, 2017 15:57
-
-
Save ghaiklor/45a906a618444604bbb3b04a570dd38e to your computer and use it in GitHub Desktop.
NativeModule.prototype.compile() sources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NativeModule.prototype.compile = function() { | |
var source = NativeModule.getSource(this.id); | |
source = NativeModule.wrap(source); | |
this.loading = true; | |
try { | |
const fn = runInThisContext(source, { | |
filename: this.filename, | |
lineOffset: 0, | |
displayErrors: true | |
}); | |
fn(this.exports, NativeModule.require, this, this.filename); | |
this.loaded = true; | |
} finally { | |
this.loading = false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment