fix this refer to undefined incase all this's props be proxy

This commit is contained in:
pengfei.zhou 2020-01-03 17:04:30 +08:00 committed by osborn
parent 680b95f05d
commit a6419e0fdf
4 changed files with 4 additions and 4 deletions

View File

@ -4818,7 +4818,7 @@ return __module.exports;},this,[{exports:{}}])])`;
return `//@ sourceURL=contextId_${contextId}.js return `//@ sourceURL=contextId_${contextId}.js
Reflect.apply(function(doric,context,Entry,require,exports,setTimeout,setInterval,clearTimeout,clearInterval){ Reflect.apply(function(doric,context,Entry,require,exports,setTimeout,setInterval,clearTimeout,clearInterval){
${content} ${content}
},doric.jsObtainContext("${contextId}"),[undefined,doric.jsObtainContext("${contextId}"),doric.jsObtainEntry("${contextId}"),doric.__require__,{},doricSetTimeout,doricSetInterval,doricClearTimeout,doricClearInterval])`; },undefined,[undefined,doric.jsObtainContext("${contextId}"),doric.jsObtainEntry("${contextId}"),doric.__require__,{},doricSetTimeout,doricSetInterval,doricClearTimeout,doricClearInterval])`;
} }
function initDoric() { function initDoric() {
injectGlobalObject("Environment", { injectGlobalObject("Environment", {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "doric-web", "name": "doric-web",
"version": "0.1.1", "version": "0.1.2",
"description": "Doric library for Web", "description": "Doric library for Web",
"main": "build/index.js", "main": "build/index.js",
"scripts": { "scripts": {

View File

@ -36,7 +36,7 @@ function packageCreateContext(contextId: string, content: string) {
return `//@ sourceURL=contextId_${contextId}.js return `//@ sourceURL=contextId_${contextId}.js
Reflect.apply(function(doric,context,Entry,require,exports,setTimeout,setInterval,clearTimeout,clearInterval){ Reflect.apply(function(doric,context,Entry,require,exports,setTimeout,setInterval,clearTimeout,clearInterval){
${content} ${content}
},doric.jsObtainContext("${contextId}"),[undefined,doric.jsObtainContext("${contextId}"),doric.jsObtainEntry("${contextId}"),doric.__require__,{},doricSetTimeout,doricSetInterval,doricClearTimeout,doricClearInterval])` },undefined,[undefined,doric.jsObtainContext("${contextId}"),doric.jsObtainEntry("${contextId}"),doric.__require__,{},doricSetTimeout,doricSetInterval,doricClearTimeout,doricClearInterval])`
} }
function initDoric() { function initDoric() {