Put expression after extend between parentheses if necessary (#1780)
This commit is contained in:
committed by
Alex Lam S.L
parent
2377171200
commit
c20bb99a62
@@ -665,6 +665,7 @@ function OutputStream(options) {
|
|||||||
* ==> 20 (side effect, set a := 10 and b := 20) */
|
* ==> 20 (side effect, set a := 10 and b := 20) */
|
||||||
|| p instanceof AST_Arrow // x => (x, x)
|
|| p instanceof AST_Arrow // x => (x, x)
|
||||||
|| p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
|
|| p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
|
||||||
|
|| (p instanceof AST_Class && p.extends === this) // class D extends (calls++, C) {}
|
||||||
;
|
;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,13 @@ class_methods_and_getters_with_keep_quoted_props_enabled: {
|
|||||||
expect_exact: 'class clss{a(){}"b"(){}get c(){return"c"}get"d"(){return"d"}set e(a){doSomething(a)}set\'f\'(a){doSomething(b)}static g(){}static"h"(){}}'
|
expect_exact: 'class clss{a(){}"b"(){}get c(){return"c"}get"d"(){return"d"}set e(a){doSomething(a)}set\'f\'(a){doSomething(b)}static g(){}static"h"(){}}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
classes_with_expression_as_expand: {
|
||||||
|
input: {
|
||||||
|
class D extends (calls++, C) {}
|
||||||
|
}
|
||||||
|
expect_exact: "class D extends(calls++,C){}"
|
||||||
|
}
|
||||||
|
|
||||||
new_target: {
|
new_target: {
|
||||||
input: {
|
input: {
|
||||||
new.target;
|
new.target;
|
||||||
|
|||||||
Reference in New Issue
Block a user