feat:add sourceUrl so that the script can be debuged

This commit is contained in:
pengfei.zhou 2019-12-22 02:12:23 +08:00
parent bde3315b2d
commit 0786c12e5e

View File

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