You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terser output or error
terser outputs code with a newline after a return statement. The return statement is followed by the @license comment and then the inlined function. The newline causes a semicolon to be injected which means the rest of the function becomes unreachable code.
grep -A17 -E 'return$' terser-output.js
*/function isElement(node){return 1===node.nodeType}var getRootNode=Node.prototype.getRootNode||function(){for(var cur
=this,prev=cur;cur;)prev=cur,cur=cur.parentNode;return prev};function getFocusedPath(node,root){var activeElement=funct
ion(node){var root=getRootNode.call(node);return
/**
* @license
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function(node){return 11===node.nodeType||9===node.nodeType}(root)?root.activeElement:null}(node);return activeElement&
&node.contains(activeElement)?function(node,root){for(var ancestry=[],cur=node;cur!==root;){var n=cur;ancestry.push(n),
cur=n.parentNode}return ancestry}(activeElement,root):[]}
--
*/function isElement(node){return 1===node.nodeType}var getRootNode=Node.prototype.getRootNode||function(){for(var cur
=this,prev=cur;cur;)prev=cur,cur=cur.parentNode;return prev};function getFocusedPath(node,root){var activeElement=funct
ion(node){var root=getRootNode.call(node);return
/**
* @license
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function(node){return 11===node.nodeType||9===node.nodeType}(root)?root.activeElement:null}(node);return activeElement&
&node.contains(activeElement)?function(node,root){for(var ancestry=[],cur=node;cur!==root;){var n=cur;ancestry.push(n),
cur=n.parentNode}return ancestry}(activeElement,root):[]}
Expected result
That terser doesn't output broken code. In this case I'm not quite sure what the correct solution is. Some options could be to thrown an error or not to inline functions with @license comments or perhaps removing the newline before and after the comment.
Sorry in advance for the large testcase. I'm having trouble triggering the bug in a reduced example.
The text was updated successfully, but these errors were encountered:
Bug report or Feature request?
Bug
Version (complete output of
terser -V
or specific git commit)4.6.6
Complete CLI command or
minify()
options usedterser
inputhttps://cdn.jsdelivr.net/npm/dawa-autocomplete2@1.0.2/dist/js/unfilled/dawa-autocomplete2.es.js
terser
output or errorterser outputs code with a newline after a
return
statement. Thereturn
statement is followed by the@license
comment and then the inlined function. The newline causes a semicolon to be injected which means the rest of the function becomes unreachable code.Expected result
That terser doesn't output broken code. In this case I'm not quite sure what the correct solution is. Some options could be to thrown an error or not to inline functions with
@license
comments or perhaps removing the newline before and after the comment.Sorry in advance for the large testcase. I'm having trouble triggering the bug in a reduced example.
The text was updated successfully, but these errors were encountered: