diff options
author | Richard van Velzen <rvanvelzen@experty.com> | 2015-07-31 15:56:33 +0200 |
---|---|---|
committer | Richard van Velzen <rvanvelzen@experty.com> | 2015-08-05 21:18:39 +0200 |
commit | 759b3f7d6df1cecaefd987218373ce3db3646845 (patch) | |
tree | 7bf50a6e91e53879df8f5949ff497f733045a7b0 /test/compress | |
parent | 958b6c2e57ea64cf876c3f884db2a76f11f7074f (diff) | |
download | tracifyjs-759b3f7d6df1cecaefd987218373ce3db3646845.tar.gz tracifyjs-759b3f7d6df1cecaefd987218373ce3db3646845.zip |
Fix mangling of property names which overwrite unmangleable properties
Fixes #747.
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/issue-747.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/issue-747.js b/test/compress/issue-747.js new file mode 100644 index 00000000..0a4e4502 --- /dev/null +++ b/test/compress/issue-747.js @@ -0,0 +1,37 @@ +dont_reuse_prop: { + mangle_props = { + regex: /asd/ + }; + + input: { + var obj = {}; + obj.a = 123; + obj.asd = 256; + console.log(obj.a); + } + expect: { + var obj = {}; + obj.a = 123; + obj.b = 256; + console.log(obj.a); + } +} + +unmangleable_props_should_always_be_reserved: { + mangle_props = { + regex: /asd/ + }; + + input: { + var obj = {}; + obj.asd = 256; + obj.a = 123; + console.log(obj.a); + } + expect: { + var obj = {}; + obj.b = 256; + obj.a = 123; + console.log(obj.a); + } +}
\ No newline at end of file |