From cd302bbc031c97cb6cd5cb411d8246ec17663786 Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Mon, 23 Oct 2017 15:10:19 +0800 Subject: [PATCH] add comment for window undefined --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 815918e434..3e08bad500 100644 --- a/index.js +++ b/index.js @@ -106,6 +106,8 @@ /** * @property {Boolean} CC_TEST - Running in the engine's unit test. */ + +// window may be undefined when first load engine from editor var _global = typeof window === 'undefined' ? global : window; function defineMacro (name, defaultValue) { // if "global_defs" not preprocessed by uglify, just declare them globally,