mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
default settings for globalEvaluationScope
This commit is contained in:
parent
c9ef9e6a7b
commit
a75bc78490
@ -38,6 +38,13 @@ hookConstructor(function(constructor) {
|
||||
this.globalEvaluationScope = true;
|
||||
this.pluginFirst = false;
|
||||
|
||||
// Default settings for globalEvaluationScope:
|
||||
// Disabled for WebWorker, Chrome Extensions and jsdom
|
||||
if (isWorker
|
||||
|| isBrowser && window.chrome && window.chrome.extension
|
||||
|| isBrowser && navigator.userAgent.match(/^Node\.js/))
|
||||
this.globalEvaluationScope = false;
|
||||
|
||||
// support the empty module, as a concept
|
||||
this.set('@empty', this.newModule({}));
|
||||
|
||||
|
||||
@ -63,14 +63,8 @@ var __exec;
|
||||
}
|
||||
}
|
||||
|
||||
// Web Worker and Chrome Extensions use original ESML eval
|
||||
// this may lead to some global module execution differences (eg var not defining onto global)
|
||||
if (isWorker || isBrowser && window.chrome && window.chrome.extension) {
|
||||
__exec = evalExec;
|
||||
}
|
||||
|
||||
// use script injection eval to get identical global script behaviour
|
||||
else if (typeof document != 'undefined' && document.getElementsByTagName) {
|
||||
if (typeof document != 'undefined' && document.getElementsByTagName) {
|
||||
var head;
|
||||
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user