@@ -33,19 +33,19 @@ alert("111")
33
33
34
34
const script1 = 'customVar1 + "--" + customVar2 + "---"' ;
35
35
36
- var initFunc = function ( interpreter , globalObject ) {
36
+ var initFunc = function ( context , globalObject ) {
37
37
// Object
38
38
var object = { log : window . console . log } ;
39
- interpreter . setProperty ( globalObject , 'console' , interpreter . nativeToPseudo ( object ) ) ;
39
+ context . setProperty ( globalObject , 'console' , context . nativeToPseudo ( object ) ) ;
40
40
// Func(同步/异步)
41
41
var fun = function alert ( text ) {
42
42
return window . alert ( text ) ;
43
43
} ;
44
- interpreter . setProperty ( globalObject , 'alert' , interpreter . nativeToPseudo ( fun ) ) ;
44
+ context . setProperty ( globalObject , 'alert' , context . nativeToPseudo ( fun ) ) ;
45
45
// interpreter.setProperty(globalObject, 'alert', interpreter.createAsyncFunction(fun));
46
46
// Other
47
- interpreter . setProperty ( globalObject , 'customVar1' , 'customVar1' ) ;
48
- interpreter . setProperty ( globalObject , 'customVar2' , 'customVar2' ) ;
47
+ context . setProperty ( globalObject , 'customVar1' , 'customVar1' ) ;
48
+ context . setProperty ( globalObject , 'customVar2' , 'customVar2' ) ;
49
49
} ;
50
50
51
51
// 使用 Babel 转译代码
0 commit comments