kzc
abbeb266b5
[ES6] output parens for yield when parented by AST_Dot or AST_Sub ( #1419 )
2017-01-19 17:15:59 +01:00
kzc
ec2e5fa3a2
Have minify() and tests use figure_out_scope() as uglifyjs CLI does
...
Clarify docs, help and tests for --support-ie8 and screw_ie8=false
2017-01-19 17:14:33 +01:00
Anthony Van de Gejuchte
da17766ddd
Add preventive test involving non-ascii function identifiers
2017-01-19 17:13:33 +01:00
Anthony Van de Gejuchte
b11c5151bc
Fix regression with non-ascii function identifiers
...
Regression since 110a1ac885
2017-01-19 16:47:37 +01:00
Richard van Velzen
ee26e7f11b
Merge branch 'master' into harmony
2016-11-29 20:50:27 +01:00
Martijn Swaagman
98f330658f
Generate source map data from normalized files
...
If using `inSourceMap` this fix will ensure the copying of `sourcesContent` is based on potentially normalized `sources` values (https://github.com/mozilla/source-map/blob/master/lib/source-map-consumer.js#L304-L309 ).
For example `normalize` (https://github.com/mozilla/source-map/blob/master/lib/util.js#L80-L123 ) will rewrite `./dist/mySource.js` to `dist/mySource.js` in the target `_sources` of the `SourceMapConsumer`. As a result `orig_map.sourceContentFor(source, true);` would return `null` since the orginal `source` was no longer available in the consumer. By using the keys generating from the `SourceMapConsumer.constructor` consistency is ensured.
2016-11-29 20:42:56 +01:00
Anthony Van de Gejuchte
1b2c02c944
Fix nlb property for template strings tokens starting with nlb
...
Also add .gitattributes to checkout lf eol style
2016-11-29 20:36:00 +01:00
Anthony Van de Gejuchte
0aa526e72c
Do not allow arrow functions in the middle of an expression
2016-11-29 20:32:05 +01:00
1111hui
0a35acbbe7
feat: add option.outFileName for JS API, if absense, sourceMap.file field will deduced
2016-11-29 20:29:12 +01:00
Ashley (Scirra)
2a9989dd18
Add --mangle-props-debug and fix --mangle-props=unquoted collision
...
Patch by @AshleyScirra
Based on: PR #1316
Renamed the CLI debug option to --mangle-props-debug
Fixes : #1321 name collision in --mangle-props=unquoted
2016-11-29 20:25:39 +01:00
Anthony Van de Gejuchte
79b98a9fe8
Do not overwrite options.comments + cleanup
2016-11-29 20:24:08 +01:00
Anthony Van de Gejuchte
c2112d5886
Fix case where a lonely var is used as computed property
2016-11-29 20:19:01 +01:00
Anthony Van de Gejuchte
057de570e6
Pass mangle options to figure_out_scope before mangling in tests
2016-10-27 22:55:49 +02:00
Anthony Van de Gejuchte
5f6825f9ec
Introduce is_block_scope to AST_Node to determine block scope.
...
Will return false if AST_Node is instance of AST_Scope for now.
2016-10-24 21:28:32 +02:00
Richard van Velzen
b7bb706150
Merge branch 'master' into harmony
2016-10-23 22:11:27 +02:00
Anthony Van de Gejuchte
8d74f34373
Don't filter shebangs when using the 'some' comment filter
...
Also clarify documentation a bit more about using regexp as filter
2016-10-23 21:31:03 +02:00
Jann Horn
266ddd9639
fix uses_arguments handling (broken since 6605d15783)
...
Using the symbol declaration tracking of UglifyJS doesn't make sense here
anyway, `arguments` always comes from something in the current scope.
fixes #1299
2016-10-23 21:29:18 +02:00
pengzhenqing
e51c6ba380
Add an option for writing inline source map
2016-10-23 21:21:39 +02:00
Anthony Van de Gejuchte
32c2cc33bb
Improve binding patterns for arrow functions
2016-10-23 21:13:12 +02:00
Anthony Van de Gejuchte
947b8750e8
Make classes implicitly strict mode
2016-10-17 20:24:38 +02:00
Richard van Velzen
6389e52305
Remove console.log and add extra test case
2016-10-06 14:11:32 +02:00
Richard van Velzen
e05510f3bc
Add an option to wrap IIFEs in parenthesis
...
For #1307 .
2016-10-06 14:11:32 +02:00
kzc
fc9804b909
Fix (typeof side_effect()) in boolean context
...
Fixes #1289 with suggestion by @rvanvelzen
2016-10-06 13:50:11 +02:00
alexlamsl
4761d07e0b
Optimize unmodified variables
2016-10-01 11:36:11 +02:00
kzc
88f6ff38d1
[ES6] fix template string escaping of \${...}
2016-10-01 11:32:36 +02:00
kzc
4198095a9c
[ES6] fix parsing spread arguments that are expressions
2016-09-29 13:34:22 -04:00
Anthony Van de Gejuchte
0111497fc9
Make all comment options in cli available in js api
...
Also removing more code within "loop" while at it.
2016-09-06 17:54:45 +02:00
Anthony Van de Gejuchte
13ed445607
Improve support for binding pattern
...
Including improvements for parameters, variable assignment and
catch parameter.
2016-09-05 17:48:48 +02:00
Richard van Velzen
1db50c3b16
Don't parenthesize arrow functions in parameter lists
2016-09-02 09:35:31 +02:00
kzc
25fc02743a
Account for side effects in string + expr optimization
2016-09-01 09:24:56 -04:00
Richard van Velzen
7f6b5d662b
Merge branch 'master' into harmony
2016-08-30 15:16:23 +02:00
kzc
0bd8053524
implement optimization: (x = 2 * x) ---> (x *= 2)
2016-08-30 08:43:02 -04:00
Anthony Van de Gejuchte
1c15d0db45
Fix quoting of properties
...
- Make AST_ConciseMethod child of AST_ObjectProperty.
- Fix some typos.
2016-08-26 15:06:24 +02:00
Richard van Velzen
45d81f881b
Merge branch 'master' into harmony
2016-08-17 20:21:38 +02:00
Richard van Velzen
8430123e9d
Fix negate_iife transform to return a correct tree for nested IIFEs
...
Fix for #1256 , partially reverts d854523783
2016-08-17 11:55:59 +02:00
Richard van Velzen
8c7d23dfb1
Merge branch 'master' into harmony
2016-08-17 08:50:31 +02:00
kzc
d854523783
Fix negate_iife regression #1254
2016-08-17 01:29:34 -04:00
Richard van Velzen
7fa0dbdeb9
Ignore default reserved properties in compress test
2016-08-15 09:54:15 +02:00
Richard van Velzen
c644c1292d
Merge branch 'master' into harmony
2016-08-15 09:09:04 +02:00
kzc
de619ae5a6
Fix --mangle-props and --mangle-props=unquoted
...
Fixes : #1247
Fix --mangle-props and --name-cache inconsistency.
AST_Dot and AST_Sub properties are now mangled by --mangle-props
without regard to being used in an assignment statement.
Note: if --mangle-props is used then *all* javascript files used must
be uglified with the same mangle options.
Fix the ignore_quoted=true mangle option, also known as
`--mangle-props=unquoted`. If a given property is quoted anywhere
it will not be mangled in any quoted or non-quoted context.
2016-08-14 21:51:25 +02:00
kzc
86859f6d7e
Additional object literal property tests
2016-08-14 21:49:43 +02:00
kzc
dcdcfe4d39
Add input file glob support to minify()
2016-08-14 21:46:38 +02:00
Lucas Wiener
38756b1f26
Moved test input files to test/input.
2016-08-14 21:40:14 +02:00
Lucas Wiener
85a09fc3b6
Added test for #1236
2016-08-14 21:40:14 +02:00
kzc
fb049d3a81
Fix unneeded parens around unary args in new expression.
2016-08-14 21:38:38 +02:00
Anthony Van de Gejuchte
27d3669800
Don't allow escaped surrogated identifiers + introduce ascii_identifiers
...
Don't use 2 characters for surrogates in identifiers because there is
support for the \u{} syntax when escaped identifiers were introduced.
Also catch eof errors while reading identifier names
Introduce ascii_identifiers:
By setting ascii_identifiers to undefined (default value),
ascii_identifiers will print identifiers using the same setting as
ascii_only within the limits of the ecmascript 6 grammar.
ascii_identifiers accept true and false, allowing identifiers to be
printed under different settings than strings with the ascii_only setting.
2016-08-14 21:36:06 +02:00
kzc
67cca43358
Test reparsing test/compress/*.js output
2016-08-14 21:27:23 +02:00
Anthony Van de Gejuchte
110a1ac885
Make distinction between * method and * operator
...
Also add quotes to properties when necessary,
this might be the case if the name isn't a valid
identifier
2016-07-29 21:31:08 +02:00
Anthony Van de Gejuchte
3f8fc3a316
Fix computed getters + cleanup AST
2016-07-21 18:21:46 +02:00
Anthony Van de Gejuchte
88384cf351
Add more globals, whereof most defined after es5.1
...
Also do not pollute env with mocks replacing standard globals
2016-07-21 16:52:04 +02:00