]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: avoid object.freeze in prod
authorEvan You <yyx990803@gmail.com>
Tue, 17 Sep 2019 20:23:29 +0000 (16:23 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 17 Sep 2019 20:23:29 +0000 (16:23 -0400)
packages/shared/README.md
packages/shared/src/index.ts

index 6f4b137f131ea60047b365c59b6a0a5d8dc3aa3a..71f4bdc2c6197b3db2f592fac9abd83d58cae149 100644 (file)
@@ -1 +1,3 @@
-# @vue/shared
\ No newline at end of file
+# @vue/shared
+
+Utility functions and constants shared across packages. This package itself is private and never published. It is inlined into other packages during build - rollup's tree-shaking ensures that only functions used by the importing package are included.
index 19cca5ef68c35bada403fd5708cf7e621a0c2548..06afee317977102f40c89f4951b32a95f0b1e9ba 100644 (file)
@@ -1,4 +1,6 @@
-export const EMPTY_OBJ: { readonly [key: string]: any } = Object.freeze({})
+export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__
+  ? Object.freeze({})
+  : {}
 export const EMPTY_ARR: [] = []
 
 export const NOOP = () => {}