提交 5995070e 编写于 作者: fxy060608's avatar fxy060608

feat(v3): add restoreGlobal

上级 840995bb
......@@ -192,7 +192,7 @@ const third = [
'offPush',
'requireNativePlugin',
'upx2px',
'registerPlus'
'restoreGlobal'
]
const apis = [
......
......@@ -204,7 +204,7 @@ var serviceContext = (function () {
'offPush',
'requireNativePlugin',
'upx2px',
'registerPlus'
'restoreGlobal'
];
const apis = [
......@@ -5853,7 +5853,8 @@ var serviceContext = (function () {
);
}
function restoreGlobal (
function restoreGlobal(
newWeex,
newPlus,
newSetTimeout,
newClearTimeout,
......@@ -5868,7 +5869,8 @@ var serviceContext = (function () {
if (process.env.NODE_ENV !== 'production') {
console.log(`[restoreGlobal][${Date.now()}]`);
}
plus = newPlus;
weex = newWeex;
plus = newPlus;
/* eslint-disable no-global-assign */
setTimeout = newSetTimeout;
clearTimeout = newClearTimeout;
......
......@@ -12,7 +12,7 @@ module.exports = function definePages (appJson) {
name: 'define-pages.js',
content: `
if(uni.restoreGlobal){
uni.restoreGlobal(plus,setTimeout,clearTimeout,setInterval,clearInterval)
uni.restoreGlobal(weex,plus,setTimeout,clearTimeout,setInterval,clearInterval)
}
${generatePageCode(appJson.pages, appJson.page)}
`
......
export function restoreGlobal (
export function restoreGlobal(
newWeex,
newPlus,
newSetTimeout,
newClearTimeout,
......@@ -13,7 +14,8 @@ export function restoreGlobal (
if (process.env.NODE_ENV !== 'production') {
console.log(`[restoreGlobal][${Date.now()}]`)
}
plus = newPlus
weex = newWeex
plus = newPlus
/* eslint-disable no-global-assign */
setTimeout = newSetTimeout
clearTimeout = newClearTimeout
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册