google / google/closure-compiler

Suboptimal minification for object methods for ECMASCRIPT6 mode

Open
#3,970 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Example for https://closure-compiler.appspot.com:
```js
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @language_in ECMASCRIPT6
// @language_out ECMASCRIPT6
// @output_file_name default.js
// @formatting pretty_print
// ==/ClosureCompiler==

this['stringview_iter'] = {
'pop'() {
return Module['_BinaryenPop'](module, Module['stringview_iter']);
}
};
```
Simple / Advanced optimization (with pretty printing):
```js
'use strict';
this.stringview_iter = {pop:function() {
return Module._BinaryenPop(module, Module.stringview_iter);
}};
```

Expected:
```js
'use strict';
this.stringview_iter = {pop() {
return Module._BinaryenPop(module, Module.stringview_iter);
}};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.