fix(runtime-core): avoid mutating EMPTY_ARR when setting dev root (#2419)

also freeze EMPTY_ARR in dev

fix #2413
This commit is contained in:
被雨水过滤的空气
2020-10-20 06:08:54 +08:00
committed by GitHub
parent e894caf731
commit edd49dcab4
5 changed files with 21 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ export const babelParserDefaultPlugins = [
export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__
? Object.freeze({})
: {}
export const EMPTY_ARR: [] = []
export const EMPTY_ARR = __DEV__ ? Object.freeze([]) : []
export const NOOP = () => {}