From 04ed89230ed68b59acaacc8ef7ae9b55e3d1ef90 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 18 Sep 2015 17:44:19 -0700 Subject: [PATCH 01/39] Add tests for exponentiation --- ...ponentiationAssignmentLHSCanBeAssigned1.ts | 26 ++++ ...ponentiationAssignmentLHSCanBeAssigned2.ts | 60 +++++++++ ...dExponentiationAssignmentLHSIsReference.ts | 26 ++++ ...poundExponentiationAssignmentLHSIsValue.ts | 85 +++++++++++++ .../emitCompoundExponentiationOperator1.ts | 20 +++ .../emitExponentiationOperator1.ts | 32 +++++ .../emitExponentiationOperator2.ts | 32 +++++ ...ExponentiationOperatorInTemplateString1.ts | 10 ++ .../exponentiationOperatorWithAnyAndNumber.ts | 12 ++ .../exponentiationOperatorWithEnum.ts | 24 ++++ .../exponentiationOperatorWithEnumUnion.ts | 28 ++++ ...ponentiationOperatorWithInvalidOperands.ts | 68 ++++++++++ ...OperatorWithNullValueAndInvalidOperands.ts | 23 ++++ ...onOperatorWithNullValueAndValidOperands.ts | 20 +++ ...eratorWithOnlyNullValueOrUndefinedValue.ts | 5 + ...exponentiationOperatorWithTypeParameter.ts | 20 +++ ...torWithUndefinedValueAndInvalidOperands.ts | 23 ++++ ...ratorWithUndefinedValueAndValidOperands.ts | 120 ++++++++++++++++++ 18 files changed, 634 insertions(+) create mode 100644 tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithAnyAndNumber.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnum.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnumUnion.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndValidOperands.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts new file mode 100644 index 0000000000000..35b434b6bac58 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts @@ -0,0 +1,26 @@ +enum E { a, b, c } + +var a: any; +var b: number; +var c: E; + +var x1: any; +x1 **= a; +x1 **= b; +x1 **= c; +x1 **= null; +x1 **= undefined; + +var x2: number; +x2 **= a; +x2 **= b; +x2 **= c; +x2 **= null; +x2 **= undefined; + +var x3: E; +x3 **= a; +x3 **= b; +x3 **= c; +x3 **= null; +x3 **= undefined; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts new file mode 100644 index 0000000000000..7995cc8d6683a --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts @@ -0,0 +1,60 @@ +enum E { a, b } + +var a: any; +var b: void; + +var x1: boolean; +x1 **= a; +x1 **= b; +x1 **= true; +x1 **= 0; +x1 **= '' +x1 **= E.a; +x1 **= {}; +x1 **= null; +x1 **= undefined; + +var x2: string; +x2 **= a; +x2 **= b; +x2 **= true; +x2 **= 0; +x2 **= '' +x2 **= E.a; +x2 **= {}; +x2 **= null; +x2 **= undefined; + +var x3: {}; +x3 **= a; +x3 **= b; +x3 **= true; +x3 **= 0; +x3 **= '' +x3 **= E.a; +x3 **= {}; +x3 **= null; +x3 **= undefined; + +var x4: void; +x4 **= a; +x4 **= b; +x4 **= true; +x4 **= 0; +x4 **= '' +x4 **= E.a; +x4 **= {}; +x4 **= null; +x4 **= undefined; + +var x5: number; +x5 **= b; +x5 **= true; +x5 **= '' +x5 **= {}; + +var x6: E; +x6 *= b; +x6 *= true; +x6 *= '' +x6 *= {}; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts new file mode 100644 index 0000000000000..02e6acfa685fc --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts @@ -0,0 +1,26 @@ +var value; + +// identifiers: variable and parameter +var x1: number; +x1 **= value; + +function fn1(x2: number) { + x2 **= value; +} + +// property accesses +var x3: { a: number }; +x3.a **= value; + +x3['a'] **= value; + +// parentheses, the contained expression is reference +(x1) **= value; + +function fn2(x4: number) { + (x4) **= value; +} + +(x3.a) **= value; + +(x3['a']) **= value; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts new file mode 100644 index 0000000000000..0eac581bfe418 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts @@ -0,0 +1,85 @@ +// expected error for all the LHS of compound assignments (arithmetic and addition) +var value; + +// this +class C { + constructor() { + this **= value; + } + foo() { + this **= value; + } + static sfoo() { + this **= value; + } +} + +function foo() { + this **= value; +} + +this **= value; + +// identifiers: module, class, enum, function +module M { export var a; } +M **= value; + +C **= value; + +enum E { } +E **= value; + +foo **= value; + +// literals +null **= value; +true **= value; +false **= value; +0 **= value; +'' **= value; +/d+/ **= value; + +// object literals +{ a: 0 } **= value; + +// array literals +['', ''] **= value; + +// super +class Derived extends C { + constructor() { + super(); + super **= value; + } + + foo() { + super **= value; + } + + static sfoo() { + super **= value; + } +} + +// function expression +function bar1() { } **= value; +() => { } **= value; + +// function calls +foo() **= value; + +// parentheses, the containted expression is value +(this) **= value; +(M) **= value; +(C) **= value; +(E) **= value; +(foo) **= value; +(null) **= value; +(true) **= value; +(0) **= value; +('') **= value; +(/d+/) **= value; +({}) **= value; +([]) **= value; +(function baz1() { }) **= value; +(foo()) **= value; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts new file mode 100644 index 0000000000000..40647d37bf7ea --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts @@ -0,0 +1,20 @@ +var comp: number; + +comp **= 1; +comp **= comp ** comp; +comp **= comp ** comp ** 2; +comp **= comp ** comp + 2; +comp **= comp ** comp - 2; +comp **= comp ** comp * 2; +comp **= comp ** comp / 2; +comp **= comp ** comp % 2; +comp **= (comp - 2) ** 5; +comp **= (comp + 2) ** 5; +comp **= (comp * 2) ** 5; +comp **= (comp / 2) ** 5; +comp **= (comp % 2) ** 5; +comp **= comp ** (5 + 2); +comp **= comp ** (5 - 2); +comp **= comp ** (5 * 2); +comp **= comp ** (5 / 2); +comp **= comp ** (5 % 2); \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts new file mode 100644 index 0000000000000..9f8fa8f4d9458 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts @@ -0,0 +1,32 @@ +// @target: es5 + +1 ** 2; +1 ** 2 ** 3; +1 ** -2 ** 3; +1 ** -2 ** -3; +-1 ** -2 ** -3; +-(1 ** 2) ** 3; +1 ** -(2 ** 3); + +1 ** 2 + 3; +1 ** 2 - 3; +1 ** 2 * 3; +1 ** 2 / 3; +1 ** 2 % 3; + +1 ** -2 + 3; +1 ** -2 - 3; +1 ** -2 * 3; +1 ** -2 / 3; +1 ** -2 % 3; + +2 + 3 ** 3; +2 - 3 ** 3; +2 * 3 ** 3; +2 / 3 ** 3; +2 % 3 ** 3; + +(2 + 3) ** 4; +(2 - 3) ** 4; +(2 * 3) ** 4; +(2 / 3) ** 4; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts new file mode 100644 index 0000000000000..a8d1241dc8a02 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts @@ -0,0 +1,32 @@ +// @target:es5 + +var temp = 10; + +++temp ** 3; +--temp ** 3; +3 ** ++temp; +3 ** --temp; + +--temp + 2 ** 3; +--temp - 2 ** 3; +--temp * 2 ** 3; +--temp / 2 ** 3; +--temp % 2 ** 3; + +++temp + 2 ** 3; +++temp - 2 ** 3; +++temp * 2 ** 3; +++temp / 2 ** 3; +++temp % 2 ** 3; + +3 ** ++temp + 2; +3 ** ++temp - 2; +3 ** ++temp * 2; +3 ** ++temp / 2; +3 ** ++temp % 2; + +3 ** --temp + 2; +3 ** --temp - 2; +3 ** --temp * 2; +3 ** --temp / 2; +3 ** --temp % 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts new file mode 100644 index 0000000000000..2b2f942c5258e --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts @@ -0,0 +1,10 @@ +var t1 = 10; +var t2 = 10; +console.log(`${t1 ** t2}`) +console.log(`${t1 ** t2 ** t1}`) +console.log(`${t1 + t2 ** t1}`) +console.log(`${t1 - t2 ** t1}`) +console.log(`${t1 ** t2 + t1}`) +console.log(`${t1 ** t2 - t1}`) +console.log(`${t1 + t2 ** t2 + t1}`) +console.log(`${t1 - t2 ** t2 - t1}`) \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithAnyAndNumber.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithAnyAndNumber.ts new file mode 100644 index 0000000000000..c565221106471 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithAnyAndNumber.ts @@ -0,0 +1,12 @@ +var a: any; +var b: number; + +// operator ** +var r1 = a ** a; +var r2 = a ** b; +var r3 = a ** 0; +var r4 = 0 ** a; +var r5 = 0 ** 0; +var r6 = b ** 0; +var r7 = 0 ** b; +var r8 = b ** b; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnum.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnum.ts new file mode 100644 index 0000000000000..dee953c6abb68 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnum.ts @@ -0,0 +1,24 @@ +// operands of an enum type are treated as having the primitive type Number. + +enum E { + a, + b +} + +var a: any; +var b: number; +var c: E; + +// operator ** +var r1 = c ** a; +var r2 = c ** b; +var r3 = c ** c; +var r4 = a ** c; +var r5 = b ** c; +var r6 = E.a ** a; +var r7 = E.a ** b; +var r8 = E.a ** E.b; +var r9 = E.a ** 1; +var r10 = a ** E.b; +var r11 = b ** E.b; +var r12 = 1 ** E.b; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnumUnion.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnumUnion.ts new file mode 100644 index 0000000000000..2528027f4cb6c --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnumUnion.ts @@ -0,0 +1,28 @@ +// operands of an enum type are treated as having the primitive type Number. + +enum E { + a, + b +} +enum F { + c, + d +} + +var a: any; +var b: number; +var c: E | F; + +// operator ** +var r1 = c ** a; +var r2 = c ** b; +var r3 = c ** c; +var r4 = a ** c; +var r5 = b ** c; +var r6 = E.a ** a; +var r7 = E.a ** b; +var r8 = E.a ** E.b; +var r9 = E.a ** 1; +var r10 = a ** E.b; +var r11 = b ** E.b; +var r12 = 1 ** E.b; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts new file mode 100644 index 0000000000000..f16ddc61ed5e6 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts @@ -0,0 +1,68 @@ +// these operators require their operands to be of type Any, the Number primitive type, or +// an enum type +enum E { a, b, c } + +var a: any; +var b: boolean; +var c: number; +var d: string; +var e: { a: number }; +var f: Number; + +// All of the below should be an error unless otherwise noted +// operator ** +var r1a1 = a ** a; //ok +var r1a2 = a ** b; +var r1a3 = a ** c; //ok +var r1a4 = a ** d; +var r1a5 = a ** e; +var r1a6 = a ** f; + +var r1b1 = b ** a; +var r1b2 = b ** b; +var r1b3 = b ** c; +var r1b4 = b ** d; +var r1b5 = b ** e; +var r1b6 = b ** f; + +var r1c1 = c ** a; //ok +var r1c2 = c ** b; +var r1c3 = c ** c; //ok +var r1c4 = c ** d; +var r1c5 = c ** e; +var r1c6 = c ** f; + +var r1d1 = d ** a; +var r1d2 = d ** b; +var r1d3 = d ** c; +var r1d4 = d ** d; +var r1d5 = d ** e; +var r1d6 = d ** f; + +var r1e1 = e ** a; +var r1e2 = e ** b; +var r1e3 = e ** c; +var r1e4 = e ** d; +var r1e5 = e ** e; +var r1e6 = e ** f; + +var r1f1 = f ** a; +var r1f2 = f ** b; +var r1f3 = f ** c; +var r1f4 = f ** d; +var r1f5 = f ** e; +var r1f6 = f ** f; + +var r1g1 = E.a ** a; //ok +var r1g2 = E.a ** b; +var r1g3 = E.a ** c; //ok +var r1g4 = E.a ** d; +var r1g5 = E.a ** e; +var r1g6 = E.a ** f; + +var r1h1 = a ** E.b; //ok +var r1h2 = b ** E.b; +var r1h3 = c ** E.b; //ok +var r1h4 = d ** E.b; +var r1h5 = e ** E.b; +var r1h6 = f ** E.b \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts new file mode 100644 index 0000000000000..7ecec740d416b --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts @@ -0,0 +1,23 @@ +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +var a: boolean; +var b: string; +var c: Object; + +// operator ** +var r1a1 = null ** a; +var r1a2 = null ** b; +var r1a3 = null ** c; + +var r1b1 = a ** null; +var r1b2 = b ** null; +var r1b3 = c ** null; + +var r1c1 = null ** true; +var r1c2 = null ** ''; +var r1c3 = null ** {}; + +var r1d1 = true ** null; +var r1d2 = '' ** null; +var r1d3 = {} ** null; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndValidOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndValidOperands.ts new file mode 100644 index 0000000000000..acc152ea696d4 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndValidOperands.ts @@ -0,0 +1,20 @@ +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { + a, + b +} + +var a: any; +var b: number; + +// operator ** +var r1 = null ** a; +var r2 = null ** b; +var r3 = null ** 1; +var r4 = null ** E.a; +var r5 = a ** null; +var r6 = b ** null; +var r7 = 0 ** null; +var r8 = E.b ** null; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts new file mode 100644 index 0000000000000..82133ed3914f1 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts @@ -0,0 +1,5 @@ +// operator ** +var r1 = null ** null; +var r2 = null ** undefined; +var r3 = undefined ** null; +var r4 = undefined ** undefined; diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts new file mode 100644 index 0000000000000..d028b5c65750e --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts @@ -0,0 +1,20 @@ +// type parameter type is not valid for arithmetic operand +function foo(t: T) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: {}; + + var r1a1 = a ** t; + var r2a1 = t ** a; + var r1b1 = b ** t; + var r2b1 = t ** b; + var r1c1 = c ** t; + var r2c1 = t ** c; + var r1d1 = d ** t; + var r2d1 = t ** d; + var r1e1 = e ** t; + var r2e1 = t ** d; + var r1f1 = t ** t; +} \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts new file mode 100644 index 0000000000000..7693e4a83f9ae --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts @@ -0,0 +1,23 @@ +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +var a: boolean; +var b: string; +var c: Object; + +// operator ** +var r1a1 = undefined ** a; +var r1a2 = undefined ** b; +var r1a3 = undefined ** c; + +var r1b1 = a ** undefined; +var r1b2 = b ** undefined; +var r1b3 = c ** undefined; + +var r1c1 = undefined ** true; +var r1c2 = undefined ** ''; +var r1c3 = undefined ** {}; + +var r1d1 = true ** undefined; +var r1d2 = '' ** undefined; +var r1d3 = {} ** undefined; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts new file mode 100644 index 0000000000000..fd391d198b178 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts @@ -0,0 +1,120 @@ +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { + a, + b +} + +var a: any; +var b: number; + +// operator * +var ra1 = undefined * a; +var ra2 = undefined * b; +var ra3 = undefined * 1; +var ra4 = undefined * E.a; +var ra5 = a * undefined; +var ra6 = b * undefined; +var ra7 = 0 * undefined; +var ra8 = E.b * undefined; + +// operator / +var rb1 = undefined / a; +var rb2 = undefined / b; +var rb3 = undefined / 1; +var rb4 = undefined / E.a; +var rb5 = a / undefined; +var rb6 = b / undefined; +var rb7 = 0 / undefined; +var rb8 = E.b / undefined; + +// operator % +var rc1 = undefined % a; +var rc2 = undefined % b; +var rc3 = undefined % 1; +var rc4 = undefined % E.a; +var rc5 = a % undefined; +var rc6 = b % undefined; +var rc7 = 0 % undefined; +var rc8 = E.b % undefined; + +// operator - +var rd1 = undefined - a; +var rd2 = undefined - b; +var rd3 = undefined - 1; +var rd4 = undefined - E.a; +var rd5 = a - undefined; +var rd6 = b - undefined; +var rd7 = 0 - undefined; +var rd8 = E.b - undefined; + +// operator << +var re1 = undefined << a; +var re2 = undefined << b; +var re3 = undefined << 1; +var re4 = undefined << E.a; +var re5 = a << undefined; +var re6 = b << undefined; +var re7 = 0 << undefined; +var re8 = E.b << undefined; + +// operator >> +var rf1 = undefined >> a; +var rf2 = undefined >> b; +var rf3 = undefined >> 1; +var rf4 = undefined >> E.a; +var rf5 = a >> undefined; +var rf6 = b >> undefined; +var rf7 = 0 >> undefined; +var rf8 = E.b >> undefined; + +// operator >>> +var rg1 = undefined >>> a; +var rg2 = undefined >>> b; +var rg3 = undefined >>> 1; +var rg4 = undefined >>> E.a; +var rg5 = a >>> undefined; +var rg6 = b >>> undefined; +var rg7 = 0 >>> undefined; +var rg8 = E.b >>> undefined; + +// operator & +var rh1 = undefined & a; +var rh2 = undefined & b; +var rh3 = undefined & 1; +var rh4 = undefined & E.a; +var rh5 = a & undefined; +var rh6 = b & undefined; +var rh7 = 0 & undefined; +var rh8 = E.b & undefined; + +// operator ^ +var ri1 = undefined ^ a; +var ri2 = undefined ^ b; +var ri3 = undefined ^ 1; +var ri4 = undefined ^ E.a; +var ri5 = a ^ undefined; +var ri6 = b ^ undefined; +var ri7 = 0 ^ undefined; +var ri8 = E.b ^ undefined; + +// operator | +var rj1 = undefined | a; +var rj2 = undefined | b; +var rj3 = undefined | 1; +var rj4 = undefined | E.a; +var rj5 = a | undefined; +var rj6 = b | undefined; +var rj7 = 0 | undefined; +var rj8 = E.b | undefined; + +// operator * +var rk1 = undefined ** a; +var rk2 = undefined ** b; +var rk3 = undefined ** 1; +var rk4 = undefined ** E.a; +var rk5 = a ** undefined; +var rk6 = b ** undefined; +var rk7 = 0 ** undefined; +var rk8 = E.b ** undefined; \ No newline at end of file From 76ef7b40dee3e0d9897777e90f6e1e354123b51f Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 18 Sep 2015 18:31:52 -0700 Subject: [PATCH 02/39] Initial operator. Need to fix the grammar for unaryExpression --- src/compiler/checker.ts | 6 ++++-- src/compiler/emitter.ts | 23 +++++++++++++++++------ src/compiler/parser.ts | 8 +++++++- src/compiler/scanner.ts | 8 ++++++++ src/compiler/types.ts | 17 +++++++++++------ 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 80a04129eedc4..837113fd37587 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9842,7 +9842,9 @@ namespace ts { let rightType = checkExpression(node.right, contextualMapper); switch (operator) { case SyntaxKind.AsteriskToken: + case SyntaxKind.AsteriskAsteriskToken: case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.AsteriskAsteriskEqualsToken: case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: case SyntaxKind.PercentToken: @@ -9861,7 +9863,7 @@ namespace ts { case SyntaxKind.CaretEqualsToken: case SyntaxKind.AmpersandToken: case SyntaxKind.AmpersandEqualsToken: - // TypeScript 1.0 spec (April 2014): 4.15.1 + // TypeScript 1.0 spec (April 2014): 4.19.1 // These operators require their operands to be of type Any, the Number primitive type, // or an enum type. Operands of an enum type are treated // as having the primitive type Number. If one operand is the null or undefined value, @@ -9890,7 +9892,7 @@ namespace ts { return numberType; case SyntaxKind.PlusToken: case SyntaxKind.PlusEqualsToken: - // TypeScript 1.0 spec (April 2014): 4.15.2 + // TypeScript 1.0 spec (April 2014): 4.19.2 // The binary + operator requires both operands to be of the Number primitive type or an enum type, // or at least one of the operands to be of type Any or the String primitive type. diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 44e5a45b0571f..6ddf868efe13a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2522,12 +2522,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitNodeWithoutSourceMap(node.left); write(`", `); } - emit(node.left); - let indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== SyntaxKind.CommaToken ? " " : undefined); - write(tokenToString(node.operatorToken.kind)); - let indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); - emit(node.right); - decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + + if (languageVersion < ScriptTarget.ES7 && node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken) { + write("Math.pow("); + emit(node.left); + write(", "); + emit(node.right); + write(")"); + } + else { + emit(node.left); + let indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== SyntaxKind.CommaToken ? " " : undefined); + write(tokenToString(node.operatorToken.kind)); + let indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); + emit(node.right); + decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + } + if (exportChanged) { write(")"); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 330ad05518bb1..7673f147e8fd3 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3015,7 +3015,11 @@ namespace ts { let newPrecedence = getBinaryOperatorPrecedence(); // Check the precedence to see if we should "take" this operator - if (newPrecedence <= precedence) { + if (token === SyntaxKind.AsteriskAsteriskToken && newPrecedence < precedence) { + // ** operator is right-assocative + break; + } + else if (token !== SyntaxKind.AsteriskAsteriskToken && newPrecedence <= precedence) { break; } @@ -3089,6 +3093,8 @@ namespace ts { case SyntaxKind.SlashToken: case SyntaxKind.PercentToken: return 10; + case SyntaxKind.AsteriskAsteriskToken: + return 11; } // -1 is lower than all other precedences. Returning it will cause binary expression diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 82fbc8c2a591c..91a2783d5d46e 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -136,6 +136,7 @@ namespace ts { "=>": SyntaxKind.EqualsGreaterThanToken, "+": SyntaxKind.PlusToken, "-": SyntaxKind.MinusToken, + "**": SyntaxKind.AsteriskAsteriskToken, "*": SyntaxKind.AsteriskToken, "/": SyntaxKind.SlashToken, "%": SyntaxKind.PercentToken, @@ -158,6 +159,7 @@ namespace ts { "+=": SyntaxKind.PlusEqualsToken, "-=": SyntaxKind.MinusEqualsToken, "*=": SyntaxKind.AsteriskEqualsToken, + "**=": SyntaxKind.AsteriskAsteriskEqualsToken, "/=": SyntaxKind.SlashEqualsToken, "%=": SyntaxKind.PercentEqualsToken, "<<=": SyntaxKind.LessThanLessThanEqualsToken, @@ -1212,6 +1214,12 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.AsteriskEqualsToken; } + if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) { + if (text.charCodeAt(pos + 2) === CharacterCodes.equals) { + return pos += 3, token = SyntaxKind.AsteriskAsteriskEqualsToken; + } + return pos += 2, token = SyntaxKind.AsteriskAsteriskToken; + } return pos++, token = SyntaxKind.AsteriskToken; case CharacterCodes.plus: if (text.charCodeAt(pos + 1) === CharacterCodes.plus) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d2757bb7937ca..657e1f507c172 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -64,6 +64,7 @@ namespace ts { PlusToken, MinusToken, AsteriskToken, + AsteriskAsteriskToken, SlashToken, PercentToken, PlusPlusToken, @@ -86,6 +87,7 @@ namespace ts { PlusEqualsToken, MinusEqualsToken, AsteriskEqualsToken, + AsteriskAsteriskEqualsToken, SlashEqualsToken, PercentEqualsToken, LessThanLessThanEqualsToken, @@ -702,13 +704,15 @@ namespace ts { contextualType?: Type; // Used to temporarily assign a contextual type during overload resolution } + export type UnaryOrBinaryExpression = UnaryExpression | BinaryExpression; + export interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } export interface PrefixUnaryExpression extends UnaryExpression { operator: SyntaxKind; - operand: UnaryExpression; + operand: UnaryOrBinaryExpression; } export interface PostfixUnaryExpression extends PostfixExpression { @@ -733,19 +737,19 @@ namespace ts { } export interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; + expression: UnaryOrBinaryExpression; } export interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; + expression: UnaryOrBinaryExpression; } export interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; + expression: UnaryOrBinaryExpression; } export interface AwaitExpression extends UnaryExpression { - expression: UnaryExpression; + expression: UnaryOrBinaryExpression; } export interface YieldExpression extends Expression { @@ -852,7 +856,7 @@ namespace ts { export interface TypeAssertion extends UnaryExpression { type: TypeNode; - expression: UnaryExpression; + expression: UnaryOrBinaryExpression; } export type AssertionExpression = TypeAssertion | AsExpression; @@ -2101,6 +2105,7 @@ namespace ts { ES3 = 0, ES5 = 1, ES6 = 2, + ES7 = 3, Latest = ES6, } From 21d03690c03ae451a585a67377b1de72a5e4d5d0 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 18 Sep 2015 18:38:59 -0700 Subject: [PATCH 03/39] Basic parsing for the UnaryExpression: IncrementExpression[?Yield]**UnaryExpression[?Yield] --- src/compiler/parser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 7673f147e8fd3..f1d92de630847 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3121,7 +3121,13 @@ namespace ts { let node = createNode(SyntaxKind.PrefixUnaryExpression); node.operator = token; nextToken(); - node.operand = parseUnaryExpressionOrHigher(); + let tryParseUnaryExpression = parseUnaryExpressionOrHigher(); + if (token === SyntaxKind.AsteriskAsteriskToken) { + node.operand = parseBinaryExpressionRest(getBinaryOperatorPrecedence(), tryParseUnaryExpression); + } + else { + node.operand = tryParseUnaryExpression; + } return finishNode(node); } From 1140eb81777ee3d07a43b29a5c12aa50cd138c5a Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 21 Sep 2015 15:43:33 -0700 Subject: [PATCH 04/39] Parse ES7 UnaryExpression and IncrementExpression --- src/compiler/parser.ts | 76 ++++++++++++++++++++++++++++++------------ src/compiler/types.ts | 2 ++ 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f1d92de630847..236a07d224840 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3121,13 +3121,8 @@ namespace ts { let node = createNode(SyntaxKind.PrefixUnaryExpression); node.operator = token; nextToken(); - let tryParseUnaryExpression = parseUnaryExpressionOrHigher(); - if (token === SyntaxKind.AsteriskAsteriskToken) { - node.operand = parseBinaryExpressionRest(getBinaryOperatorPrecedence(), tryParseUnaryExpression); - } - else { - node.operand = tryParseUnaryExpression; - } + node.operand = parseUnaryExpressionOrHigher(); + return finishNode(node); } @@ -3172,7 +3167,21 @@ namespace ts { return finishNode(node); } - function parseUnaryExpressionOrHigher(): UnaryExpression { + /** + * Parse UnaryExpression or higher: + * In ES7 grammar, + * UnaryExpression: + * 1) IncrementExpression[?yield] + * 2) delete UnaryExpression[?yield] + * 3) void UnaryExpression[?yield] + * 4) typeof UnaryExpression[?yield] + * 5) + UnaryExpression[?yield] + * 6) - UnaryExpression[?yield] + * 7) ~ UnaryExpression[?yield] + * 8) ! UnaryExpression[?yield] + * 9) IncrementExpression[?yield] ** UnaryExpression[?yield] + */ + function parseUnaryExpressionOrHigher(): UnaryExpression | BinaryExpression { if (isAwaitExpression()) { return parseAwaitExpression(); } @@ -3182,8 +3191,6 @@ namespace ts { case SyntaxKind.MinusToken: case SyntaxKind.TildeToken: case SyntaxKind.ExclamationToken: - case SyntaxKind.PlusPlusToken: - case SyntaxKind.MinusMinusToken: return parsePrefixUnaryExpression(); case SyntaxKind.DeleteKeyword: return parseDeleteExpression(); @@ -3193,6 +3200,9 @@ namespace ts { return parseVoidExpression(); case SyntaxKind.LessThanToken: if (sourceFile.languageVariant !== LanguageVariant.JSX) { + // This is modified UnaryExpression grammar in TypeScript + // UnaryExpression (modified): + // < type > UnaryExpression return parseTypeAssertion(); } if (lookAhead(nextTokenIsIdentifierOrKeyword)) { @@ -3200,23 +3210,45 @@ namespace ts { } // Fall through default: - return parsePostfixExpressionOrHigher(); - } - } - - function parsePostfixExpressionOrHigher(): PostfixExpression { - let expression = parseLeftHandSideExpressionOrHigher(); - - Debug.assert(isLeftHandSideExpression(expression)); - if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { - let node = createNode(SyntaxKind.PostfixUnaryExpression, expression.pos); - node.operand = expression; + let tryParseUnaryExpression = parseIncrementExpression(); + return token === SyntaxKind.AsteriskAsteriskToken ? + parseBinaryExpressionRest(getBinaryOperatorPrecedence(), tryParseUnaryExpression) : + tryParseUnaryExpression; + } + } + + /** + * Parse ES7 IncrementExpression. The IncrementExpression is used instead of ES6's PostFixExpression. + * + * IncrementExpression[yield]: + * 1) LeftHandSideExpression[?yield] + * 2) LeftHandSideExpression[?yield] [[no LineTerminator here]]++ + * 3) LeftHandSideExpression[?yield] [[no LineTerminator here]]-- + * 4) ++LeftHandSideExpression[?yield] + * 5) --LeftHandSideExpression[?yield] + */ + function parseIncrementExpression(): IncrementExpression { + if (token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) { + let node = createNode(SyntaxKind.PrefixUnaryExpression); node.operator = token; nextToken(); + node.operand = parseLeftHandSideExpressionOrHigher(); return finishNode(node); } + else { + let expression = parseLeftHandSideExpressionOrHigher(); + + Debug.assert(isLeftHandSideExpression(expression)); + if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { + let node = createNode(SyntaxKind.PostfixUnaryExpression, expression.pos); + node.operand = expression; + node.operator = token; + nextToken(); + return finishNode(node); + } - return expression; + return expression; + } } function parseLeftHandSideExpressionOrHigher(): LeftHandSideExpression { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 657e1f507c172..b8002903586ae 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -710,6 +710,8 @@ namespace ts { _unaryExpressionBrand: any; } + export interface IncrementExpression extends UnaryExpression { } + export interface PrefixUnaryExpression extends UnaryExpression { operator: SyntaxKind; operand: UnaryOrBinaryExpression; From 072089f0ecd63836a3d66f1dd63f399f9c0da85e Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 21 Sep 2015 15:43:49 -0700 Subject: [PATCH 05/39] Downlevel emit for **= --- src/compiler/emitter.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6ddf868efe13a..541488bd82bc1 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2523,7 +2523,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`", `); } - if (languageVersion < ScriptTarget.ES7 && node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken) { + if (languageVersion < ScriptTarget.ES7 && + (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken || node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken)) { + if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { + emit(node.left); + write(" = "); + } write("Math.pow("); emit(node.left); write(", "); From 31b873640873e438178101c3c5a55166c84bf872 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 21 Sep 2015 15:44:59 -0700 Subject: [PATCH 06/39] Update existed baselines that are affected by ES7 UnaryExpression --- tests/baselines/reference/APISample_linter.js | 20 +-- ...thAnyOtherTypeInvalidOperations.errors.txt | 56 ++++--- ...eratorWithAnyOtherTypeInvalidOperations.js | 18 ++- .../incrementAndDecrement.errors.txt | 146 ++++++++++++------ .../reference/incrementAndDecrement.js | 48 ++++-- ...thAnyOtherTypeInvalidOperations.errors.txt | 29 ++-- ...eratorWithAnyOtherTypeInvalidOperations.js | 9 +- ...ularExpressionMixedWithComments.errors.txt | 8 +- ...parseRegularExpressionMixedWithComments.js | 4 +- .../reference/parserS7.9_A5.7_T1.errors.txt | 5 +- .../baselines/reference/parserS7.9_A5.7_T1.js | 3 +- .../parserUnaryExpression5.errors.txt | 6 +- .../reference/parserUnaryExpression5.js | 3 +- .../emitCompoundExponentiationOperator1.ts | 4 +- .../emitExponentiationOperator2.ts | 49 +++++- ...ratorWithUndefinedValueAndValidOperands.ts | 100 ------------ 16 files changed, 274 insertions(+), 234 deletions(-) diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index 4a467a60a8451..aeff3a327f557 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -75,26 +75,26 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 197 /* ForStatement */: - case 198 /* ForInStatement */: - case 196 /* WhileStatement */: - case 195 /* DoStatement */: - if (node.statement.kind !== 190 /* Block */) { + case 199 /* ForStatement */: + case 200 /* ForInStatement */: + case 198 /* WhileStatement */: + case 197 /* DoStatement */: + if (node.statement.kind !== 192 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 194 /* IfStatement */: + case 196 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 190 /* Block */) { + if (ifStatement.thenStatement.kind !== 192 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== 190 /* Block */ && - ifStatement.elseStatement.kind !== 194 /* IfStatement */) { + ifStatement.elseStatement.kind !== 192 /* Block */ && + ifStatement.elseStatement.kind !== 196 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 179 /* BinaryExpression */: + case 181 /* BinaryExpression */: var op = node.operatorToken.kind; if (op === 30 /* EqualsEqualsToken */ || op == 31 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 31213ce2fd473..46e5515633a09 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -36,15 +36,21 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(60,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(63,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(65,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(70,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(71,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,7): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,9): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,7): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,9): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,7): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,9): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(70,10): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(70,12): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(71,10): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(71,12): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,10): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,12): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts (44 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts (50 errors) ==== // -- operator on any type var ANY1; var ANY2: any[] = ["", ""]; @@ -188,20 +194,32 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --ANY1--; - ~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --ANY1++; - ~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++ANY1--; - ~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --ANY2[0]--; - ~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --ANY2[0]++; - ~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++ANY2[0]--; - ~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js index 5b717d0669c69..f8021a713c4d6 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -131,9 +131,15 @@ var ResultIsNumber30 = obj1.y--; // miss assignment operators --ANY2; ANY2--; ---ANY1--; ---ANY1++; -++ANY1--; ---ANY2[0]--; ---ANY2[0]++; -++ANY2[0]--; +--ANY1; +--; +--ANY1; +++; +++ANY1; +--; +--ANY2[0]; +--; +--ANY2[0]; +++; +++ANY2[0]; +--; diff --git a/tests/baselines/reference/incrementAndDecrement.errors.txt b/tests/baselines/reference/incrementAndDecrement.errors.txt index 7cbf8cbc0fe25..d41764176a45f 100644 --- a/tests/baselines/reference/incrementAndDecrement.errors.txt +++ b/tests/baselines/reference/incrementAndDecrement.errors.txt @@ -3,25 +3,41 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(8,5): err tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(11,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(14,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(17,5): error TS1005: ';' expected. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(24,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(25,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(26,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(27,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(34,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(35,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(36,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(37,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(44,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(45,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(46,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(47,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(24,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(24,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(25,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(25,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(26,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(26,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(27,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(27,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(34,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(34,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(35,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(35,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(36,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(36,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(37,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(37,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(44,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(44,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(45,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(45,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(46,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(46,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(47,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(47,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,4): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,6): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/operators/incrementAndDecrement.ts (21 errors) ==== +==== tests/cases/conformance/expressions/operators/incrementAndDecrement.ts (37 errors) ==== enum E { A, B, C }; var x = 4; var e = E.B; @@ -56,17 +72,25 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): er ++x; --x; ++x++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --x--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++x--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --x++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. // Pre and postfix++ on enum e++; @@ -74,17 +98,25 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): er ++e; --e; ++e++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --e--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++e--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --e++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. // Pre and postfix++ on value of type 'any' a++; @@ -92,17 +124,25 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): er ++a; --a; ++a++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --a--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++a--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --a++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. // Pre and postfix++ on other types @@ -111,17 +151,25 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): er ++w; // Error --w; // Error ++w++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --w--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++w--; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. --w++; // Error - ~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/incrementAndDecrement.js b/tests/baselines/reference/incrementAndDecrement.js index 09c0b3ae490bf..49324498c9a04 100644 --- a/tests/baselines/reference/incrementAndDecrement.js +++ b/tests/baselines/reference/incrementAndDecrement.js @@ -90,34 +90,50 @@ x++; x--; ++x; --x; -++x++; // Error ---x--; // Error -++x--; // Error ---x++; // Error +++x; +++; // Error +--x; +--; // Error +++x; +--; // Error +--x; +++; // Error // Pre and postfix++ on enum e++; e--; ++e; --e; -++e++; // Error ---e--; // Error -++e--; // Error ---e++; // Error +++e; +++; // Error +--e; +--; // Error +++e; +--; // Error +--e; +++; // Error // Pre and postfix++ on value of type 'any' a++; a--; ++a; --a; -++a++; // Error ---a--; // Error -++a--; // Error ---a++; // Error +++a; +++; // Error +--a; +--; // Error +++a; +--; // Error +--a; +++; // Error // Pre and postfix++ on other types w++; // Error w--; // Error ++w; // Error --w; // Error -++w++; // Error ---w--; // Error -++w--; // Error ---w++; // Error +++w; +++; // Error +--w; +--; // Error +++w; +--; // Error +--w; +++; // Error diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index ab30196402688..92e639df21e39 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -36,13 +36,16 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(60,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(63,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(65,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,7): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,9): error TS1109: Expression expected. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,7): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,9): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,10): error TS1005: ';' expected. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,12): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts (42 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts (45 errors) ==== // ++ operator on any type var ANY1; var ANY2: any[] = [1, 2]; @@ -186,13 +189,19 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++ANY1++; - ~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++ANY2++; ~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. - ~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ++ANY2[0]++; - ~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file + ~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js index 259dcac404e8c..73ec64dfc55d8 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -128,6 +128,9 @@ var ResultIsNumber30 = obj1.y++; // miss assignment operators ++ANY2; ANY2++; -++ANY1++; -++ANY2++; -++ANY2[0]++; +++ANY1; +++; +++ANY2; +++; +++ANY2[0]; +++; diff --git a/tests/baselines/reference/parseRegularExpressionMixedWithComments.errors.txt b/tests/baselines/reference/parseRegularExpressionMixedWithComments.errors.txt index a6d63ce175463..b4e08a6af46e1 100644 --- a/tests/baselines/reference/parseRegularExpressionMixedWithComments.errors.txt +++ b/tests/baselines/reference/parseRegularExpressionMixedWithComments.errors.txt @@ -1,12 +1,10 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,18): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,22): error TS1109: Expression expected. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(5,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,18): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,26): error TS1109: Expression expected. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts(6,27): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts (6 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpressionMixedWithComments.ts (4 errors) ==== var regex1 = / asdf /; var regex2 = /**// asdf /; var regex3 = /**///**/ asdf / // should be a comment line @@ -14,14 +12,10 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parseRegularExpres var regex4 = /**// /**/asdf /; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! error TS1109: Expression expected. ~~~~~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var regex5 = /**// asdf/**/ /; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! error TS1109: Expression expected. ~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/parseRegularExpressionMixedWithComments.js b/tests/baselines/reference/parseRegularExpressionMixedWithComments.js index c7aded33697ec..78752a77f75c5 100644 --- a/tests/baselines/reference/parseRegularExpressionMixedWithComments.js +++ b/tests/baselines/reference/parseRegularExpressionMixedWithComments.js @@ -10,5 +10,5 @@ var regex5 = /**// asdf/**/ /; var regex1 = / asdf /; var regex2 = / asdf /; var regex3 = 1; -var regex4 = / / * * /asdf /; -var regex5 = / asdf/ * * / /; +var regex4 = Math.pow(/ /, /asdf /); +var regex5 = Math.pow(/ asdf/, / /); diff --git a/tests/baselines/reference/parserS7.9_A5.7_T1.errors.txt b/tests/baselines/reference/parserS7.9_A5.7_T1.errors.txt index ed5f1738c5034..63bb9f06ecdc6 100644 --- a/tests/baselines/reference/parserS7.9_A5.7_T1.errors.txt +++ b/tests/baselines/reference/parserS7.9_A5.7_T1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/parserS7.9_A5.7_T1.ts(17,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/parser/ecmascript5/parserS7.9_A5.7_T1.ts(17,1): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/parserS7.9_A5.7_T1.ts (1 errors) ==== @@ -20,8 +20,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.9_A5.7_T1.ts(17,1): error TS ++ ++ ~~ +!!! error TS1109: Expression expected. y - ~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.9_A5.7_T1.js b/tests/baselines/reference/parserS7.9_A5.7_T1.js index ae5896c28e5ec..575d62caf1998 100644 --- a/tests/baselines/reference/parserS7.9_A5.7_T1.js +++ b/tests/baselines/reference/parserS7.9_A5.7_T1.js @@ -33,4 +33,5 @@ y */ var x = 0, y = 0; var z = x; -++++y; +++; +++y; diff --git a/tests/baselines/reference/parserUnaryExpression5.errors.txt b/tests/baselines/reference/parserUnaryExpression5.errors.txt index b5d98b8cef43b..0daa8d154c3ad 100644 --- a/tests/baselines/reference/parserUnaryExpression5.errors.txt +++ b/tests/baselines/reference/parserUnaryExpression5.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression5.ts(1,4): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression5.ts(1,4): error TS1109: Expression expected. tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression5.ts(1,11): error TS2304: Cannot find name 'foo'. ==== tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression5.ts (2 errors) ==== ++ delete foo.bar - ~~~~~~~~~~~~~~ -!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~~~~ +!!! error TS1109: Expression expected. ~~~ !!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserUnaryExpression5.js b/tests/baselines/reference/parserUnaryExpression5.js index 9495ee15b8821..c1bbbd0081864 100644 --- a/tests/baselines/reference/parserUnaryExpression5.js +++ b/tests/baselines/reference/parserUnaryExpression5.js @@ -2,4 +2,5 @@ ++ delete foo.bar //// [parserUnaryExpression5.js] -++delete foo.bar; +++; +delete foo.bar; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts index 40647d37bf7ea..53bbd8e10a70e 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts @@ -1,4 +1,6 @@ -var comp: number; +// @target:es5 + +var comp: number; comp **= 1; comp **= comp ** comp; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts index a8d1241dc8a02..317688bf913b8 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts @@ -4,8 +4,26 @@ var temp = 10; ++temp ** 3; --temp ** 3; -3 ** ++temp; -3 ** --temp; +temp++ ** 3; +temp-- ** 3; +--temp + temp ** 3; +--temp - temp ** 3; +--temp * temp ** 3; +--temp / temp ** 3; +--temp % temp ** 3; +-++temp ** 3; ++--temp ** 3; + +temp-- ** 3; +temp++ ** 3; +-temp++ ** 3; ++temp-- ** 3; + +temp-- + temp ** 3; +temp-- - temp ** 3; +temp-- * temp ** 3; +temp-- / temp ** 3; +temp-- % temp ** 3; --temp + 2 ** 3; --temp - 2 ** 3; @@ -17,7 +35,32 @@ var temp = 10; ++temp - 2 ** 3; ++temp * 2 ** 3; ++temp / 2 ** 3; -++temp % 2 ** 3; + +3 ** ++temp; +3 ** --temp; +3 ** temp++; +3 ** temp--; +-3 ** temp++; +-3 ** temp--; +-3 ** ++temp; +-3 ** --temp; ++3 ** temp++; ++3 ** temp--; ++3 ** ++temp; ++3 ** --temp + +3 ** ++temp ** 2; +3 ** --temp ** 2; +3 ** temp++ ** 2; +3 ** temp-- ** 2; +-3 ** temp++ ** 2; +-3 ** temp-- ** 2; +-3 ** ++temp ** 2; +-3 ** --temp ** 2; ++3 ** temp++ ** 2; ++3 ** temp-- ** 2; ++3 ** ++temp ** 2; ++3 ** --temp ** 2; 3 ** ++temp + 2; 3 ** ++temp - 2; diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts index fd391d198b178..c1862f1bbe918 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts @@ -9,106 +9,6 @@ enum E { var a: any; var b: number; -// operator * -var ra1 = undefined * a; -var ra2 = undefined * b; -var ra3 = undefined * 1; -var ra4 = undefined * E.a; -var ra5 = a * undefined; -var ra6 = b * undefined; -var ra7 = 0 * undefined; -var ra8 = E.b * undefined; - -// operator / -var rb1 = undefined / a; -var rb2 = undefined / b; -var rb3 = undefined / 1; -var rb4 = undefined / E.a; -var rb5 = a / undefined; -var rb6 = b / undefined; -var rb7 = 0 / undefined; -var rb8 = E.b / undefined; - -// operator % -var rc1 = undefined % a; -var rc2 = undefined % b; -var rc3 = undefined % 1; -var rc4 = undefined % E.a; -var rc5 = a % undefined; -var rc6 = b % undefined; -var rc7 = 0 % undefined; -var rc8 = E.b % undefined; - -// operator - -var rd1 = undefined - a; -var rd2 = undefined - b; -var rd3 = undefined - 1; -var rd4 = undefined - E.a; -var rd5 = a - undefined; -var rd6 = b - undefined; -var rd7 = 0 - undefined; -var rd8 = E.b - undefined; - -// operator << -var re1 = undefined << a; -var re2 = undefined << b; -var re3 = undefined << 1; -var re4 = undefined << E.a; -var re5 = a << undefined; -var re6 = b << undefined; -var re7 = 0 << undefined; -var re8 = E.b << undefined; - -// operator >> -var rf1 = undefined >> a; -var rf2 = undefined >> b; -var rf3 = undefined >> 1; -var rf4 = undefined >> E.a; -var rf5 = a >> undefined; -var rf6 = b >> undefined; -var rf7 = 0 >> undefined; -var rf8 = E.b >> undefined; - -// operator >>> -var rg1 = undefined >>> a; -var rg2 = undefined >>> b; -var rg3 = undefined >>> 1; -var rg4 = undefined >>> E.a; -var rg5 = a >>> undefined; -var rg6 = b >>> undefined; -var rg7 = 0 >>> undefined; -var rg8 = E.b >>> undefined; - -// operator & -var rh1 = undefined & a; -var rh2 = undefined & b; -var rh3 = undefined & 1; -var rh4 = undefined & E.a; -var rh5 = a & undefined; -var rh6 = b & undefined; -var rh7 = 0 & undefined; -var rh8 = E.b & undefined; - -// operator ^ -var ri1 = undefined ^ a; -var ri2 = undefined ^ b; -var ri3 = undefined ^ 1; -var ri4 = undefined ^ E.a; -var ri5 = a ^ undefined; -var ri6 = b ^ undefined; -var ri7 = 0 ^ undefined; -var ri8 = E.b ^ undefined; - -// operator | -var rj1 = undefined | a; -var rj2 = undefined | b; -var rj3 = undefined | 1; -var rj4 = undefined | E.a; -var rj5 = a | undefined; -var rj6 = b | undefined; -var rj7 = 0 | undefined; -var rj8 = E.b | undefined; - // operator * var rk1 = undefined ** a; var rk2 = undefined ** b; From 4fc74b2d8af9945f0cd058798c0b8e9888c54c75 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 21 Sep 2015 16:16:28 -0700 Subject: [PATCH 07/39] Add and update tests for exponentiation --- ...entiationAssignmentLHSCannotBeAssigned.ts} | 8 +- .../emitCompoundExponentiationOperator2.ts | 25 ++++ .../emitExponentiationOperator3.ts | 113 ++++++++++++++++++ ...ExponentiationOperatorInTemplateString1.ts | 34 ++++-- 4 files changed, 168 insertions(+), 12 deletions(-) rename tests/cases/conformance/es7/exponentiationOperator/{compoundExponentiationAssignmentLHSCanBeAssigned2.ts => compoundExponentiationAssignmentLHSCannotBeAssigned.ts} (93%) create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts similarity index 93% rename from tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts rename to tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts index 7995cc8d6683a..93623f667b809 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts @@ -54,7 +54,7 @@ x5 **= '' x5 **= {}; var x6: E; -x6 *= b; -x6 *= true; -x6 *= '' -x6 *= {}; \ No newline at end of file +x6 **= b; +x6 **= true; +x6 **= '' +x6 **= {}; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2.ts new file mode 100644 index 0000000000000..216997be8cc4d --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2.ts @@ -0,0 +1,25 @@ +// @target:es5 + +var comp: number; + +comp **= 1; +comp **= comp **= 1; +comp **= comp **= 1 + 2; +comp **= comp **= 1 - 2; +comp **= comp **= 1 * 2; +comp **= comp **= 1 / 2; + +comp **= comp **= (1 + 2); +comp **= comp **= (1 - 2); +comp **= comp **= (1 * 2); +comp **= comp **= (1 / 2); + +comp **= comp **= 1 + 2 ** 3; +comp **= comp **= 1 - 2 ** 4; +comp **= comp **= 1 * 2 ** 5; +comp **= comp **= 1 / 2 ** 6; + +comp **= comp **= (1 + 2) ** 3; +comp **= comp **= (1 - 2) ** 4; +comp **= comp **= (1 * 2) ** 5; +comp **= comp **= (1 / 2) ** 6; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts new file mode 100644 index 0000000000000..b3b5deaf83dc5 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts @@ -0,0 +1,113 @@ +var temp: any; + +delete --temp ** 3; +delete ++temp ** 3; +delete temp-- ** 3; +delete temp++ ** 3; +delete -++temp ** 3; +delete -temp++ ** 3; +delete -temp-- ** 3; + +delete --temp ** 3 ** 1; +delete ++temp ** 3 ** 1; +delete temp-- ** 3 ** 1; +delete temp++ ** 3 ** 1; +delete -++temp ** 3 ** 1; +delete -temp++ ** 3 ** 1; +delete -temp-- ** 3 ** 1;; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; +-++temp ** 3; +-temp++ ** 3; +-temp-- ** 3; + +--temp ** 3 ** 1; +++temp ** 3 ** 1; +temp-- ** 3 ** 1; +temp++ ** 3 ** 1; +-++temp ** 3 ** 1; +-temp++ ** 3 ** 1; +-temp-- ** 3 ** 1; + +typeof --temp ** 3; +typeof temp-- ** 3; +typeof 3 ** 4; +typeof temp++ ** 4; +typeof temp-- ** 4; +typeof -3 ** 4; +typeof -++temp ** 4; +typeof -temp++ ** 4; +typeof -temp-- ** 4; + +typeof --temp ** 3 ** 1; +typeof temp-- ** 3 ** 1; +typeof 3 ** 4 ** 1; +typeof temp++ ** 4 ** 1; +typeof temp-- ** 4 ** 1; +typeof -3 ** 4 ** 1; +typeof -++temp ** 4 ** 1; +typeof -temp++ ** 4 ** 1; +typeof -temp-- ** 4 ** 1; + +void --temp ** 3; +void temp-- ** 3; +void 3 ** 4; +void temp++ ** 4; +void temp-- ** 4; +void -3 ** 4; +void -++temp ** 4; +void -temp++ ** 4; +void -temp-- ** 4; + +void --temp ** 3 ** 1; +void temp-- ** 3 ** 1; +void 3 ** 4 ** 1; +void temp++ ** 4 ** 1; +void temp-- ** 4 ** 1; +void -3 ** 4 ** 1; +void -++temp ** 4 ** 1; +void -temp++ ** 4 ** 1; +void -temp-- ** 4 ** 1; + +~ --temp ** 3; +~ temp-- ** 3; +~ 3 ** 4; +~ temp++ ** 4; +~ temp-- ** 4; +~ -3 ** 4; +~ -++temp ** 4; +~ -temp++ ** 4; +~ -temp-- ** 4; + +~ --temp ** 3 ** 1; +~ temp-- ** 3 ** 1; +~ 3 ** 4 ** 1; +~ temp++ ** 4 ** 1; +~ temp-- ** 4 ** 1; +~ -3 ** 4 ** 1; +~ -++temp ** 4 ** 1; +~ -temp++ ** 4 ** 1; +~ -temp-- ** 4 ** 1; + +! --temp ** 3; +! temp-- ** 3; +! 3 ** 4; +! temp++ ** 4; +! temp-- ** 4; +! -3 ** 4; +! -++temp ** 4; +! -temp++ ** 4; +! -temp-- ** 4; + +! --temp ** 3 ** 1; +! temp-- ** 3 ** 1; +! 3 ** 4 ** 1; +! temp++ ** 4 ** 1; +! temp-- ** 4 ** 1; +! -3 ** 4 ** 1; +! -++temp ** 4 ** 1; +! -temp++ ** 4 ** 1; +! -temp-- ** 4 ** 1; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts index 2b2f942c5258e..f79b22fedd771 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts @@ -1,10 +1,28 @@ var t1 = 10; var t2 = 10; -console.log(`${t1 ** t2}`) -console.log(`${t1 ** t2 ** t1}`) -console.log(`${t1 + t2 ** t1}`) -console.log(`${t1 - t2 ** t1}`) -console.log(`${t1 ** t2 + t1}`) -console.log(`${t1 ** t2 - t1}`) -console.log(`${t1 + t2 ** t2 + t1}`) -console.log(`${t1 - t2 ** t2 - t1}`) \ No newline at end of file +var s; +`Exp: ${t1 ** t2} abc`; +`Exp: ${t1 ** t2 ** t1} abc`; +`Exp: ${t1 + t2 ** t1} abc`; +`Exp: ${t1 - t2 ** t1} abc`; +`Exp: ${t1 ** t2 + t1} abc`; +`Exp: ${t1 ** t2 - t1} abc`; +`Exp: ${t1 + t2 ** t2 + t1} abc`; +`Exp: ${t1 - t2 ** t2 - t1} abc`; +`Exp: ${-t1 ** t2 - t1} abc`; +`Exp: ${+t1 ** t2 - t1} abc`; +`Exp: ${-++t1 ** t2 - t1} abc`; +`Exp: ${+--t1 ** t2 - t1} abc`; +`Exp: ${-t1++ ** t2 - t1} abc`; +`Exp: ${-t1-- ** t2 - t1} abc`; +`Exp: ${+t1++ ** t2 - t1} abc`; +`Exp: ${+t1-- ** t2 - t1} abc`; +`Exp: ${typeof t1 ** t2 ** t1} abc`; +`Exp: ${typeof t1 ** t2 + t1} abc`; +`Exp: ${typeof t1 ** (t2 - t1)} abc`; +`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; +`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; +`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; +`Exp: ${!t1 ** t2 ** t1} abc`; +`Exp: ${!t1 ** t2 ** ++t1} abc`; +`Exp: ${!t1 ** t2 ** --t1} abc`; From 4037255c27204273719e7e68641b2978f561368a Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 21 Sep 2015 16:16:47 -0700 Subject: [PATCH 08/39] Update baselines to include new tests --- ...ponentiationAssignmentLHSCanBeAssigned1.js | 56 ++ ...tiationAssignmentLHSCanBeAssigned1.symbols | 84 ++ ...entiationAssignmentLHSCanBeAssigned1.types | 102 +++ ...onAssignmentLHSCannotBeAssigned.errors.txt | 267 ++++++ ...nentiationAssignmentLHSCannotBeAssigned.js | 120 +++ ...dExponentiationAssignmentLHSIsReference.js | 47 + ...nentiationAssignmentLHSIsReference.symbols | 62 ++ ...ponentiationAssignmentLHSIsReference.types | 76 ++ ...onentiationAssignmentLHSIsValue.errors.txt | 199 +++++ ...poundExponentiationAssignmentLHSIsValue.js | 174 ++++ .../emitCompoundExponentiationOperator1.js | 43 + ...mitCompoundExponentiationOperator1.symbols | 83 ++ .../emitCompoundExponentiationOperator1.types | 171 ++++ .../emitCompoundExponentiationOperator2.js | 47 + ...mitCompoundExponentiationOperator2.symbols | 76 ++ .../emitCompoundExponentiationOperator2.types | 185 ++++ .../reference/emitExponentiationOperator1.js | 60 ++ .../emitExponentiationOperator1.symbols | 33 + .../emitExponentiationOperator1.types | 201 +++++ .../reference/emitExponentiationOperator2.js | 141 +++ .../emitExponentiationOperator2.symbols | 204 +++++ .../emitExponentiationOperator2.types | 486 ++++++++++ .../reference/emitExponentiationOperator3.js | 218 +++++ .../emitExponentiationOperator3.symbols | 272 ++++++ .../emitExponentiationOperator3.types | 832 ++++++++++++++++++ ...ExponentiationOperatorInTemplateString1.js | 60 ++ ...entiationOperatorInTemplateString1.symbols | 136 +++ ...onentiationOperatorInTemplateString1.types | 248 ++++++ .../exponentiationOperatorWithAnyAndNumber.js | 26 + ...nentiationOperatorWithAnyAndNumber.symbols | 42 + ...ponentiationOperatorWithAnyAndNumber.types | 56 ++ .../exponentiationOperatorWithEnum.js | 49 ++ .../exponentiationOperatorWithEnum.symbols | 98 +++ .../exponentiationOperatorWithEnum.types | 112 +++ .../exponentiationOperatorWithEnumUnion.js | 58 ++ ...xponentiationOperatorWithEnumUnion.symbols | 108 +++ .../exponentiationOperatorWithEnumUnion.types | 122 +++ ...tionOperatorWithInvalidOperands.errors.txt | 239 +++++ ...ponentiationOperatorWithInvalidOperands.js | 135 +++ ...WithNullValueAndInvalidOperands.errors.txt | 98 +++ ...OperatorWithNullValueAndInvalidOperands.js | 44 + ...onOperatorWithNullValueAndValidOperands.js | 41 + ...ratorWithNullValueAndValidOperands.symbols | 55 ++ ...peratorWithNullValueAndValidOperands.types | 73 ++ ...thOnlyNullValueOrUndefinedValue.errors.txt | 33 + ...eratorWithOnlyNullValueOrUndefinedValue.js | 14 + ...iationOperatorWithTypeParameter.errors.txt | 77 ++ ...exponentiationOperatorWithTypeParameter.js | 42 + ...ndefinedValueAndInvalidOperands.errors.txt | 98 +++ ...torWithUndefinedValueAndInvalidOperands.js | 44 + ...ratorWithUndefinedValueAndValidOperands.js | 41 + ...WithUndefinedValueAndValidOperands.symbols | 63 ++ ...orWithUndefinedValueAndValidOperands.types | 73 ++ 53 files changed, 6524 insertions(+) create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.symbols create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.errors.txt create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.symbols create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt create mode 100644 tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1.types create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2.types create mode 100644 tests/baselines/reference/emitExponentiationOperator1.js create mode 100644 tests/baselines/reference/emitExponentiationOperator1.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator1.types create mode 100644 tests/baselines/reference/emitExponentiationOperator2.js create mode 100644 tests/baselines/reference/emitExponentiationOperator2.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator2.types create mode 100644 tests/baselines/reference/emitExponentiationOperator3.js create mode 100644 tests/baselines/reference/emitExponentiationOperator3.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator3.types create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types create mode 100644 tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.symbols create mode 100644 tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types create mode 100644 tests/baselines/reference/exponentiationOperatorWithEnum.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithEnum.symbols create mode 100644 tests/baselines/reference/exponentiationOperatorWithEnum.types create mode 100644 tests/baselines/reference/exponentiationOperatorWithEnumUnion.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithEnumUnion.symbols create mode 100644 tests/baselines/reference/exponentiationOperatorWithEnumUnion.types create mode 100644 tests/baselines/reference/exponentiationOperatorWithInvalidOperands.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithInvalidOperands.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.symbols create mode 100644 tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types create mode 100644 tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithTypeParameter.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithTypeParameter.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.symbols create mode 100644 tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js new file mode 100644 index 0000000000000..4f02150cbe697 --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js @@ -0,0 +1,56 @@ +//// [compoundExponentiationAssignmentLHSCanBeAssigned1.ts] +enum E { a, b, c } + +var a: any; +var b: number; +var c: E; + +var x1: any; +x1 **= a; +x1 **= b; +x1 **= c; +x1 **= null; +x1 **= undefined; + +var x2: number; +x2 **= a; +x2 **= b; +x2 **= c; +x2 **= null; +x2 **= undefined; + +var x3: E; +x3 **= a; +x3 **= b; +x3 **= c; +x3 **= null; +x3 **= undefined; + +//// [compoundExponentiationAssignmentLHSCanBeAssigned1.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var x1; +x1 = Math.pow(x1, a); +x1 = Math.pow(x1, b); +x1 = Math.pow(x1, c); +x1 = Math.pow(x1, null); +x1 = Math.pow(x1, undefined); +var x2; +x2 = Math.pow(x2, a); +x2 = Math.pow(x2, b); +x2 = Math.pow(x2, c); +x2 = Math.pow(x2, null); +x2 = Math.pow(x2, undefined); +var x3; +x3 = Math.pow(x3, a); +x3 = Math.pow(x3, b); +x3 = Math.pow(x3, c); +x3 = Math.pow(x3, null); +x3 = Math.pow(x3, undefined); diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.symbols b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.symbols new file mode 100644 index 0000000000000..982c658bc03c9 --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 0, 8)) +>b : Symbol(E.b, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 0, 11)) +>c : Symbol(E.c, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 0, 14)) + +var a: any; +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 2, 3)) + +var b: number; +>b : Symbol(b, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 3, 3)) + +var c: E; +>c : Symbol(c, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 4, 3)) +>E : Symbol(E, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 0, 0)) + +var x1: any; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 6, 3)) + +x1 **= a; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 6, 3)) +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 2, 3)) + +x1 **= b; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 6, 3)) +>b : Symbol(b, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 3, 3)) + +x1 **= c; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 6, 3)) +>c : Symbol(c, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 4, 3)) + +x1 **= null; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 6, 3)) + +x1 **= undefined; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 6, 3)) +>undefined : Symbol(undefined) + +var x2: number; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 13, 3)) + +x2 **= a; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 13, 3)) +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 2, 3)) + +x2 **= b; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 13, 3)) +>b : Symbol(b, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 3, 3)) + +x2 **= c; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 13, 3)) +>c : Symbol(c, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 4, 3)) + +x2 **= null; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 13, 3)) + +x2 **= undefined; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 13, 3)) +>undefined : Symbol(undefined) + +var x3: E; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 20, 3)) +>E : Symbol(E, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 0, 0)) + +x3 **= a; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 20, 3)) +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 2, 3)) + +x3 **= b; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 20, 3)) +>b : Symbol(b, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 3, 3)) + +x3 **= c; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 20, 3)) +>c : Symbol(c, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 4, 3)) + +x3 **= null; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 20, 3)) + +x3 **= undefined; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSCanBeAssigned1.ts, 20, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types new file mode 100644 index 0000000000000..060a231da1b4f --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types @@ -0,0 +1,102 @@ +=== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts === +enum E { a, b, c } +>E : E +>a : E +>b : E +>c : E + +var a: any; +>a : any + +var b: number; +>b : number + +var c: E; +>c : E +>E : E + +var x1: any; +>x1 : any + +x1 **= a; +>x1 **= a : number +>x1 : any +>a : any + +x1 **= b; +>x1 **= b : number +>x1 : any +>b : number + +x1 **= c; +>x1 **= c : number +>x1 : any +>c : E + +x1 **= null; +>x1 **= null : number +>x1 : any +>null : null + +x1 **= undefined; +>x1 **= undefined : number +>x1 : any +>undefined : undefined + +var x2: number; +>x2 : number + +x2 **= a; +>x2 **= a : number +>x2 : number +>a : any + +x2 **= b; +>x2 **= b : number +>x2 : number +>b : number + +x2 **= c; +>x2 **= c : number +>x2 : number +>c : E + +x2 **= null; +>x2 **= null : number +>x2 : number +>null : null + +x2 **= undefined; +>x2 **= undefined : number +>x2 : number +>undefined : undefined + +var x3: E; +>x3 : E +>E : E + +x3 **= a; +>x3 **= a : number +>x3 : E +>a : any + +x3 **= b; +>x3 **= b : number +>x3 : E +>b : number + +x3 **= c; +>x3 **= c : number +>x3 : E +>c : E + +x3 **= null; +>x3 **= null : number +>x3 : E +>null : null + +x3 **= undefined; +>x3 **= undefined : number +>x3 : E +>undefined : undefined + diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.errors.txt new file mode 100644 index 0000000000000..8d15271280879 --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.errors.txt @@ -0,0 +1,267 @@ +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(8,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(9,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(9,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(10,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(11,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(11,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(12,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(13,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(13,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(14,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(14,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(15,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(15,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(19,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(19,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(20,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(20,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(21,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(22,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(22,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(23,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(24,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(24,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(25,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(25,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(26,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(26,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(29,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(30,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(31,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(31,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(32,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(33,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(33,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(34,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(35,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(35,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(36,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(36,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(37,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(37,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(41,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(41,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(42,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(42,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(43,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(44,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(44,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(45,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(46,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(47,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(47,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(48,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(48,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(51,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(52,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(53,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(54,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(57,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(58,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(59,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts(60,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCannotBeAssigned.ts (68 errors) ==== + enum E { a, b } + + var a: any; + var b: void; + + var x1: boolean; + x1 **= a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= b; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= true; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= 0; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= '' + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= E.a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= {}; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= null; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 **= undefined; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x2: string; + x2 **= a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= b; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= true; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= 0; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= '' + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= E.a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= {}; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= null; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 **= undefined; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x3: {}; + x3 **= a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= b; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= true; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= 0; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= '' + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= E.a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= {}; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= null; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 **= undefined; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x4: void; + x4 **= a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= b; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= true; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= 0; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= '' + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= E.a; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= {}; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= null; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 **= undefined; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x5: number; + x5 **= b; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x5 **= true; + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x5 **= '' + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x5 **= {}; + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x6: E; + x6 **= b; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x6 **= true; + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x6 **= '' + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x6 **= {}; + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js new file mode 100644 index 0000000000000..b04e60d373b3c --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js @@ -0,0 +1,120 @@ +//// [compoundExponentiationAssignmentLHSCannotBeAssigned.ts] +enum E { a, b } + +var a: any; +var b: void; + +var x1: boolean; +x1 **= a; +x1 **= b; +x1 **= true; +x1 **= 0; +x1 **= '' +x1 **= E.a; +x1 **= {}; +x1 **= null; +x1 **= undefined; + +var x2: string; +x2 **= a; +x2 **= b; +x2 **= true; +x2 **= 0; +x2 **= '' +x2 **= E.a; +x2 **= {}; +x2 **= null; +x2 **= undefined; + +var x3: {}; +x3 **= a; +x3 **= b; +x3 **= true; +x3 **= 0; +x3 **= '' +x3 **= E.a; +x3 **= {}; +x3 **= null; +x3 **= undefined; + +var x4: void; +x4 **= a; +x4 **= b; +x4 **= true; +x4 **= 0; +x4 **= '' +x4 **= E.a; +x4 **= {}; +x4 **= null; +x4 **= undefined; + +var x5: number; +x5 **= b; +x5 **= true; +x5 **= '' +x5 **= {}; + +var x6: E; +x6 **= b; +x6 **= true; +x6 **= '' +x6 **= {}; + +//// [compoundExponentiationAssignmentLHSCannotBeAssigned.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var x1; +x1 = Math.pow(x1, a); +x1 = Math.pow(x1, b); +x1 = Math.pow(x1, true); +x1 = Math.pow(x1, 0); +x1 = Math.pow(x1, ''); +x1 = Math.pow(x1, E.a); +x1 = Math.pow(x1, {}); +x1 = Math.pow(x1, null); +x1 = Math.pow(x1, undefined); +var x2; +x2 = Math.pow(x2, a); +x2 = Math.pow(x2, b); +x2 = Math.pow(x2, true); +x2 = Math.pow(x2, 0); +x2 = Math.pow(x2, ''); +x2 = Math.pow(x2, E.a); +x2 = Math.pow(x2, {}); +x2 = Math.pow(x2, null); +x2 = Math.pow(x2, undefined); +var x3; +x3 = Math.pow(x3, a); +x3 = Math.pow(x3, b); +x3 = Math.pow(x3, true); +x3 = Math.pow(x3, 0); +x3 = Math.pow(x3, ''); +x3 = Math.pow(x3, E.a); +x3 = Math.pow(x3, {}); +x3 = Math.pow(x3, null); +x3 = Math.pow(x3, undefined); +var x4; +x4 = Math.pow(x4, a); +x4 = Math.pow(x4, b); +x4 = Math.pow(x4, true); +x4 = Math.pow(x4, 0); +x4 = Math.pow(x4, ''); +x4 = Math.pow(x4, E.a); +x4 = Math.pow(x4, {}); +x4 = Math.pow(x4, null); +x4 = Math.pow(x4, undefined); +var x5; +x5 = Math.pow(x5, b); +x5 = Math.pow(x5, true); +x5 = Math.pow(x5, ''); +x5 = Math.pow(x5, {}); +var x6; +x6 = Math.pow(x6, b); +x6 = Math.pow(x6, true); +x6 = Math.pow(x6, ''); +x6 = Math.pow(x6, {}); diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js new file mode 100644 index 0000000000000..1d43494f3672f --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js @@ -0,0 +1,47 @@ +//// [compoundExponentiationAssignmentLHSIsReference.ts] +var value; + +// identifiers: variable and parameter +var x1: number; +x1 **= value; + +function fn1(x2: number) { + x2 **= value; +} + +// property accesses +var x3: { a: number }; +x3.a **= value; + +x3['a'] **= value; + +// parentheses, the contained expression is reference +(x1) **= value; + +function fn2(x4: number) { + (x4) **= value; +} + +(x3.a) **= value; + +(x3['a']) **= value; + +//// [compoundExponentiationAssignmentLHSIsReference.js] +var value; +// identifiers: variable and parameter +var x1; +x1 = Math.pow(x1, value); +function fn1(x2) { + x2 = Math.pow(x2, value); +} +// property accesses +var x3; +x3.a = Math.pow(x3.a, value); +x3['a'] = Math.pow(x3['a'], value); +// parentheses, the contained expression is reference +(x1) = Math.pow((x1), value); +function fn2(x4) { + (x4) = Math.pow((x4), value); +} +(x3.a) = Math.pow((x3.a), value); +(x3['a']) = Math.pow((x3['a']), value); diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.symbols b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.symbols new file mode 100644 index 0000000000000..775d43b0c58c7 --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts === +var value; +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + +// identifiers: variable and parameter +var x1: number; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 3, 3)) + +x1 **= value; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + +function fn1(x2: number) { +>fn1 : Symbol(fn1, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 4, 13)) +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 6, 13)) + + x2 **= value; +>x2 : Symbol(x2, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 6, 13)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) +} + +// property accesses +var x3: { a: number }; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) + +x3.a **= value; +>x3.a : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + +x3['a'] **= value; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 3)) +>'a' : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + +// parentheses, the contained expression is reference +(x1) **= value; +>x1 : Symbol(x1, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + +function fn2(x4: number) { +>fn2 : Symbol(fn2, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 17, 15)) +>x4 : Symbol(x4, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 19, 13)) + + (x4) **= value; +>x4 : Symbol(x4, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 19, 13)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) +} + +(x3.a) **= value; +>x3.a : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) **= value; +>x3 : Symbol(x3, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 3)) +>'a' : Symbol(a, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(compoundExponentiationAssignmentLHSIsReference.ts, 0, 3)) + diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types new file mode 100644 index 0000000000000..35f42f4fa77db --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types @@ -0,0 +1,76 @@ +=== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts === +var value; +>value : any + +// identifiers: variable and parameter +var x1: number; +>x1 : number + +x1 **= value; +>x1 **= value : number +>x1 : number +>value : any + +function fn1(x2: number) { +>fn1 : (x2: number) => void +>x2 : number + + x2 **= value; +>x2 **= value : number +>x2 : number +>value : any +} + +// property accesses +var x3: { a: number }; +>x3 : { a: number; } +>a : number + +x3.a **= value; +>x3.a **= value : number +>x3.a : number +>x3 : { a: number; } +>a : number +>value : any + +x3['a'] **= value; +>x3['a'] **= value : number +>x3['a'] : number +>x3 : { a: number; } +>'a' : string +>value : any + +// parentheses, the contained expression is reference +(x1) **= value; +>(x1) **= value : number +>(x1) : number +>x1 : number +>value : any + +function fn2(x4: number) { +>fn2 : (x4: number) => void +>x4 : number + + (x4) **= value; +>(x4) **= value : number +>(x4) : number +>x4 : number +>value : any +} + +(x3.a) **= value; +>(x3.a) **= value : number +>(x3.a) : number +>x3.a : number +>x3 : { a: number; } +>a : number +>value : any + +(x3['a']) **= value; +>(x3['a']) **= value : number +>(x3['a']) : number +>x3['a'] : number +>x3 : { a: number; } +>'a' : string +>value : any + diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt new file mode 100644 index 0000000000000..bee6f75ff5cbe --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt @@ -0,0 +1,199 @@ +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(10,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(13,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(18,5): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(25,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(27,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(32,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(35,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(36,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(37,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(39,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(43,10): error TS1128: Declaration or statement expected. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(52,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(56,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(60,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(65,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(66,11): error TS1005: ';' expected. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(69,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(72,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(73,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(74,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(75,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(76,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(77,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(78,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(79,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(80,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(81,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(82,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(83,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(84,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(85,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts (37 errors) ==== + // expected error for all the LHS of compound assignments (arithmetic and addition) + var value; + + // this + class C { + constructor() { + this **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + } + foo() { + this **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + } + static sfoo() { + this **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + } + } + + function foo() { + this **= value; + ~~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + } + + this **= value; + ~~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + + // identifiers: module, class, enum, function + module M { export var a; } + M **= value; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + C **= value; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + enum E { } + E **= value; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + foo **= value; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // literals + null **= value; + ~~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + true **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + false **= value; + ~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 0 **= value; + ~ +!!! error TS2364: Invalid left-hand side of assignment expression. + '' **= value; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + /d+/ **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // object literals + { a: 0 } **= value; + ~~~ +!!! error TS1128: Declaration or statement expected. + + // array literals + ['', ''] **= value; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // super + class Derived extends C { + constructor() { + super(); + super **= value; + ~~~ +!!! error TS1034: 'super' must be followed by an argument list or member access. + } + + foo() { + super **= value; + ~~~ +!!! error TS1034: 'super' must be followed by an argument list or member access. + } + + static sfoo() { + super **= value; + ~~~ +!!! error TS1034: 'super' must be followed by an argument list or member access. + } + } + + // function expression + function bar1() { } **= value; + ~~~ +!!! error TS1128: Declaration or statement expected. + () => { } **= value; + ~~~ +!!! error TS1005: ';' expected. + + // function calls + foo() **= value; + ~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // parentheses, the containted expression is value + (this) **= value; + ~~~~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + (M) **= value; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (C) **= value; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (E) **= value; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (foo) **= value; + ~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (null) **= value; + ~~~~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + (true) **= value; + ~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (0) **= value; + ~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + ('') **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (/d+/) **= value; + ~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ({}) **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ([]) **= value; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (function baz1() { }) **= value; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (foo()) **= value; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js new file mode 100644 index 0000000000000..d638984ec3779 --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -0,0 +1,174 @@ +//// [compoundExponentiationAssignmentLHSIsValue.ts] +// expected error for all the LHS of compound assignments (arithmetic and addition) +var value; + +// this +class C { + constructor() { + this **= value; + } + foo() { + this **= value; + } + static sfoo() { + this **= value; + } +} + +function foo() { + this **= value; +} + +this **= value; + +// identifiers: module, class, enum, function +module M { export var a; } +M **= value; + +C **= value; + +enum E { } +E **= value; + +foo **= value; + +// literals +null **= value; +true **= value; +false **= value; +0 **= value; +'' **= value; +/d+/ **= value; + +// object literals +{ a: 0 } **= value; + +// array literals +['', ''] **= value; + +// super +class Derived extends C { + constructor() { + super(); + super **= value; + } + + foo() { + super **= value; + } + + static sfoo() { + super **= value; + } +} + +// function expression +function bar1() { } **= value; +() => { } **= value; + +// function calls +foo() **= value; + +// parentheses, the containted expression is value +(this) **= value; +(M) **= value; +(C) **= value; +(E) **= value; +(foo) **= value; +(null) **= value; +(true) **= value; +(0) **= value; +('') **= value; +(/d+/) **= value; +({}) **= value; +([]) **= value; +(function baz1() { }) **= value; +(foo()) **= value; + +//// [compoundExponentiationAssignmentLHSIsValue.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +// expected error for all the LHS of compound assignments (arithmetic and addition) +var value; +// this +var C = (function () { + function C() { + this = Math.pow(this, value); + } + C.prototype.foo = function () { + this = Math.pow(this, value); + }; + C.sfoo = function () { + this = Math.pow(this, value); + }; + return C; +})(); +function foo() { + this = Math.pow(this, value); +} +this = Math.pow(this, value); +// identifiers: module, class, enum, function +var M; +(function (M) { +})(M || (M = {})); +M = Math.pow(M, value); +C = Math.pow(C, value); +var E; +(function (E) { +})(E || (E = {})); +E = Math.pow(E, value); +foo = Math.pow(foo, value); +// literals +null = Math.pow(null, value); +true = Math.pow(true, value); +false = Math.pow(false, value); +0 = Math.pow(0, value); +'' = Math.pow('', value); +/d+/ = Math.pow(/d+/, value); +// object literals +{ + a: 0; +} +value; +// array literals +['', ''] = Math.pow(['', ''], value); +// super +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.call(this); + _super.prototype. = Math.pow(_super.prototype., value); + } + Derived.prototype.foo = function () { + _super.prototype. = Math.pow(_super.prototype., value); + }; + Derived.sfoo = function () { + _super. = Math.pow(_super., value); + }; + return Derived; +})(C); +// function expression +function bar1() { } +value; +(function () { }); +value; +// function calls +foo() = Math.pow(foo(), value); +// parentheses, the containted expression is value +(this) = Math.pow((this), value); +(M) = Math.pow((M), value); +(C) = Math.pow((C), value); +(E) = Math.pow((E), value); +(foo) = Math.pow((foo), value); +(null) = Math.pow((null), value); +(true) = Math.pow((true), value); +(0) = Math.pow((0), value); +('') = Math.pow((''), value); +(/d+/) = Math.pow((/d+/), value); +({}) = Math.pow(({}), value); +([]) = Math.pow(([]), value); +(function baz1() { }) = Math.pow((function baz1() { }), value); +(foo()) = Math.pow((foo()), value); diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1.js b/tests/baselines/reference/emitCompoundExponentiationOperator1.js new file mode 100644 index 0000000000000..cf72ce1d39f5c --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1.js @@ -0,0 +1,43 @@ +//// [emitCompoundExponentiationOperator1.ts] + +var comp: number; + +comp **= 1; +comp **= comp ** comp; +comp **= comp ** comp ** 2; +comp **= comp ** comp + 2; +comp **= comp ** comp - 2; +comp **= comp ** comp * 2; +comp **= comp ** comp / 2; +comp **= comp ** comp % 2; +comp **= (comp - 2) ** 5; +comp **= (comp + 2) ** 5; +comp **= (comp * 2) ** 5; +comp **= (comp / 2) ** 5; +comp **= (comp % 2) ** 5; +comp **= comp ** (5 + 2); +comp **= comp ** (5 - 2); +comp **= comp ** (5 * 2); +comp **= comp ** (5 / 2); +comp **= comp ** (5 % 2); + +//// [emitCompoundExponentiationOperator1.js] +var comp; +comp = Math.pow(comp, 1); +comp = Math.pow(comp, Math.pow(comp, comp)); +comp = Math.pow(comp, Math.pow(comp, Math.pow(comp, 2))); +comp = Math.pow(comp, Math.pow(comp, comp) + 2); +comp = Math.pow(comp, Math.pow(comp, comp) - 2); +comp = Math.pow(comp, Math.pow(comp, comp) * 2); +comp = Math.pow(comp, Math.pow(comp, comp) / 2); +comp = Math.pow(comp, Math.pow(comp, comp) % 2); +comp = Math.pow(comp, Math.pow((comp - 2), 5)); +comp = Math.pow(comp, Math.pow((comp + 2), 5)); +comp = Math.pow(comp, Math.pow((comp * 2), 5)); +comp = Math.pow(comp, Math.pow((comp / 2), 5)); +comp = Math.pow(comp, Math.pow((comp % 2), 5)); +comp = Math.pow(comp, Math.pow(comp, (5 + 2))); +comp = Math.pow(comp, Math.pow(comp, (5 - 2))); +comp = Math.pow(comp, Math.pow(comp, (5 * 2))); +comp = Math.pow(comp, Math.pow(comp, (5 / 2))); +comp = Math.pow(comp, Math.pow(comp, (5 % 2))); diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1.symbols b/tests/baselines/reference/emitCompoundExponentiationOperator1.symbols new file mode 100644 index 0000000000000..a6a57c6fb8843 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1.symbols @@ -0,0 +1,83 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts === + +var comp: number; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= 1; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp ** 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp + 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp - 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp * 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp / 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** comp % 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= (comp - 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= (comp + 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= (comp * 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= (comp / 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= (comp % 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** (5 + 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** (5 - 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** (5 * 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** (5 / 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + +comp **= comp ** (5 % 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1.types b/tests/baselines/reference/emitCompoundExponentiationOperator1.types new file mode 100644 index 0000000000000..a1c986dbb7837 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1.types @@ -0,0 +1,171 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1.ts === + +var comp: number; +>comp : number + +comp **= 1; +>comp **= 1 : number +>comp : number +>1 : number + +comp **= comp ** comp; +>comp **= comp ** comp : number +>comp : number +>comp ** comp : number +>comp : number +>comp : number + +comp **= comp ** comp ** 2; +>comp **= comp ** comp ** 2 : number +>comp : number +>comp ** comp ** 2 : number +>comp : number +>comp ** 2 : number +>comp : number +>2 : number + +comp **= comp ** comp + 2; +>comp **= comp ** comp + 2 : number +>comp : number +>comp ** comp + 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp - 2; +>comp **= comp ** comp - 2 : number +>comp : number +>comp ** comp - 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp * 2; +>comp **= comp ** comp * 2 : number +>comp : number +>comp ** comp * 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp / 2; +>comp **= comp ** comp / 2 : number +>comp : number +>comp ** comp / 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp % 2; +>comp **= comp ** comp % 2 : number +>comp : number +>comp ** comp % 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= (comp - 2) ** 5; +>comp **= (comp - 2) ** 5 : number +>comp : number +>(comp - 2) ** 5 : number +>(comp - 2) : number +>comp - 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp + 2) ** 5; +>comp **= (comp + 2) ** 5 : number +>comp : number +>(comp + 2) ** 5 : number +>(comp + 2) : number +>comp + 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp * 2) ** 5; +>comp **= (comp * 2) ** 5 : number +>comp : number +>(comp * 2) ** 5 : number +>(comp * 2) : number +>comp * 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp / 2) ** 5; +>comp **= (comp / 2) ** 5 : number +>comp : number +>(comp / 2) ** 5 : number +>(comp / 2) : number +>comp / 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp % 2) ** 5; +>comp **= (comp % 2) ** 5 : number +>comp : number +>(comp % 2) ** 5 : number +>(comp % 2) : number +>comp % 2 : number +>comp : number +>2 : number +>5 : number + +comp **= comp ** (5 + 2); +>comp **= comp ** (5 + 2) : number +>comp : number +>comp ** (5 + 2) : number +>comp : number +>(5 + 2) : number +>5 + 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 - 2); +>comp **= comp ** (5 - 2) : number +>comp : number +>comp ** (5 - 2) : number +>comp : number +>(5 - 2) : number +>5 - 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 * 2); +>comp **= comp ** (5 * 2) : number +>comp : number +>comp ** (5 * 2) : number +>comp : number +>(5 * 2) : number +>5 * 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 / 2); +>comp **= comp ** (5 / 2) : number +>comp : number +>comp ** (5 / 2) : number +>comp : number +>(5 / 2) : number +>5 / 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 % 2); +>comp **= comp ** (5 % 2) : number +>comp : number +>comp ** (5 % 2) : number +>comp : number +>(5 % 2) : number +>5 % 2 : number +>5 : number +>2 : number + diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2.js b/tests/baselines/reference/emitCompoundExponentiationOperator2.js new file mode 100644 index 0000000000000..91b988423ac86 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2.js @@ -0,0 +1,47 @@ +//// [emitCompoundExponentiationOperator2.ts] + +var comp: number; + +comp **= 1; +comp **= comp **= 1; +comp **= comp **= 1 + 2; +comp **= comp **= 1 - 2; +comp **= comp **= 1 * 2; +comp **= comp **= 1 / 2; + +comp **= comp **= (1 + 2); +comp **= comp **= (1 - 2); +comp **= comp **= (1 * 2); +comp **= comp **= (1 / 2); + +comp **= comp **= 1 + 2 ** 3; +comp **= comp **= 1 - 2 ** 4; +comp **= comp **= 1 * 2 ** 5; +comp **= comp **= 1 / 2 ** 6; + +comp **= comp **= (1 + 2) ** 3; +comp **= comp **= (1 - 2) ** 4; +comp **= comp **= (1 * 2) ** 5; +comp **= comp **= (1 / 2) ** 6; + + +//// [emitCompoundExponentiationOperator2.js] +var comp; +comp = Math.pow(comp, 1); +comp = Math.pow(comp, comp = Math.pow(comp, 1)); +comp = Math.pow(comp, comp = Math.pow(comp, 1 + 2)); +comp = Math.pow(comp, comp = Math.pow(comp, 1 - 2)); +comp = Math.pow(comp, comp = Math.pow(comp, 1 * 2)); +comp = Math.pow(comp, comp = Math.pow(comp, 1 / 2)); +comp = Math.pow(comp, comp = Math.pow(comp, (1 + 2))); +comp = Math.pow(comp, comp = Math.pow(comp, (1 - 2))); +comp = Math.pow(comp, comp = Math.pow(comp, (1 * 2))); +comp = Math.pow(comp, comp = Math.pow(comp, (1 / 2))); +comp = Math.pow(comp, comp = Math.pow(comp, 1 + Math.pow(2, 3))); +comp = Math.pow(comp, comp = Math.pow(comp, 1 - Math.pow(2, 4))); +comp = Math.pow(comp, comp = Math.pow(comp, 1 * Math.pow(2, 5))); +comp = Math.pow(comp, comp = Math.pow(comp, 1 / Math.pow(2, 6))); +comp = Math.pow(comp, comp = Math.pow(comp, Math.pow((1 + 2), 3))); +comp = Math.pow(comp, comp = Math.pow(comp, Math.pow((1 - 2), 4))); +comp = Math.pow(comp, comp = Math.pow(comp, Math.pow((1 * 2), 5))); +comp = Math.pow(comp, comp = Math.pow(comp, Math.pow((1 / 2), 6))); diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2.symbols b/tests/baselines/reference/emitCompoundExponentiationOperator2.symbols new file mode 100644 index 0000000000000..04a22b2782cf4 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2.ts === + +var comp: number; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= 1; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 + 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 - 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 * 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 / 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 + 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 - 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 * 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 / 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 + 2 ** 3; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 - 2 ** 4; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 * 2 ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= 1 / 2 ** 6; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 + 2) ** 3; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 - 2) ** 4; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 * 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + +comp **= comp **= (1 / 2) ** 6; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2.types b/tests/baselines/reference/emitCompoundExponentiationOperator2.types new file mode 100644 index 0000000000000..03ca9b0662612 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2.types @@ -0,0 +1,185 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2.ts === + +var comp: number; +>comp : number + +comp **= 1; +>comp **= 1 : number +>comp : number +>1 : number + +comp **= comp **= 1; +>comp **= comp **= 1 : number +>comp : number +>comp **= 1 : number +>comp : number +>1 : number + +comp **= comp **= 1 + 2; +>comp **= comp **= 1 + 2 : number +>comp : number +>comp **= 1 + 2 : number +>comp : number +>1 + 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 - 2; +>comp **= comp **= 1 - 2 : number +>comp : number +>comp **= 1 - 2 : number +>comp : number +>1 - 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 * 2; +>comp **= comp **= 1 * 2 : number +>comp : number +>comp **= 1 * 2 : number +>comp : number +>1 * 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 / 2; +>comp **= comp **= 1 / 2 : number +>comp : number +>comp **= 1 / 2 : number +>comp : number +>1 / 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 + 2); +>comp **= comp **= (1 + 2) : number +>comp : number +>comp **= (1 + 2) : number +>comp : number +>(1 + 2) : number +>1 + 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 - 2); +>comp **= comp **= (1 - 2) : number +>comp : number +>comp **= (1 - 2) : number +>comp : number +>(1 - 2) : number +>1 - 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 * 2); +>comp **= comp **= (1 * 2) : number +>comp : number +>comp **= (1 * 2) : number +>comp : number +>(1 * 2) : number +>1 * 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 / 2); +>comp **= comp **= (1 / 2) : number +>comp : number +>comp **= (1 / 2) : number +>comp : number +>(1 / 2) : number +>1 / 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 + 2 ** 3; +>comp **= comp **= 1 + 2 ** 3 : number +>comp : number +>comp **= 1 + 2 ** 3 : number +>comp : number +>1 + 2 ** 3 : number +>1 : number +>2 ** 3 : number +>2 : number +>3 : number + +comp **= comp **= 1 - 2 ** 4; +>comp **= comp **= 1 - 2 ** 4 : number +>comp : number +>comp **= 1 - 2 ** 4 : number +>comp : number +>1 - 2 ** 4 : number +>1 : number +>2 ** 4 : number +>2 : number +>4 : number + +comp **= comp **= 1 * 2 ** 5; +>comp **= comp **= 1 * 2 ** 5 : number +>comp : number +>comp **= 1 * 2 ** 5 : number +>comp : number +>1 * 2 ** 5 : number +>1 : number +>2 ** 5 : number +>2 : number +>5 : number + +comp **= comp **= 1 / 2 ** 6; +>comp **= comp **= 1 / 2 ** 6 : number +>comp : number +>comp **= 1 / 2 ** 6 : number +>comp : number +>1 / 2 ** 6 : number +>1 : number +>2 ** 6 : number +>2 : number +>6 : number + +comp **= comp **= (1 + 2) ** 3; +>comp **= comp **= (1 + 2) ** 3 : number +>comp : number +>comp **= (1 + 2) ** 3 : number +>comp : number +>(1 + 2) ** 3 : number +>(1 + 2) : number +>1 + 2 : number +>1 : number +>2 : number +>3 : number + +comp **= comp **= (1 - 2) ** 4; +>comp **= comp **= (1 - 2) ** 4 : number +>comp : number +>comp **= (1 - 2) ** 4 : number +>comp : number +>(1 - 2) ** 4 : number +>(1 - 2) : number +>1 - 2 : number +>1 : number +>2 : number +>4 : number + +comp **= comp **= (1 * 2) ** 5; +>comp **= comp **= (1 * 2) ** 5 : number +>comp : number +>comp **= (1 * 2) ** 5 : number +>comp : number +>(1 * 2) ** 5 : number +>(1 * 2) : number +>1 * 2 : number +>1 : number +>2 : number +>5 : number + +comp **= comp **= (1 / 2) ** 6; +>comp **= comp **= (1 / 2) ** 6 : number +>comp : number +>comp **= (1 / 2) ** 6 : number +>comp : number +>(1 / 2) ** 6 : number +>(1 / 2) : number +>1 / 2 : number +>1 : number +>2 : number +>6 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator1.js b/tests/baselines/reference/emitExponentiationOperator1.js new file mode 100644 index 0000000000000..7c37137b83fff --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator1.js @@ -0,0 +1,60 @@ +//// [emitExponentiationOperator1.ts] + +1 ** 2; +1 ** 2 ** 3; +1 ** -2 ** 3; +1 ** -2 ** -3; +-1 ** -2 ** -3; +-(1 ** 2) ** 3; +1 ** -(2 ** 3); + +1 ** 2 + 3; +1 ** 2 - 3; +1 ** 2 * 3; +1 ** 2 / 3; +1 ** 2 % 3; + +1 ** -2 + 3; +1 ** -2 - 3; +1 ** -2 * 3; +1 ** -2 / 3; +1 ** -2 % 3; + +2 + 3 ** 3; +2 - 3 ** 3; +2 * 3 ** 3; +2 / 3 ** 3; +2 % 3 ** 3; + +(2 + 3) ** 4; +(2 - 3) ** 4; +(2 * 3) ** 4; +(2 / 3) ** 4; + +//// [emitExponentiationOperator1.js] +Math.pow(1, 2); +Math.pow(1, Math.pow(2, 3)); +Math.pow(1, -Math.pow(2, 3)); +Math.pow(1, -Math.pow(2, -3)); +-Math.pow(1, -Math.pow(2, -3)); +-Math.pow((Math.pow(1, 2)), 3); +Math.pow(1, -(Math.pow(2, 3))); +Math.pow(1, 2) + 3; +Math.pow(1, 2) - 3; +Math.pow(1, 2) * 3; +Math.pow(1, 2) / 3; +Math.pow(1, 2) % 3; +Math.pow(1, -2) + 3; +Math.pow(1, -2) - 3; +Math.pow(1, -2) * 3; +Math.pow(1, -2) / 3; +Math.pow(1, -2) % 3; +2 + Math.pow(3, 3); +2 - Math.pow(3, 3); +2 * Math.pow(3, 3); +2 / Math.pow(3, 3); +2 % Math.pow(3, 3); +Math.pow((2 + 3), 4); +Math.pow((2 - 3), 4); +Math.pow((2 * 3), 4); +Math.pow((2 / 3), 4); diff --git a/tests/baselines/reference/emitExponentiationOperator1.symbols b/tests/baselines/reference/emitExponentiationOperator1.symbols new file mode 100644 index 0000000000000..5e2bd27b02c6c --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator1.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts === + +No type information for this code.1 ** 2; +No type information for this code.1 ** 2 ** 3; +No type information for this code.1 ** -2 ** 3; +No type information for this code.1 ** -2 ** -3; +No type information for this code.-1 ** -2 ** -3; +No type information for this code.-(1 ** 2) ** 3; +No type information for this code.1 ** -(2 ** 3); +No type information for this code. +No type information for this code.1 ** 2 + 3; +No type information for this code.1 ** 2 - 3; +No type information for this code.1 ** 2 * 3; +No type information for this code.1 ** 2 / 3; +No type information for this code.1 ** 2 % 3; +No type information for this code. +No type information for this code.1 ** -2 + 3; +No type information for this code.1 ** -2 - 3; +No type information for this code.1 ** -2 * 3; +No type information for this code.1 ** -2 / 3; +No type information for this code.1 ** -2 % 3; +No type information for this code. +No type information for this code.2 + 3 ** 3; +No type information for this code.2 - 3 ** 3; +No type information for this code.2 * 3 ** 3; +No type information for this code.2 / 3 ** 3; +No type information for this code.2 % 3 ** 3; +No type information for this code. +No type information for this code.(2 + 3) ** 4; +No type information for this code.(2 - 3) ** 4; +No type information for this code.(2 * 3) ** 4; +No type information for this code.(2 / 3) ** 4; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emitExponentiationOperator1.types b/tests/baselines/reference/emitExponentiationOperator1.types new file mode 100644 index 0000000000000..de81d0b2e8f92 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator1.types @@ -0,0 +1,201 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts === + +1 ** 2; +>1 ** 2 : number +>1 : number +>2 : number + +1 ** 2 ** 3; +>1 ** 2 ** 3 : number +>1 : number +>2 ** 3 : number +>2 : number +>3 : number + +1 ** -2 ** 3; +>1 ** -2 ** 3 : number +>1 : number +>-2 ** 3 : number +>2 ** 3 : number +>2 : number +>3 : number + +1 ** -2 ** -3; +>1 ** -2 ** -3 : number +>1 : number +>-2 ** -3 : number +>2 ** -3 : number +>2 : number +>-3 : number +>3 : number + +-1 ** -2 ** -3; +>-1 ** -2 ** -3 : number +>1 ** -2 ** -3 : number +>1 : number +>-2 ** -3 : number +>2 ** -3 : number +>2 : number +>-3 : number +>3 : number + +-(1 ** 2) ** 3; +>-(1 ** 2) ** 3 : number +>(1 ** 2) ** 3 : number +>(1 ** 2) : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** -(2 ** 3); +>1 ** -(2 ** 3) : number +>1 : number +>-(2 ** 3) : number +>(2 ** 3) : number +>2 ** 3 : number +>2 : number +>3 : number + +1 ** 2 + 3; +>1 ** 2 + 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 - 3; +>1 ** 2 - 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 * 3; +>1 ** 2 * 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 / 3; +>1 ** 2 / 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 % 3; +>1 ** 2 % 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** -2 + 3; +>1 ** -2 + 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 - 3; +>1 ** -2 - 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 * 3; +>1 ** -2 * 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 / 3; +>1 ** -2 / 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 % 3; +>1 ** -2 % 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +2 + 3 ** 3; +>2 + 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 - 3 ** 3; +>2 - 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 * 3 ** 3; +>2 * 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 / 3 ** 3; +>2 / 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 % 3 ** 3; +>2 % 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +(2 + 3) ** 4; +>(2 + 3) ** 4 : number +>(2 + 3) : number +>2 + 3 : number +>2 : number +>3 : number +>4 : number + +(2 - 3) ** 4; +>(2 - 3) ** 4 : number +>(2 - 3) : number +>2 - 3 : number +>2 : number +>3 : number +>4 : number + +(2 * 3) ** 4; +>(2 * 3) ** 4 : number +>(2 * 3) : number +>2 * 3 : number +>2 : number +>3 : number +>4 : number + +(2 / 3) ** 4; +>(2 / 3) ** 4 : number +>(2 / 3) : number +>2 / 3 : number +>2 : number +>3 : number +>4 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator2.js b/tests/baselines/reference/emitExponentiationOperator2.js new file mode 100644 index 0000000000000..3a93ee9ec9c11 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator2.js @@ -0,0 +1,141 @@ +//// [emitExponentiationOperator2.ts] + +var temp = 10; + +++temp ** 3; +--temp ** 3; +temp++ ** 3; +temp-- ** 3; +--temp + temp ** 3; +--temp - temp ** 3; +--temp * temp ** 3; +--temp / temp ** 3; +--temp % temp ** 3; +-++temp ** 3; ++--temp ** 3; + +temp-- ** 3; +temp++ ** 3; +-temp++ ** 3; ++temp-- ** 3; + +temp-- + temp ** 3; +temp-- - temp ** 3; +temp-- * temp ** 3; +temp-- / temp ** 3; +temp-- % temp ** 3; + +--temp + 2 ** 3; +--temp - 2 ** 3; +--temp * 2 ** 3; +--temp / 2 ** 3; +--temp % 2 ** 3; + +++temp + 2 ** 3; +++temp - 2 ** 3; +++temp * 2 ** 3; +++temp / 2 ** 3; + +3 ** ++temp; +3 ** --temp; +3 ** temp++; +3 ** temp--; +-3 ** temp++; +-3 ** temp--; +-3 ** ++temp; +-3 ** --temp; ++3 ** temp++; ++3 ** temp--; ++3 ** ++temp; ++3 ** --temp + +3 ** ++temp ** 2; +3 ** --temp ** 2; +3 ** temp++ ** 2; +3 ** temp-- ** 2; +-3 ** temp++ ** 2; +-3 ** temp-- ** 2; +-3 ** ++temp ** 2; +-3 ** --temp ** 2; ++3 ** temp++ ** 2; ++3 ** temp-- ** 2; ++3 ** ++temp ** 2; ++3 ** --temp ** 2; + +3 ** ++temp + 2; +3 ** ++temp - 2; +3 ** ++temp * 2; +3 ** ++temp / 2; +3 ** ++temp % 2; + +3 ** --temp + 2; +3 ** --temp - 2; +3 ** --temp * 2; +3 ** --temp / 2; +3 ** --temp % 2; + +//// [emitExponentiationOperator2.js] +var temp = 10; +Math.pow(++temp, 3); +Math.pow(--temp, 3); +Math.pow(temp++, 3); +Math.pow(temp--, 3); +--temp + Math.pow(temp, 3); +--temp - Math.pow(temp, 3); +--temp * Math.pow(temp, 3); +--temp / Math.pow(temp, 3); +--temp % Math.pow(temp, 3); +-Math.pow(++temp, 3); ++Math.pow(--temp, 3); +Math.pow(temp--, 3); +Math.pow(temp++, 3); +-Math.pow(temp++, 3); ++Math.pow(temp--, 3); +temp-- + Math.pow(temp, 3); +temp-- - Math.pow(temp, 3); +temp-- * Math.pow(temp, 3); +temp-- / Math.pow(temp, 3); +temp-- % Math.pow(temp, 3); +--temp + Math.pow(2, 3); +--temp - Math.pow(2, 3); +--temp * Math.pow(2, 3); +--temp / Math.pow(2, 3); +--temp % Math.pow(2, 3); +++temp + Math.pow(2, 3); +++temp - Math.pow(2, 3); +++temp * Math.pow(2, 3); +++temp / Math.pow(2, 3); +Math.pow(3, ++temp); +Math.pow(3, --temp); +Math.pow(3, temp++); +Math.pow(3, temp--); +-Math.pow(3, temp++); +-Math.pow(3, temp--); +-Math.pow(3, ++temp); +-Math.pow(3, --temp); ++Math.pow(3, temp++); ++Math.pow(3, temp--); ++Math.pow(3, ++temp); ++Math.pow(3, --temp); +Math.pow(3, Math.pow(++temp, 2)); +Math.pow(3, Math.pow(--temp, 2)); +Math.pow(3, Math.pow(temp++, 2)); +Math.pow(3, Math.pow(temp--, 2)); +-Math.pow(3, Math.pow(temp++, 2)); +-Math.pow(3, Math.pow(temp--, 2)); +-Math.pow(3, Math.pow(++temp, 2)); +-Math.pow(3, Math.pow(--temp, 2)); ++Math.pow(3, Math.pow(temp++, 2)); ++Math.pow(3, Math.pow(temp--, 2)); ++Math.pow(3, Math.pow(++temp, 2)); ++Math.pow(3, Math.pow(--temp, 2)); +Math.pow(3, ++temp) + 2; +Math.pow(3, ++temp) - 2; +Math.pow(3, ++temp) * 2; +Math.pow(3, ++temp) / 2; +Math.pow(3, ++temp) % 2; +Math.pow(3, --temp) + 2; +Math.pow(3, --temp) - 2; +Math.pow(3, --temp) * 2; +Math.pow(3, --temp) / 2; +Math.pow(3, --temp) % 2; diff --git a/tests/baselines/reference/emitExponentiationOperator2.symbols b/tests/baselines/reference/emitExponentiationOperator2.symbols new file mode 100644 index 0000000000000..58aa20a1d5fa1 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator2.symbols @@ -0,0 +1,204 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts === + +var temp = 10; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp + temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp - temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp * temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp / temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp % temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++--temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- + temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- - temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- * temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- / temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +temp-- % temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp + 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp - 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp * 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp / 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +--temp % 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +++temp + 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +++temp - 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +++temp * 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +++temp / 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** --temp +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +-3 ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + ++3 ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp + 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp - 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp * 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp / 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** ++temp % 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp + 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp - 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp * 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp / 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + +3 ** --temp % 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperator2.types b/tests/baselines/reference/emitExponentiationOperator2.types new file mode 100644 index 0000000000000..edd40614a36f3 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator2.types @@ -0,0 +1,486 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts === + +var temp = 10; +>temp : number +>10 : number + +++temp ** 3; +>++temp ** 3 : number +>++temp : number +>temp : number +>3 : number + +--temp ** 3; +>--temp ** 3 : number +>--temp : number +>temp : number +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ : number +>temp : number +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- : number +>temp : number +>3 : number + +--temp + temp ** 3; +>--temp + temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp - temp ** 3; +>--temp - temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp * temp ** 3; +>--temp * temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp / temp ** 3; +>--temp / temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp % temp ** 3; +>--temp % temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +-++temp ** 3; +>-++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : number +>3 : number + ++--temp ** 3; +>+--temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : number +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- : number +>temp : number +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ : number +>temp : number +>3 : number + +-temp++ ** 3; +>-temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : number +>3 : number + ++temp-- ** 3; +>+temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : number +>3 : number + +temp-- + temp ** 3; +>temp-- + temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- - temp ** 3; +>temp-- - temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- * temp ** 3; +>temp-- * temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- / temp ** 3; +>temp-- / temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- % temp ** 3; +>temp-- % temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp + 2 ** 3; +>--temp + 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp - 2 ** 3; +>--temp - 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp * 2 ** 3; +>--temp * 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp / 2 ** 3; +>--temp / 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp % 2 ** 3; +>--temp % 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp + 2 ** 3; +>++temp + 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp - 2 ** 3; +>++temp - 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp * 2 ** 3; +>++temp * 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp / 2 ** 3; +>++temp / 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +3 ** ++temp; +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number + +3 ** --temp; +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number + +3 ** temp++; +>3 ** temp++ : number +>3 : number +>temp++ : number +>temp : number + +3 ** temp--; +>3 ** temp-- : number +>3 : number +>temp-- : number +>temp : number + +-3 ** temp++; +>-3 ** temp++ : number +>3 ** temp++ : number +>3 : number +>temp++ : number +>temp : number + +-3 ** temp--; +>-3 ** temp-- : number +>3 ** temp-- : number +>3 : number +>temp-- : number +>temp : number + +-3 ** ++temp; +>-3 ** ++temp : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number + +-3 ** --temp; +>-3 ** --temp : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number + ++3 ** temp++; +>+3 ** temp++ : number +>3 ** temp++ : number +>3 : number +>temp++ : number +>temp : number + ++3 ** temp--; +>+3 ** temp-- : number +>3 ** temp-- : number +>3 : number +>temp-- : number +>temp : number + ++3 ** ++temp; +>+3 ** ++temp : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number + ++3 ** --temp +>+3 ** --temp : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number + +3 ** ++temp ** 2; +>3 ** ++temp ** 2 : number +>3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number + +3 ** --temp ** 2; +>3 ** --temp ** 2 : number +>3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number + +3 ** temp++ ** 2; +>3 ** temp++ ** 2 : number +>3 : number +>temp++ ** 2 : number +>temp++ : number +>temp : number +>2 : number + +3 ** temp-- ** 2; +>3 ** temp-- ** 2 : number +>3 : number +>temp-- ** 2 : number +>temp-- : number +>temp : number +>2 : number + +-3 ** temp++ ** 2; +>-3 ** temp++ ** 2 : number +>3 ** temp++ ** 2 : number +>3 : number +>temp++ ** 2 : number +>temp++ : number +>temp : number +>2 : number + +-3 ** temp-- ** 2; +>-3 ** temp-- ** 2 : number +>3 ** temp-- ** 2 : number +>3 : number +>temp-- ** 2 : number +>temp-- : number +>temp : number +>2 : number + +-3 ** ++temp ** 2; +>-3 ** ++temp ** 2 : number +>3 ** ++temp ** 2 : number +>3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number + +-3 ** --temp ** 2; +>-3 ** --temp ** 2 : number +>3 ** --temp ** 2 : number +>3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number + ++3 ** temp++ ** 2; +>+3 ** temp++ ** 2 : number +>3 ** temp++ ** 2 : number +>3 : number +>temp++ ** 2 : number +>temp++ : number +>temp : number +>2 : number + ++3 ** temp-- ** 2; +>+3 ** temp-- ** 2 : number +>3 ** temp-- ** 2 : number +>3 : number +>temp-- ** 2 : number +>temp-- : number +>temp : number +>2 : number + ++3 ** ++temp ** 2; +>+3 ** ++temp ** 2 : number +>3 ** ++temp ** 2 : number +>3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number + ++3 ** --temp ** 2; +>+3 ** --temp ** 2 : number +>3 ** --temp ** 2 : number +>3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number + +3 ** ++temp + 2; +>3 ** ++temp + 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp - 2; +>3 ** ++temp - 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp * 2; +>3 ** ++temp * 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp / 2; +>3 ** ++temp / 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp % 2; +>3 ** ++temp % 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** --temp + 2; +>3 ** --temp + 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp - 2; +>3 ** --temp - 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp * 2; +>3 ** --temp * 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp / 2; +>3 ** --temp / 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp % 2; +>3 ** --temp % 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator3.js b/tests/baselines/reference/emitExponentiationOperator3.js new file mode 100644 index 0000000000000..7cb92dfae63e2 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator3.js @@ -0,0 +1,218 @@ +//// [emitExponentiationOperator3.ts] +var temp: any; + +delete --temp ** 3; +delete ++temp ** 3; +delete temp-- ** 3; +delete temp++ ** 3; +delete -++temp ** 3; +delete -temp++ ** 3; +delete -temp-- ** 3; + +delete --temp ** 3 ** 1; +delete ++temp ** 3 ** 1; +delete temp-- ** 3 ** 1; +delete temp++ ** 3 ** 1; +delete -++temp ** 3 ** 1; +delete -temp++ ** 3 ** 1; +delete -temp-- ** 3 ** 1;; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; +-++temp ** 3; +-temp++ ** 3; +-temp-- ** 3; + +--temp ** 3 ** 1; +++temp ** 3 ** 1; +temp-- ** 3 ** 1; +temp++ ** 3 ** 1; +-++temp ** 3 ** 1; +-temp++ ** 3 ** 1; +-temp-- ** 3 ** 1; + +typeof --temp ** 3; +typeof temp-- ** 3; +typeof 3 ** 4; +typeof temp++ ** 4; +typeof temp-- ** 4; +typeof -3 ** 4; +typeof -++temp ** 4; +typeof -temp++ ** 4; +typeof -temp-- ** 4; + +typeof --temp ** 3 ** 1; +typeof temp-- ** 3 ** 1; +typeof 3 ** 4 ** 1; +typeof temp++ ** 4 ** 1; +typeof temp-- ** 4 ** 1; +typeof -3 ** 4 ** 1; +typeof -++temp ** 4 ** 1; +typeof -temp++ ** 4 ** 1; +typeof -temp-- ** 4 ** 1; + +void --temp ** 3; +void temp-- ** 3; +void 3 ** 4; +void temp++ ** 4; +void temp-- ** 4; +void -3 ** 4; +void -++temp ** 4; +void -temp++ ** 4; +void -temp-- ** 4; + +void --temp ** 3 ** 1; +void temp-- ** 3 ** 1; +void 3 ** 4 ** 1; +void temp++ ** 4 ** 1; +void temp-- ** 4 ** 1; +void -3 ** 4 ** 1; +void -++temp ** 4 ** 1; +void -temp++ ** 4 ** 1; +void -temp-- ** 4 ** 1; + +~ --temp ** 3; +~ temp-- ** 3; +~ 3 ** 4; +~ temp++ ** 4; +~ temp-- ** 4; +~ -3 ** 4; +~ -++temp ** 4; +~ -temp++ ** 4; +~ -temp-- ** 4; + +~ --temp ** 3 ** 1; +~ temp-- ** 3 ** 1; +~ 3 ** 4 ** 1; +~ temp++ ** 4 ** 1; +~ temp-- ** 4 ** 1; +~ -3 ** 4 ** 1; +~ -++temp ** 4 ** 1; +~ -temp++ ** 4 ** 1; +~ -temp-- ** 4 ** 1; + +! --temp ** 3; +! temp-- ** 3; +! 3 ** 4; +! temp++ ** 4; +! temp-- ** 4; +! -3 ** 4; +! -++temp ** 4; +! -temp++ ** 4; +! -temp-- ** 4; + +! --temp ** 3 ** 1; +! temp-- ** 3 ** 1; +! 3 ** 4 ** 1; +! temp++ ** 4 ** 1; +! temp-- ** 4 ** 1; +! -3 ** 4 ** 1; +! -++temp ** 4 ** 1; +! -temp++ ** 4 ** 1; +! -temp-- ** 4 ** 1; + +//// [emitExponentiationOperator3.js] +var temp; +delete Math.pow(--temp, 3); +delete Math.pow(++temp, 3); +delete Math.pow(temp--, 3); +delete Math.pow(temp++, 3); +delete -Math.pow(++temp, 3); +delete -Math.pow(temp++, 3); +delete -Math.pow(temp--, 3); +delete Math.pow(--temp, Math.pow(3, 1)); +delete Math.pow(++temp, Math.pow(3, 1)); +delete Math.pow(temp--, Math.pow(3, 1)); +delete Math.pow(temp++, Math.pow(3, 1)); +delete -Math.pow(++temp, Math.pow(3, 1)); +delete -Math.pow(temp++, Math.pow(3, 1)); +delete -Math.pow(temp--, Math.pow(3, 1)); +; +Math.pow(--temp, 3); +Math.pow(++temp, 3); +Math.pow(temp--, 3); +Math.pow(temp++, 3); +-Math.pow(++temp, 3); +-Math.pow(temp++, 3); +-Math.pow(temp--, 3); +Math.pow(--temp, Math.pow(3, 1)); +Math.pow(++temp, Math.pow(3, 1)); +Math.pow(temp--, Math.pow(3, 1)); +Math.pow(temp++, Math.pow(3, 1)); +-Math.pow(++temp, Math.pow(3, 1)); +-Math.pow(temp++, Math.pow(3, 1)); +-Math.pow(temp--, Math.pow(3, 1)); +typeof Math.pow(--temp, 3); +typeof Math.pow(temp--, 3); +typeof Math.pow(3, 4); +typeof Math.pow(temp++, 4); +typeof Math.pow(temp--, 4); +typeof -Math.pow(3, 4); +typeof -Math.pow(++temp, 4); +typeof -Math.pow(temp++, 4); +typeof -Math.pow(temp--, 4); +typeof Math.pow(--temp, Math.pow(3, 1)); +typeof Math.pow(temp--, Math.pow(3, 1)); +typeof Math.pow(3, Math.pow(4, 1)); +typeof Math.pow(temp++, Math.pow(4, 1)); +typeof Math.pow(temp--, Math.pow(4, 1)); +typeof -Math.pow(3, Math.pow(4, 1)); +typeof -Math.pow(++temp, Math.pow(4, 1)); +typeof -Math.pow(temp++, Math.pow(4, 1)); +typeof -Math.pow(temp--, Math.pow(4, 1)); +void Math.pow(--temp, 3); +void Math.pow(temp--, 3); +void Math.pow(3, 4); +void Math.pow(temp++, 4); +void Math.pow(temp--, 4); +void -Math.pow(3, 4); +void -Math.pow(++temp, 4); +void -Math.pow(temp++, 4); +void -Math.pow(temp--, 4); +void Math.pow(--temp, Math.pow(3, 1)); +void Math.pow(temp--, Math.pow(3, 1)); +void Math.pow(3, Math.pow(4, 1)); +void Math.pow(temp++, Math.pow(4, 1)); +void Math.pow(temp--, Math.pow(4, 1)); +void -Math.pow(3, Math.pow(4, 1)); +void -Math.pow(++temp, Math.pow(4, 1)); +void -Math.pow(temp++, Math.pow(4, 1)); +void -Math.pow(temp--, Math.pow(4, 1)); +~Math.pow(--temp, 3); +~Math.pow(temp--, 3); +~Math.pow(3, 4); +~Math.pow(temp++, 4); +~Math.pow(temp--, 4); +~-Math.pow(3, 4); +~-Math.pow(++temp, 4); +~-Math.pow(temp++, 4); +~-Math.pow(temp--, 4); +~Math.pow(--temp, Math.pow(3, 1)); +~Math.pow(temp--, Math.pow(3, 1)); +~Math.pow(3, Math.pow(4, 1)); +~Math.pow(temp++, Math.pow(4, 1)); +~Math.pow(temp--, Math.pow(4, 1)); +~-Math.pow(3, Math.pow(4, 1)); +~-Math.pow(++temp, Math.pow(4, 1)); +~-Math.pow(temp++, Math.pow(4, 1)); +~-Math.pow(temp--, Math.pow(4, 1)); +!Math.pow(--temp, 3); +!Math.pow(temp--, 3); +!Math.pow(3, 4); +!Math.pow(temp++, 4); +!Math.pow(temp--, 4); +!-Math.pow(3, 4); +!-Math.pow(++temp, 4); +!-Math.pow(temp++, 4); +!-Math.pow(temp--, 4); +!Math.pow(--temp, Math.pow(3, 1)); +!Math.pow(temp--, Math.pow(3, 1)); +!Math.pow(3, Math.pow(4, 1)); +!Math.pow(temp++, Math.pow(4, 1)); +!Math.pow(temp--, Math.pow(4, 1)); +!-Math.pow(3, Math.pow(4, 1)); +!-Math.pow(++temp, Math.pow(4, 1)); +!-Math.pow(temp++, Math.pow(4, 1)); +!-Math.pow(temp--, Math.pow(4, 1)); diff --git a/tests/baselines/reference/emitExponentiationOperator3.symbols b/tests/baselines/reference/emitExponentiationOperator3.symbols new file mode 100644 index 0000000000000..68b70711695f3 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator3.symbols @@ -0,0 +1,272 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts === +var temp: any; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete ++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete -++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete -temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete -temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete --temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete ++temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete temp++ ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete -++temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete -temp++ ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +delete -temp-- ** 3 ** 1;; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +--temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +-++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +-temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +-temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +--temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +++temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +temp++ ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +-++temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +-temp++ ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +-temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof 3 ** 4; +typeof temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof -3 ** 4; +typeof -++temp ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof -temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof -temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof --temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof 3 ** 4 ** 1; +typeof temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof -3 ** 4 ** 1; +typeof -++temp ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof -temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +typeof -temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void 3 ** 4; +void temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void -3 ** 4; +void -++temp ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void -temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void -temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void --temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void 3 ** 4 ** 1; +void temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void -3 ** 4 ** 1; +void -++temp ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void -temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +void -temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ 3 ** 4; +~ temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ -3 ** 4; +~ -++temp ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ -temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ -temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ --temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ 3 ** 4 ** 1; +~ temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ -3 ** 4 ** 1; +~ -++temp ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ -temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +~ -temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! 3 ** 4; +! temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! -3 ** 4; +! -++temp ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! -temp++ ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! -temp-- ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! --temp ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! temp-- ** 3 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! 3 ** 4 ** 1; +! temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! -3 ** 4 ** 1; +! -++temp ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! -temp++ ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + +! -temp-- ** 4 ** 1; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperator3.types b/tests/baselines/reference/emitExponentiationOperator3.types new file mode 100644 index 0000000000000..8e455b7cd6892 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator3.types @@ -0,0 +1,832 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts === +var temp: any; +>temp : any + +delete --temp ** 3; +>delete --temp ** 3 : boolean +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +delete ++temp ** 3; +>delete ++temp ** 3 : boolean +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +delete temp-- ** 3; +>delete temp-- ** 3 : boolean +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +delete temp++ ** 3; +>delete temp++ ** 3 : boolean +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +delete -++temp ** 3; +>delete -++temp ** 3 : boolean +>-++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +delete -temp++ ** 3; +>delete -temp++ ** 3 : boolean +>-temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +delete -temp-- ** 3; +>delete -temp-- ** 3 : boolean +>-temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +delete --temp ** 3 ** 1; +>delete --temp ** 3 ** 1 : boolean +>--temp ** 3 ** 1 : number +>--temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +delete ++temp ** 3 ** 1; +>delete ++temp ** 3 ** 1 : boolean +>++temp ** 3 ** 1 : number +>++temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +delete temp-- ** 3 ** 1; +>delete temp-- ** 3 ** 1 : boolean +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +delete temp++ ** 3 ** 1; +>delete temp++ ** 3 ** 1 : boolean +>temp++ ** 3 ** 1 : number +>temp++ : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +delete -++temp ** 3 ** 1; +>delete -++temp ** 3 ** 1 : boolean +>-++temp ** 3 ** 1 : number +>++temp ** 3 ** 1 : number +>++temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +delete -temp++ ** 3 ** 1; +>delete -temp++ ** 3 ** 1 : boolean +>-temp++ ** 3 ** 1 : number +>temp++ ** 3 ** 1 : number +>temp++ : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +delete -temp-- ** 3 ** 1;; +>delete -temp-- ** 3 ** 1 : boolean +>-temp-- ** 3 ** 1 : number +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +--temp ** 3; +>--temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +++temp ** 3; +>++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +-++temp ** 3; +>-++temp ** 3 : number +>-++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +-temp++ ** 3; +>-temp++ ** 3 : number +>-temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +-temp-- ** 3; +>-temp-- ** 3 : number +>-temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +--temp ** 3 ** 1; +>--temp ** 3 ** 1 : number +>--temp ** 3 ** 1 : number +>--temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +++temp ** 3 ** 1; +>++temp ** 3 ** 1 : number +>++temp ** 3 ** 1 : number +>++temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +temp-- ** 3 ** 1; +>temp-- ** 3 ** 1 : number +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +temp++ ** 3 ** 1; +>temp++ ** 3 ** 1 : number +>temp++ ** 3 ** 1 : number +>temp++ : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +-++temp ** 3 ** 1; +>-++temp ** 3 ** 1 : number +>-++temp ** 3 ** 1 : number +>++temp ** 3 ** 1 : number +>++temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +-temp++ ** 3 ** 1; +>-temp++ ** 3 ** 1 : number +>-temp++ ** 3 ** 1 : number +>temp++ ** 3 ** 1 : number +>temp++ : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +-temp-- ** 3 ** 1; +>-temp-- ** 3 ** 1 : number +>-temp-- ** 3 ** 1 : number +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +typeof --temp ** 3; +>typeof --temp ** 3 : string +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +typeof temp-- ** 3; +>typeof temp-- ** 3 : string +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +typeof 3 ** 4; +>typeof 3 ** 4 : string +>3 ** 4 : number +>3 : number +>4 : number + +typeof temp++ ** 4; +>typeof temp++ ** 4 : string +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +typeof temp-- ** 4; +>typeof temp-- ** 4 : string +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +typeof -3 ** 4; +>typeof -3 ** 4 : string +>-3 ** 4 : number +>3 ** 4 : number +>3 : number +>4 : number + +typeof -++temp ** 4; +>typeof -++temp ** 4 : string +>-++temp ** 4 : number +>++temp ** 4 : number +>++temp : number +>temp : any +>4 : number + +typeof -temp++ ** 4; +>typeof -temp++ ** 4 : string +>-temp++ ** 4 : number +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +typeof -temp-- ** 4; +>typeof -temp-- ** 4 : string +>-temp-- ** 4 : number +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +typeof --temp ** 3 ** 1; +>typeof --temp ** 3 ** 1 : string +>--temp ** 3 ** 1 : number +>--temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +typeof temp-- ** 3 ** 1; +>typeof temp-- ** 3 ** 1 : string +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +typeof 3 ** 4 ** 1; +>typeof 3 ** 4 ** 1 : string +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +typeof temp++ ** 4 ** 1; +>typeof temp++ ** 4 ** 1 : string +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +typeof temp-- ** 4 ** 1; +>typeof temp-- ** 4 ** 1 : string +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +typeof -3 ** 4 ** 1; +>typeof -3 ** 4 ** 1 : string +>-3 ** 4 ** 1 : number +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +typeof -++temp ** 4 ** 1; +>typeof -++temp ** 4 ** 1 : string +>-++temp ** 4 ** 1 : number +>++temp ** 4 ** 1 : number +>++temp : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +typeof -temp++ ** 4 ** 1; +>typeof -temp++ ** 4 ** 1 : string +>-temp++ ** 4 ** 1 : number +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +typeof -temp-- ** 4 ** 1; +>typeof -temp-- ** 4 ** 1 : string +>-temp-- ** 4 ** 1 : number +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +void --temp ** 3; +>void --temp ** 3 : undefined +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +void temp-- ** 3; +>void temp-- ** 3 : undefined +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +void 3 ** 4; +>void 3 ** 4 : undefined +>3 ** 4 : number +>3 : number +>4 : number + +void temp++ ** 4; +>void temp++ ** 4 : undefined +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +void temp-- ** 4; +>void temp-- ** 4 : undefined +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +void -3 ** 4; +>void -3 ** 4 : undefined +>-3 ** 4 : number +>3 ** 4 : number +>3 : number +>4 : number + +void -++temp ** 4; +>void -++temp ** 4 : undefined +>-++temp ** 4 : number +>++temp ** 4 : number +>++temp : number +>temp : any +>4 : number + +void -temp++ ** 4; +>void -temp++ ** 4 : undefined +>-temp++ ** 4 : number +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +void -temp-- ** 4; +>void -temp-- ** 4 : undefined +>-temp-- ** 4 : number +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +void --temp ** 3 ** 1; +>void --temp ** 3 ** 1 : undefined +>--temp ** 3 ** 1 : number +>--temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +void temp-- ** 3 ** 1; +>void temp-- ** 3 ** 1 : undefined +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +void 3 ** 4 ** 1; +>void 3 ** 4 ** 1 : undefined +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +void temp++ ** 4 ** 1; +>void temp++ ** 4 ** 1 : undefined +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +void temp-- ** 4 ** 1; +>void temp-- ** 4 ** 1 : undefined +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +void -3 ** 4 ** 1; +>void -3 ** 4 ** 1 : undefined +>-3 ** 4 ** 1 : number +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +void -++temp ** 4 ** 1; +>void -++temp ** 4 ** 1 : undefined +>-++temp ** 4 ** 1 : number +>++temp ** 4 ** 1 : number +>++temp : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +void -temp++ ** 4 ** 1; +>void -temp++ ** 4 ** 1 : undefined +>-temp++ ** 4 ** 1 : number +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +void -temp-- ** 4 ** 1; +>void -temp-- ** 4 ** 1 : undefined +>-temp-- ** 4 ** 1 : number +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +~ --temp ** 3; +>~ --temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +~ temp-- ** 3; +>~ temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +~ 3 ** 4; +>~ 3 ** 4 : number +>3 ** 4 : number +>3 : number +>4 : number + +~ temp++ ** 4; +>~ temp++ ** 4 : number +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +~ temp-- ** 4; +>~ temp-- ** 4 : number +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +~ -3 ** 4; +>~ -3 ** 4 : number +>-3 ** 4 : number +>3 ** 4 : number +>3 : number +>4 : number + +~ -++temp ** 4; +>~ -++temp ** 4 : number +>-++temp ** 4 : number +>++temp ** 4 : number +>++temp : number +>temp : any +>4 : number + +~ -temp++ ** 4; +>~ -temp++ ** 4 : number +>-temp++ ** 4 : number +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +~ -temp-- ** 4; +>~ -temp-- ** 4 : number +>-temp-- ** 4 : number +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +~ --temp ** 3 ** 1; +>~ --temp ** 3 ** 1 : number +>--temp ** 3 ** 1 : number +>--temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +~ temp-- ** 3 ** 1; +>~ temp-- ** 3 ** 1 : number +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +~ 3 ** 4 ** 1; +>~ 3 ** 4 ** 1 : number +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +~ temp++ ** 4 ** 1; +>~ temp++ ** 4 ** 1 : number +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +~ temp-- ** 4 ** 1; +>~ temp-- ** 4 ** 1 : number +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +~ -3 ** 4 ** 1; +>~ -3 ** 4 ** 1 : number +>-3 ** 4 ** 1 : number +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +~ -++temp ** 4 ** 1; +>~ -++temp ** 4 ** 1 : number +>-++temp ** 4 ** 1 : number +>++temp ** 4 ** 1 : number +>++temp : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +~ -temp++ ** 4 ** 1; +>~ -temp++ ** 4 ** 1 : number +>-temp++ ** 4 ** 1 : number +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +~ -temp-- ** 4 ** 1; +>~ -temp-- ** 4 ** 1 : number +>-temp-- ** 4 ** 1 : number +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +! --temp ** 3; +>! --temp ** 3 : boolean +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +! temp-- ** 3; +>! temp-- ** 3 : boolean +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +! 3 ** 4; +>! 3 ** 4 : boolean +>3 ** 4 : number +>3 : number +>4 : number + +! temp++ ** 4; +>! temp++ ** 4 : boolean +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +! temp-- ** 4; +>! temp-- ** 4 : boolean +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +! -3 ** 4; +>! -3 ** 4 : boolean +>-3 ** 4 : number +>3 ** 4 : number +>3 : number +>4 : number + +! -++temp ** 4; +>! -++temp ** 4 : boolean +>-++temp ** 4 : number +>++temp ** 4 : number +>++temp : number +>temp : any +>4 : number + +! -temp++ ** 4; +>! -temp++ ** 4 : boolean +>-temp++ ** 4 : number +>temp++ ** 4 : number +>temp++ : number +>temp : any +>4 : number + +! -temp-- ** 4; +>! -temp-- ** 4 : boolean +>-temp-- ** 4 : number +>temp-- ** 4 : number +>temp-- : number +>temp : any +>4 : number + +! --temp ** 3 ** 1; +>! --temp ** 3 ** 1 : boolean +>--temp ** 3 ** 1 : number +>--temp : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +! temp-- ** 3 ** 1; +>! temp-- ** 3 ** 1 : boolean +>temp-- ** 3 ** 1 : number +>temp-- : number +>temp : any +>3 ** 1 : number +>3 : number +>1 : number + +! 3 ** 4 ** 1; +>! 3 ** 4 ** 1 : boolean +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +! temp++ ** 4 ** 1; +>! temp++ ** 4 ** 1 : boolean +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +! temp-- ** 4 ** 1; +>! temp-- ** 4 ** 1 : boolean +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +! -3 ** 4 ** 1; +>! -3 ** 4 ** 1 : boolean +>-3 ** 4 ** 1 : number +>3 ** 4 ** 1 : number +>3 : number +>4 ** 1 : number +>4 : number +>1 : number + +! -++temp ** 4 ** 1; +>! -++temp ** 4 ** 1 : boolean +>-++temp ** 4 ** 1 : number +>++temp ** 4 ** 1 : number +>++temp : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +! -temp++ ** 4 ** 1; +>! -temp++ ** 4 ** 1 : boolean +>-temp++ ** 4 ** 1 : number +>temp++ ** 4 ** 1 : number +>temp++ : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + +! -temp-- ** 4 ** 1; +>! -temp-- ** 4 ** 1 : boolean +>-temp-- ** 4 ** 1 : number +>temp-- ** 4 ** 1 : number +>temp-- : number +>temp : any +>4 ** 1 : number +>4 : number +>1 : number + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js new file mode 100644 index 0000000000000..cea4b78963b64 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js @@ -0,0 +1,60 @@ +//// [emitExponentiationOperatorInTemplateString1.ts] +var t1 = 10; +var t2 = 10; +var s; +`Exp: ${t1 ** t2} abc`; +`Exp: ${t1 ** t2 ** t1} abc`; +`Exp: ${t1 + t2 ** t1} abc`; +`Exp: ${t1 - t2 ** t1} abc`; +`Exp: ${t1 ** t2 + t1} abc`; +`Exp: ${t1 ** t2 - t1} abc`; +`Exp: ${t1 + t2 ** t2 + t1} abc`; +`Exp: ${t1 - t2 ** t2 - t1} abc`; +`Exp: ${-t1 ** t2 - t1} abc`; +`Exp: ${+t1 ** t2 - t1} abc`; +`Exp: ${-++t1 ** t2 - t1} abc`; +`Exp: ${+--t1 ** t2 - t1} abc`; +`Exp: ${-t1++ ** t2 - t1} abc`; +`Exp: ${-t1-- ** t2 - t1} abc`; +`Exp: ${+t1++ ** t2 - t1} abc`; +`Exp: ${+t1-- ** t2 - t1} abc`; +`Exp: ${typeof t1 ** t2 ** t1} abc`; +`Exp: ${typeof t1 ** t2 + t1} abc`; +`Exp: ${typeof t1 ** (t2 - t1)} abc`; +`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; +`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; +`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; +`Exp: ${!t1 ** t2 ** t1} abc`; +`Exp: ${!t1 ** t2 ** ++t1} abc`; +`Exp: ${!t1 ** t2 ** --t1} abc`; + + +//// [emitExponentiationOperatorInTemplateString1.js] +var t1 = 10; +var t2 = 10; +var s; +"Exp: " + (Math.pow(t1, t2)) + " abc"; +"Exp: " + (Math.pow(t1, Math.pow(t2, t1))) + " abc"; +"Exp: " + (t1 + Math.pow(t2, t1)) + " abc"; +"Exp: " + (t1 - Math.pow(t2, t1)) + " abc"; +"Exp: " + (Math.pow(t1, t2) + t1) + " abc"; +"Exp: " + (Math.pow(t1, t2) - t1) + " abc"; +"Exp: " + (t1 + Math.pow(t2, t2) + t1) + " abc"; +"Exp: " + (t1 - Math.pow(t2, t2) - t1) + " abc"; +"Exp: " + (-Math.pow(t1, t2) - t1) + " abc"; +"Exp: " + (+Math.pow(t1, t2) - t1) + " abc"; +"Exp: " + (-Math.pow(++t1, t2) - t1) + " abc"; +"Exp: " + (+Math.pow(--t1, t2) - t1) + " abc"; +"Exp: " + (-Math.pow(t1++, t2) - t1) + " abc"; +"Exp: " + (-Math.pow(t1--, t2) - t1) + " abc"; +"Exp: " + (+Math.pow(t1++, t2) - t1) + " abc"; +"Exp: " + (+Math.pow(t1--, t2) - t1) + " abc"; +"Exp: " + typeof Math.pow(t1, Math.pow(t2, t1)) + " abc"; +"Exp: " + (typeof Math.pow(t1, t2) + t1) + " abc"; +"Exp: " + typeof Math.pow(t1, (t2 - t1)) + " abc"; +"Exp: " + (1 + typeof Math.pow(t1, Math.pow(t2, t1))) + " abc"; +"Exp: " + (2 + typeof Math.pow(t1, Math.pow(t2, ++t1))) + " abc"; +"Exp: " + (3 + typeof Math.pow(t1, Math.pow(t2, --t1))) + " abc"; +"Exp: " + !Math.pow(t1, Math.pow(t2, t1)) + " abc"; +"Exp: " + !Math.pow(t1, Math.pow(t2, ++t1)) + " abc"; +"Exp: " + !Math.pow(t1, Math.pow(t2, --t1)) + " abc"; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols new file mode 100644 index 0000000000000..5ef2abc439589 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols @@ -0,0 +1,136 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts === +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) + +`Exp: ${t1 ** t2} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`Exp: ${t1 ** t2 ** t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${t1 + t2 ** t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${t1 - t2 ** t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${t1 ** t2 + t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${t1 ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${t1 + t2 ** t2 + t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${t1 - t2 ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${-t1 ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${+t1 ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${-++t1 ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${+--t1 ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${-t1++ ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${-t1-- ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${+t1++ ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${+t1-- ** t2 - t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${typeof t1 ** t2 ** t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${typeof t1 ** t2 + t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${typeof t1 ** (t2 - t1)} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${!t1 ** t2 ** t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${!t1 ** t2 ** ++t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + +`Exp: ${!t1 ** t2 ** --t1} abc`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types new file mode 100644 index 0000000000000..b6324c4bd4c98 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types @@ -0,0 +1,248 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts === +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +`Exp: ${t1 ** t2} abc`; +>`Exp: ${t1 ** t2} abc` : string +>t1 ** t2 : number +>t1 : number +>t2 : number + +`Exp: ${t1 ** t2 ** t1} abc`; +>`Exp: ${t1 ** t2 ** t1} abc` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`Exp: ${t1 + t2 ** t1} abc`; +>`Exp: ${t1 + t2 ** t1} abc` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`Exp: ${t1 - t2 ** t1} abc`; +>`Exp: ${t1 - t2 ** t1} abc` : string +>t1 - t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`Exp: ${t1 ** t2 + t1} abc`; +>`Exp: ${t1 ** t2 + t1} abc` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${t1 ** t2 - t1} abc`; +>`Exp: ${t1 ** t2 - t1} abc` : string +>t1 ** t2 - t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${t1 + t2 ** t2 + t1} abc`; +>`Exp: ${t1 + t2 ** t2 + t1} abc` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`Exp: ${t1 - t2 ** t2 - t1} abc`; +>`Exp: ${t1 - t2 ** t2 - t1} abc` : string +>t1 - t2 ** t2 - t1 : number +>t1 - t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`Exp: ${-t1 ** t2 - t1} abc`; +>`Exp: ${-t1 ** t2 - t1} abc` : string +>-t1 ** t2 - t1 : number +>-t1 ** t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${+t1 ** t2 - t1} abc`; +>`Exp: ${+t1 ** t2 - t1} abc` : string +>+t1 ** t2 - t1 : number +>+t1 ** t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${-++t1 ** t2 - t1} abc`; +>`Exp: ${-++t1 ** t2 - t1} abc` : string +>-++t1 ** t2 - t1 : number +>-++t1 ** t2 : number +>++t1 ** t2 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${+--t1 ** t2 - t1} abc`; +>`Exp: ${+--t1 ** t2 - t1} abc` : string +>+--t1 ** t2 - t1 : number +>+--t1 ** t2 : number +>--t1 ** t2 : number +>--t1 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${-t1++ ** t2 - t1} abc`; +>`Exp: ${-t1++ ** t2 - t1} abc` : string +>-t1++ ** t2 - t1 : number +>-t1++ ** t2 : number +>t1++ ** t2 : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${-t1-- ** t2 - t1} abc`; +>`Exp: ${-t1-- ** t2 - t1} abc` : string +>-t1-- ** t2 - t1 : number +>-t1-- ** t2 : number +>t1-- ** t2 : number +>t1-- : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${+t1++ ** t2 - t1} abc`; +>`Exp: ${+t1++ ** t2 - t1} abc` : string +>+t1++ ** t2 - t1 : number +>+t1++ ** t2 : number +>t1++ ** t2 : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${+t1-- ** t2 - t1} abc`; +>`Exp: ${+t1-- ** t2 - t1} abc` : string +>+t1-- ** t2 - t1 : number +>+t1-- ** t2 : number +>t1-- ** t2 : number +>t1-- : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${typeof t1 ** t2 ** t1} abc`; +>`Exp: ${typeof t1 ** t2 ** t1} abc` : string +>typeof t1 ** t2 ** t1 : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`Exp: ${typeof t1 ** t2 + t1} abc`; +>`Exp: ${typeof t1 ** t2 + t1} abc` : string +>typeof t1 ** t2 + t1 : string +>typeof t1 ** t2 : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`Exp: ${typeof t1 ** (t2 - t1)} abc`; +>`Exp: ${typeof t1 ** (t2 - t1)} abc` : string +>typeof t1 ** (t2 - t1) : string +>t1 ** (t2 - t1) : number +>t1 : number +>(t2 - t1) : number +>t2 - t1 : number +>t2 : number +>t1 : number + +`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; +>`Exp: ${1 + typeof t1 ** t2 ** t1} abc` : string +>1 + typeof t1 ** t2 ** t1 : string +>1 : number +>typeof t1 ** t2 ** t1 : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; +>`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc` : string +>2 + typeof t1 ** t2 ** ++t1 : string +>2 : number +>typeof t1 ** t2 ** ++t1 : string +>t1 ** t2 ** ++t1 : number +>t1 : number +>t2 ** ++t1 : number +>t2 : number +>++t1 : number +>t1 : number + +`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; +>`Exp: ${3 + typeof t1 ** t2 ** --t1} abc` : string +>3 + typeof t1 ** t2 ** --t1 : string +>3 : number +>typeof t1 ** t2 ** --t1 : string +>t1 ** t2 ** --t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`Exp: ${!t1 ** t2 ** t1} abc`; +>`Exp: ${!t1 ** t2 ** t1} abc` : string +>!t1 ** t2 ** t1 : boolean +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`Exp: ${!t1 ** t2 ** ++t1} abc`; +>`Exp: ${!t1 ** t2 ** ++t1} abc` : string +>!t1 ** t2 ** ++t1 : boolean +>t1 ** t2 ** ++t1 : number +>t1 : number +>t2 ** ++t1 : number +>t2 : number +>++t1 : number +>t1 : number + +`Exp: ${!t1 ** t2 ** --t1} abc`; +>`Exp: ${!t1 ** t2 ** --t1} abc` : string +>!t1 ** t2 ** --t1 : boolean +>t1 ** t2 ** --t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + diff --git a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.js b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.js new file mode 100644 index 0000000000000..0072c54625334 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.js @@ -0,0 +1,26 @@ +//// [exponentiationOperatorWithAnyAndNumber.ts] +var a: any; +var b: number; + +// operator ** +var r1 = a ** a; +var r2 = a ** b; +var r3 = a ** 0; +var r4 = 0 ** a; +var r5 = 0 ** 0; +var r6 = b ** 0; +var r7 = 0 ** b; +var r8 = b ** b; + +//// [exponentiationOperatorWithAnyAndNumber.js] +var a; +var b; +// operator ** +var r1 = Math.pow(a, a); +var r2 = Math.pow(a, b); +var r3 = Math.pow(a, 0); +var r4 = Math.pow(0, a); +var r5 = Math.pow(0, 0); +var r6 = Math.pow(b, 0); +var r7 = Math.pow(0, b); +var r8 = Math.pow(b, b); diff --git a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.symbols b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.symbols new file mode 100644 index 0000000000000..997401a15c997 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithAnyAndNumber.ts === +var a: any; +>a : Symbol(a, Decl(exponentiationOperatorWithAnyAndNumber.ts, 0, 3)) + +var b: number; +>b : Symbol(b, Decl(exponentiationOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator ** +var r1 = a ** a; +>r1 : Symbol(r1, Decl(exponentiationOperatorWithAnyAndNumber.ts, 4, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithAnyAndNumber.ts, 0, 3)) + +var r2 = a ** b; +>r2 : Symbol(r2, Decl(exponentiationOperatorWithAnyAndNumber.ts, 5, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithAnyAndNumber.ts, 1, 3)) + +var r3 = a ** 0; +>r3 : Symbol(r3, Decl(exponentiationOperatorWithAnyAndNumber.ts, 6, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithAnyAndNumber.ts, 0, 3)) + +var r4 = 0 ** a; +>r4 : Symbol(r4, Decl(exponentiationOperatorWithAnyAndNumber.ts, 7, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithAnyAndNumber.ts, 0, 3)) + +var r5 = 0 ** 0; +>r5 : Symbol(r5, Decl(exponentiationOperatorWithAnyAndNumber.ts, 8, 3)) + +var r6 = b ** 0; +>r6 : Symbol(r6, Decl(exponentiationOperatorWithAnyAndNumber.ts, 9, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithAnyAndNumber.ts, 1, 3)) + +var r7 = 0 ** b; +>r7 : Symbol(r7, Decl(exponentiationOperatorWithAnyAndNumber.ts, 10, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithAnyAndNumber.ts, 1, 3)) + +var r8 = b ** b; +>r8 : Symbol(r8, Decl(exponentiationOperatorWithAnyAndNumber.ts, 11, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithAnyAndNumber.ts, 1, 3)) + diff --git a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types new file mode 100644 index 0000000000000..ec48b80f192f5 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types @@ -0,0 +1,56 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithAnyAndNumber.ts === +var a: any; +>a : any + +var b: number; +>b : number + +// operator ** +var r1 = a ** a; +>r1 : number +>a ** a : number +>a : any +>a : any + +var r2 = a ** b; +>r2 : number +>a ** b : number +>a : any +>b : number + +var r3 = a ** 0; +>r3 : number +>a ** 0 : number +>a : any +>0 : number + +var r4 = 0 ** a; +>r4 : number +>0 ** a : number +>0 : number +>a : any + +var r5 = 0 ** 0; +>r5 : number +>0 ** 0 : number +>0 : number +>0 : number + +var r6 = b ** 0; +>r6 : number +>b ** 0 : number +>b : number +>0 : number + +var r7 = 0 ** b; +>r7 : number +>0 ** b : number +>0 : number +>b : number + +var r8 = b ** b; +>r8 : number +>b ** b : number +>b : number +>b : number + diff --git a/tests/baselines/reference/exponentiationOperatorWithEnum.js b/tests/baselines/reference/exponentiationOperatorWithEnum.js new file mode 100644 index 0000000000000..8175ca30c9e2c --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithEnum.js @@ -0,0 +1,49 @@ +//// [exponentiationOperatorWithEnum.ts] +// operands of an enum type are treated as having the primitive type Number. + +enum E { + a, + b +} + +var a: any; +var b: number; +var c: E; + +// operator ** +var r1 = c ** a; +var r2 = c ** b; +var r3 = c ** c; +var r4 = a ** c; +var r5 = b ** c; +var r6 = E.a ** a; +var r7 = E.a ** b; +var r8 = E.a ** E.b; +var r9 = E.a ** 1; +var r10 = a ** E.b; +var r11 = b ** E.b; +var r12 = 1 ** E.b; + +//// [exponentiationOperatorWithEnum.js] +// operands of an enum type are treated as having the primitive type Number. +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var c; +// operator ** +var r1 = Math.pow(c, a); +var r2 = Math.pow(c, b); +var r3 = Math.pow(c, c); +var r4 = Math.pow(a, c); +var r5 = Math.pow(b, c); +var r6 = Math.pow(E.a, a); +var r7 = Math.pow(E.a, b); +var r8 = Math.pow(E.a, E.b); +var r9 = Math.pow(E.a, 1); +var r10 = Math.pow(a, E.b); +var r11 = Math.pow(b, E.b); +var r12 = Math.pow(1, E.b); diff --git a/tests/baselines/reference/exponentiationOperatorWithEnum.symbols b/tests/baselines/reference/exponentiationOperatorWithEnum.symbols new file mode 100644 index 0000000000000..9c8413dc44148 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithEnum.symbols @@ -0,0 +1,98 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnum.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) + + b +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) +} + +var a: any; +>a : Symbol(a, Decl(exponentiationOperatorWithEnum.ts, 7, 3)) + +var b: number; +>b : Symbol(b, Decl(exponentiationOperatorWithEnum.ts, 8, 3)) + +var c: E; +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) + +// operator ** +var r1 = c ** a; +>r1 : Symbol(r1, Decl(exponentiationOperatorWithEnum.ts, 12, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnum.ts, 7, 3)) + +var r2 = c ** b; +>r2 : Symbol(r2, Decl(exponentiationOperatorWithEnum.ts, 13, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnum.ts, 8, 3)) + +var r3 = c ** c; +>r3 : Symbol(r3, Decl(exponentiationOperatorWithEnum.ts, 14, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) + +var r4 = a ** c; +>r4 : Symbol(r4, Decl(exponentiationOperatorWithEnum.ts, 15, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) + +var r5 = b ** c; +>r5 : Symbol(r5, Decl(exponentiationOperatorWithEnum.ts, 16, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnum.ts, 9, 3)) + +var r6 = E.a ** a; +>r6 : Symbol(r6, Decl(exponentiationOperatorWithEnum.ts, 17, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnum.ts, 7, 3)) + +var r7 = E.a ** b; +>r7 : Symbol(r7, Decl(exponentiationOperatorWithEnum.ts, 18, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnum.ts, 8, 3)) + +var r8 = E.a ** E.b; +>r8 : Symbol(r8, Decl(exponentiationOperatorWithEnum.ts, 19, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) + +var r9 = E.a ** 1; +>r9 : Symbol(r9, Decl(exponentiationOperatorWithEnum.ts, 20, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnum.ts, 2, 8)) + +var r10 = a ** E.b; +>r10 : Symbol(r10, Decl(exponentiationOperatorWithEnum.ts, 21, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) + +var r11 = b ** E.b; +>r11 : Symbol(r11, Decl(exponentiationOperatorWithEnum.ts, 22, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) + +var r12 = 1 ** E.b; +>r12 : Symbol(r12, Decl(exponentiationOperatorWithEnum.ts, 23, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnum.ts, 3, 6)) + diff --git a/tests/baselines/reference/exponentiationOperatorWithEnum.types b/tests/baselines/reference/exponentiationOperatorWithEnum.types new file mode 100644 index 0000000000000..037ff9d126118 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithEnum.types @@ -0,0 +1,112 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnum.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : E + + a, +>a : E + + b +>b : E +} + +var a: any; +>a : any + +var b: number; +>b : number + +var c: E; +>c : E +>E : E + +// operator ** +var r1 = c ** a; +>r1 : number +>c ** a : number +>c : E +>a : any + +var r2 = c ** b; +>r2 : number +>c ** b : number +>c : E +>b : number + +var r3 = c ** c; +>r3 : number +>c ** c : number +>c : E +>c : E + +var r4 = a ** c; +>r4 : number +>a ** c : number +>a : any +>c : E + +var r5 = b ** c; +>r5 : number +>b ** c : number +>b : number +>c : E + +var r6 = E.a ** a; +>r6 : number +>E.a ** a : number +>E.a : E +>E : typeof E +>a : E +>a : any + +var r7 = E.a ** b; +>r7 : number +>E.a ** b : number +>E.a : E +>E : typeof E +>a : E +>b : number + +var r8 = E.a ** E.b; +>r8 : number +>E.a ** E.b : number +>E.a : E +>E : typeof E +>a : E +>E.b : E +>E : typeof E +>b : E + +var r9 = E.a ** 1; +>r9 : number +>E.a ** 1 : number +>E.a : E +>E : typeof E +>a : E +>1 : number + +var r10 = a ** E.b; +>r10 : number +>a ** E.b : number +>a : any +>E.b : E +>E : typeof E +>b : E + +var r11 = b ** E.b; +>r11 : number +>b ** E.b : number +>b : number +>E.b : E +>E : typeof E +>b : E + +var r12 = 1 ** E.b; +>r12 : number +>1 ** E.b : number +>1 : number +>E.b : E +>E : typeof E +>b : E + diff --git a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.js b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.js new file mode 100644 index 0000000000000..0493c9cdefd8a --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.js @@ -0,0 +1,58 @@ +//// [exponentiationOperatorWithEnumUnion.ts] +// operands of an enum type are treated as having the primitive type Number. + +enum E { + a, + b +} +enum F { + c, + d +} + +var a: any; +var b: number; +var c: E | F; + +// operator ** +var r1 = c ** a; +var r2 = c ** b; +var r3 = c ** c; +var r4 = a ** c; +var r5 = b ** c; +var r6 = E.a ** a; +var r7 = E.a ** b; +var r8 = E.a ** E.b; +var r9 = E.a ** 1; +var r10 = a ** E.b; +var r11 = b ** E.b; +var r12 = 1 ** E.b; + +//// [exponentiationOperatorWithEnumUnion.js] +// operands of an enum type are treated as having the primitive type Number. +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var F; +(function (F) { + F[F["c"] = 0] = "c"; + F[F["d"] = 1] = "d"; +})(F || (F = {})); +var a; +var b; +var c; +// operator ** +var r1 = Math.pow(c, a); +var r2 = Math.pow(c, b); +var r3 = Math.pow(c, c); +var r4 = Math.pow(a, c); +var r5 = Math.pow(b, c); +var r6 = Math.pow(E.a, a); +var r7 = Math.pow(E.a, b); +var r8 = Math.pow(E.a, E.b); +var r9 = Math.pow(E.a, 1); +var r10 = Math.pow(a, E.b); +var r11 = Math.pow(b, E.b); +var r12 = Math.pow(1, E.b); diff --git a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.symbols b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.symbols new file mode 100644 index 0000000000000..f46a32d8c9742 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.symbols @@ -0,0 +1,108 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnumUnion.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) + + b +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) +} +enum F { +>F : Symbol(F, Decl(exponentiationOperatorWithEnumUnion.ts, 5, 1)) + + c, +>c : Symbol(F.c, Decl(exponentiationOperatorWithEnumUnion.ts, 6, 8)) + + d +>d : Symbol(F.d, Decl(exponentiationOperatorWithEnumUnion.ts, 7, 6)) +} + +var a: any; +>a : Symbol(a, Decl(exponentiationOperatorWithEnumUnion.ts, 11, 3)) + +var b: number; +>b : Symbol(b, Decl(exponentiationOperatorWithEnumUnion.ts, 12, 3)) + +var c: E | F; +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>F : Symbol(F, Decl(exponentiationOperatorWithEnumUnion.ts, 5, 1)) + +// operator ** +var r1 = c ** a; +>r1 : Symbol(r1, Decl(exponentiationOperatorWithEnumUnion.ts, 16, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnumUnion.ts, 11, 3)) + +var r2 = c ** b; +>r2 : Symbol(r2, Decl(exponentiationOperatorWithEnumUnion.ts, 17, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnumUnion.ts, 12, 3)) + +var r3 = c ** c; +>r3 : Symbol(r3, Decl(exponentiationOperatorWithEnumUnion.ts, 18, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) + +var r4 = a ** c; +>r4 : Symbol(r4, Decl(exponentiationOperatorWithEnumUnion.ts, 19, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) + +var r5 = b ** c; +>r5 : Symbol(r5, Decl(exponentiationOperatorWithEnumUnion.ts, 20, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(exponentiationOperatorWithEnumUnion.ts, 13, 3)) + +var r6 = E.a ** a; +>r6 : Symbol(r6, Decl(exponentiationOperatorWithEnumUnion.ts, 21, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnumUnion.ts, 11, 3)) + +var r7 = E.a ** b; +>r7 : Symbol(r7, Decl(exponentiationOperatorWithEnumUnion.ts, 22, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnumUnion.ts, 12, 3)) + +var r8 = E.a ** E.b; +>r8 : Symbol(r8, Decl(exponentiationOperatorWithEnumUnion.ts, 23, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) + +var r9 = E.a ** 1; +>r9 : Symbol(r9, Decl(exponentiationOperatorWithEnumUnion.ts, 24, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithEnumUnion.ts, 2, 8)) + +var r10 = a ** E.b; +>r10 : Symbol(r10, Decl(exponentiationOperatorWithEnumUnion.ts, 25, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) + +var r11 = b ** E.b; +>r11 : Symbol(r11, Decl(exponentiationOperatorWithEnumUnion.ts, 26, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) + +var r12 = 1 ** E.b; +>r12 : Symbol(r12, Decl(exponentiationOperatorWithEnumUnion.ts, 27, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithEnumUnion.ts, 3, 6)) + diff --git a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types new file mode 100644 index 0000000000000..5be479b9e6373 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types @@ -0,0 +1,122 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithEnumUnion.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : E + + a, +>a : E + + b +>b : E +} +enum F { +>F : F + + c, +>c : F + + d +>d : F +} + +var a: any; +>a : any + +var b: number; +>b : number + +var c: E | F; +>c : E | F +>E : E +>F : F + +// operator ** +var r1 = c ** a; +>r1 : number +>c ** a : number +>c : E | F +>a : any + +var r2 = c ** b; +>r2 : number +>c ** b : number +>c : E | F +>b : number + +var r3 = c ** c; +>r3 : number +>c ** c : number +>c : E | F +>c : E | F + +var r4 = a ** c; +>r4 : number +>a ** c : number +>a : any +>c : E | F + +var r5 = b ** c; +>r5 : number +>b ** c : number +>b : number +>c : E | F + +var r6 = E.a ** a; +>r6 : number +>E.a ** a : number +>E.a : E +>E : typeof E +>a : E +>a : any + +var r7 = E.a ** b; +>r7 : number +>E.a ** b : number +>E.a : E +>E : typeof E +>a : E +>b : number + +var r8 = E.a ** E.b; +>r8 : number +>E.a ** E.b : number +>E.a : E +>E : typeof E +>a : E +>E.b : E +>E : typeof E +>b : E + +var r9 = E.a ** 1; +>r9 : number +>E.a ** 1 : number +>E.a : E +>E : typeof E +>a : E +>1 : number + +var r10 = a ** E.b; +>r10 : number +>a ** E.b : number +>a : any +>E.b : E +>E : typeof E +>b : E + +var r11 = b ** E.b; +>r11 : number +>b ** E.b : number +>b : number +>E.b : E +>E : typeof E +>b : E + +var r12 = 1 ** E.b; +>r12 : number +>1 ** E.b : number +>1 : number +>E.b : E +>E : typeof E +>b : E + diff --git a/tests/baselines/reference/exponentiationOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/exponentiationOperatorWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..b62cd9601e48d --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithInvalidOperands.errors.txt @@ -0,0 +1,239 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(15,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(17,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(18,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(19,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(21,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(22,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(22,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(23,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(24,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(24,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(25,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(25,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(26,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(26,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(29,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(31,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(32,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(33,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(35,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(36,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(36,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(37,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(38,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(38,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(39,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(39,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(40,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(40,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(42,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(43,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(43,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(44,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(45,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(45,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(46,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(46,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(47,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(47,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(49,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(50,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(50,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(51,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(52,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(52,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(53,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(53,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(54,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(54,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(57,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(59,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(60,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(61,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(64,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(66,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(67,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts(68,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidOperands.ts (56 errors) ==== + // these operators require their operands to be of type Any, the Number primitive type, or + // an enum type + enum E { a, b, c } + + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: { a: number }; + var f: Number; + + // All of the below should be an error unless otherwise noted + // operator ** + var r1a1 = a ** a; //ok + var r1a2 = a ** b; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = a ** c; //ok + var r1a4 = a ** d; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a5 = a ** e; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a6 = a ** f; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = b ** a; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b ** b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = b ** c; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b4 = b ** d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b5 = b ** e; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b6 = b ** f; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = c ** a; //ok + var r1c2 = c ** b; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = c ** c; //ok + var r1c4 = c ** d; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c5 = c ** e; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c6 = c ** f; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = d ** a; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = d ** b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = d ** c; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d4 = d ** d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d5 = d ** e; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d6 = d ** f; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1e1 = e ** a; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e2 = e ** b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e3 = e ** c; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e4 = e ** d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e5 = e ** e; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e6 = e ** f; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1f1 = f ** a; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f2 = f ** b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f3 = f ** c; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f4 = f ** d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f5 = f ** e; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f6 = f ** f; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1g1 = E.a ** a; //ok + var r1g2 = E.a ** b; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1g3 = E.a ** c; //ok + var r1g4 = E.a ** d; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1g5 = E.a ** e; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1g6 = E.a ** f; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1h1 = a ** E.b; //ok + var r1h2 = b ** E.b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1h3 = c ** E.b; //ok + var r1h4 = d ** E.b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1h5 = e ** E.b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1h6 = f ** E.b + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithInvalidOperands.js b/tests/baselines/reference/exponentiationOperatorWithInvalidOperands.js new file mode 100644 index 0000000000000..e7fb22ca6f1bf --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithInvalidOperands.js @@ -0,0 +1,135 @@ +//// [exponentiationOperatorWithInvalidOperands.ts] +// these operators require their operands to be of type Any, the Number primitive type, or +// an enum type +enum E { a, b, c } + +var a: any; +var b: boolean; +var c: number; +var d: string; +var e: { a: number }; +var f: Number; + +// All of the below should be an error unless otherwise noted +// operator ** +var r1a1 = a ** a; //ok +var r1a2 = a ** b; +var r1a3 = a ** c; //ok +var r1a4 = a ** d; +var r1a5 = a ** e; +var r1a6 = a ** f; + +var r1b1 = b ** a; +var r1b2 = b ** b; +var r1b3 = b ** c; +var r1b4 = b ** d; +var r1b5 = b ** e; +var r1b6 = b ** f; + +var r1c1 = c ** a; //ok +var r1c2 = c ** b; +var r1c3 = c ** c; //ok +var r1c4 = c ** d; +var r1c5 = c ** e; +var r1c6 = c ** f; + +var r1d1 = d ** a; +var r1d2 = d ** b; +var r1d3 = d ** c; +var r1d4 = d ** d; +var r1d5 = d ** e; +var r1d6 = d ** f; + +var r1e1 = e ** a; +var r1e2 = e ** b; +var r1e3 = e ** c; +var r1e4 = e ** d; +var r1e5 = e ** e; +var r1e6 = e ** f; + +var r1f1 = f ** a; +var r1f2 = f ** b; +var r1f3 = f ** c; +var r1f4 = f ** d; +var r1f5 = f ** e; +var r1f6 = f ** f; + +var r1g1 = E.a ** a; //ok +var r1g2 = E.a ** b; +var r1g3 = E.a ** c; //ok +var r1g4 = E.a ** d; +var r1g5 = E.a ** e; +var r1g6 = E.a ** f; + +var r1h1 = a ** E.b; //ok +var r1h2 = b ** E.b; +var r1h3 = c ** E.b; //ok +var r1h4 = d ** E.b; +var r1h5 = e ** E.b; +var r1h6 = f ** E.b + +//// [exponentiationOperatorWithInvalidOperands.js] +// these operators require their operands to be of type Any, the Number primitive type, or +// an enum type +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var e; +var f; +// All of the below should be an error unless otherwise noted +// operator ** +var r1a1 = Math.pow(a, a); //ok +var r1a2 = Math.pow(a, b); +var r1a3 = Math.pow(a, c); //ok +var r1a4 = Math.pow(a, d); +var r1a5 = Math.pow(a, e); +var r1a6 = Math.pow(a, f); +var r1b1 = Math.pow(b, a); +var r1b2 = Math.pow(b, b); +var r1b3 = Math.pow(b, c); +var r1b4 = Math.pow(b, d); +var r1b5 = Math.pow(b, e); +var r1b6 = Math.pow(b, f); +var r1c1 = Math.pow(c, a); //ok +var r1c2 = Math.pow(c, b); +var r1c3 = Math.pow(c, c); //ok +var r1c4 = Math.pow(c, d); +var r1c5 = Math.pow(c, e); +var r1c6 = Math.pow(c, f); +var r1d1 = Math.pow(d, a); +var r1d2 = Math.pow(d, b); +var r1d3 = Math.pow(d, c); +var r1d4 = Math.pow(d, d); +var r1d5 = Math.pow(d, e); +var r1d6 = Math.pow(d, f); +var r1e1 = Math.pow(e, a); +var r1e2 = Math.pow(e, b); +var r1e3 = Math.pow(e, c); +var r1e4 = Math.pow(e, d); +var r1e5 = Math.pow(e, e); +var r1e6 = Math.pow(e, f); +var r1f1 = Math.pow(f, a); +var r1f2 = Math.pow(f, b); +var r1f3 = Math.pow(f, c); +var r1f4 = Math.pow(f, d); +var r1f5 = Math.pow(f, e); +var r1f6 = Math.pow(f, f); +var r1g1 = Math.pow(E.a, a); //ok +var r1g2 = Math.pow(E.a, b); +var r1g3 = Math.pow(E.a, c); //ok +var r1g4 = Math.pow(E.a, d); +var r1g5 = Math.pow(E.a, e); +var r1g6 = Math.pow(E.a, f); +var r1h1 = Math.pow(a, E.b); //ok +var r1h2 = Math.pow(b, E.b); +var r1h3 = Math.pow(c, E.b); //ok +var r1h4 = Math.pow(d, E.b); +var r1h5 = Math.pow(e, E.b); +var r1h6 = Math.pow(f, E.b); diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.errors.txt b/tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.errors.txt new file mode 100644 index 0000000000000..99535985628cd --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.errors.txt @@ -0,0 +1,98 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(9,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(9,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(10,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(10,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(11,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(11,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(13,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(13,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(14,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(14,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(15,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(15,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(17,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(17,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(18,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(18,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(19,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(19,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(21,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(21,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(22,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(22,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(23,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts(23,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndInvalidOperands.ts (24 errors) ==== + // If one operand is the null or undefined value, it is treated as having the type of the + // other operand. + + var a: boolean; + var b: string; + var c: Object; + + // operator ** + var r1a1 = null ** a; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a2 = null ** b; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = null ** c; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = a ** null; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b ** null; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = c ** null; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = null ** true; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c2 = null ** ''; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = null ** {}; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = true ** null; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = '' ** null; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = {} ** null; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.js b/tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.js new file mode 100644 index 0000000000000..8af703fd0326b --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndInvalidOperands.js @@ -0,0 +1,44 @@ +//// [exponentiationOperatorWithNullValueAndInvalidOperands.ts] +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +var a: boolean; +var b: string; +var c: Object; + +// operator ** +var r1a1 = null ** a; +var r1a2 = null ** b; +var r1a3 = null ** c; + +var r1b1 = a ** null; +var r1b2 = b ** null; +var r1b3 = c ** null; + +var r1c1 = null ** true; +var r1c2 = null ** ''; +var r1c3 = null ** {}; + +var r1d1 = true ** null; +var r1d2 = '' ** null; +var r1d3 = {} ** null; + +//// [exponentiationOperatorWithNullValueAndInvalidOperands.js] +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. +var a; +var b; +var c; +// operator ** +var r1a1 = Math.pow(null, a); +var r1a2 = Math.pow(null, b); +var r1a3 = Math.pow(null, c); +var r1b1 = Math.pow(a, null); +var r1b2 = Math.pow(b, null); +var r1b3 = Math.pow(c, null); +var r1c1 = Math.pow(null, true); +var r1c2 = Math.pow(null, ''); +var r1c3 = Math.pow(null, {}); +var r1d1 = Math.pow(true, null); +var r1d2 = Math.pow('', null); +var r1d3 = Math.pow({}, null); diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.js b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.js new file mode 100644 index 0000000000000..a7fe81296e0a5 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.js @@ -0,0 +1,41 @@ +//// [exponentiationOperatorWithNullValueAndValidOperands.ts] +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { + a, + b +} + +var a: any; +var b: number; + +// operator ** +var r1 = null ** a; +var r2 = null ** b; +var r3 = null ** 1; +var r4 = null ** E.a; +var r5 = a ** null; +var r6 = b ** null; +var r7 = 0 ** null; +var r8 = E.b ** null; + +//// [exponentiationOperatorWithNullValueAndValidOperands.js] +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +// operator ** +var r1 = Math.pow(null, a); +var r2 = Math.pow(null, b); +var r3 = Math.pow(null, 1); +var r4 = Math.pow(null, E.a); +var r5 = Math.pow(a, null); +var r6 = Math.pow(b, null); +var r7 = Math.pow(0, null); +var r8 = Math.pow(E.b, null); diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.symbols b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.symbols new file mode 100644 index 0000000000000..cc1ead64f676f --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.symbols @@ -0,0 +1,55 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndValidOperands.ts === +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : Symbol(E, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 3, 8)) + + b +>b : Symbol(E.b, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 4, 6)) +} + +var a: any; +>a : Symbol(a, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var b: number; +>b : Symbol(b, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +// operator ** +var r1 = null ** a; +>r1 : Symbol(r1, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 12, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var r2 = null ** b; +>r2 : Symbol(r2, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 13, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var r3 = null ** 1; +>r3 : Symbol(r3, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 14, 3)) + +var r4 = null ** E.a; +>r4 : Symbol(r4, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 15, 3)) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var r5 = a ** null; +>r5 : Symbol(r5, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 16, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var r6 = b ** null; +>r6 : Symbol(r6, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 17, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var r7 = 0 ** null; +>r7 : Symbol(r7, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 18, 3)) + +var r8 = E.b ** null; +>r8 : Symbol(r8, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 19, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithNullValueAndValidOperands.ts, 4, 6)) + diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types new file mode 100644 index 0000000000000..2a3c48077636d --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types @@ -0,0 +1,73 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNullValueAndValidOperands.ts === +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : E + + a, +>a : E + + b +>b : E +} + +var a: any; +>a : any + +var b: number; +>b : number + +// operator ** +var r1 = null ** a; +>r1 : number +>null ** a : number +>null : null +>a : any + +var r2 = null ** b; +>r2 : number +>null ** b : number +>null : null +>b : number + +var r3 = null ** 1; +>r3 : number +>null ** 1 : number +>null : null +>1 : number + +var r4 = null ** E.a; +>r4 : number +>null ** E.a : number +>null : null +>E.a : E +>E : typeof E +>a : E + +var r5 = a ** null; +>r5 : number +>a ** null : number +>a : any +>null : null + +var r6 = b ** null; +>r6 : number +>b ** null : number +>b : number +>null : null + +var r7 = 0 ** null; +>r7 : number +>0 ** null : number +>0 : number +>null : null + +var r8 = E.b ** null; +>r8 : number +>E.b ** null : number +>E.b : E +>E : typeof E +>b : E +>null : null + diff --git a/tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.errors.txt new file mode 100644 index 0000000000000..86f4930e77c17 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(2,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(3,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(4,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts(5,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts (8 errors) ==== + // operator ** + var r1 = null ** null; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2 = null ** undefined; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3 = undefined ** null; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4 = undefined ** undefined; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.js b/tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.js new file mode 100644 index 0000000000000..86b775cd82b66 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.js @@ -0,0 +1,14 @@ +//// [exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts] +// operator ** +var r1 = null ** null; +var r2 = null ** undefined; +var r3 = undefined ** null; +var r4 = undefined ** undefined; + + +//// [exponentiationOperatorWithOnlyNullValueOrUndefinedValue.js] +// operator ** +var r1 = Math.pow(null, null); +var r2 = Math.pow(null, undefined); +var r3 = Math.pow(undefined, null); +var r4 = Math.pow(undefined, undefined); diff --git a/tests/baselines/reference/exponentiationOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/exponentiationOperatorWithTypeParameter.errors.txt new file mode 100644 index 0000000000000..46fd0832468bb --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithTypeParameter.errors.txt @@ -0,0 +1,77 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(9,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(10,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(11,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(11,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(12,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(12,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(13,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(14,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(15,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(15,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(16,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(16,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(17,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(17,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(18,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(18,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(19,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts(19,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTypeParameter.ts (18 errors) ==== + // type parameter type is not valid for arithmetic operand + function foo(t: T) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: {}; + + var r1a1 = a ** t; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a1 = t ** a; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b1 = b ** t; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b1 = t ** b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c1 = c ** t; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c1 = t ** c; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d1 = d ** t; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d1 = t ** d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e1 = e ** t; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e1 = t ** d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f1 = t ** t; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + } \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithTypeParameter.js b/tests/baselines/reference/exponentiationOperatorWithTypeParameter.js new file mode 100644 index 0000000000000..45eb12ac331e9 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithTypeParameter.js @@ -0,0 +1,42 @@ +//// [exponentiationOperatorWithTypeParameter.ts] +// type parameter type is not valid for arithmetic operand +function foo(t: T) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: {}; + + var r1a1 = a ** t; + var r2a1 = t ** a; + var r1b1 = b ** t; + var r2b1 = t ** b; + var r1c1 = c ** t; + var r2c1 = t ** c; + var r1d1 = d ** t; + var r2d1 = t ** d; + var r1e1 = e ** t; + var r2e1 = t ** d; + var r1f1 = t ** t; +} + +//// [exponentiationOperatorWithTypeParameter.js] +// type parameter type is not valid for arithmetic operand +function foo(t) { + var a; + var b; + var c; + var d; + var e; + var r1a1 = Math.pow(a, t); + var r2a1 = Math.pow(t, a); + var r1b1 = Math.pow(b, t); + var r2b1 = Math.pow(t, b); + var r1c1 = Math.pow(c, t); + var r2c1 = Math.pow(t, c); + var r1d1 = Math.pow(d, t); + var r2d1 = Math.pow(t, d); + var r1e1 = Math.pow(e, t); + var r2e1 = Math.pow(t, d); + var r1f1 = Math.pow(t, t); +} diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.errors.txt new file mode 100644 index 0000000000000..f456e0f554fb3 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -0,0 +1,98 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(9,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(9,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(10,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(10,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(11,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(11,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(13,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(13,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(14,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(14,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(15,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(15,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(17,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(17,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(18,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(18,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(19,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(19,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(21,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(21,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(22,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(22,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(23,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts(23,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts (24 errors) ==== + // If one operand is the undefined or undefined value, it is treated as having the type of the + // other operand. + + var a: boolean; + var b: string; + var c: Object; + + // operator ** + var r1a1 = undefined ** a; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a2 = undefined ** b; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = undefined ** c; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = a ** undefined; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b ** undefined; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = c ** undefined; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = undefined ** true; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c2 = undefined ** ''; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = undefined ** {}; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = true ** undefined; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = '' ** undefined; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = {} ** undefined; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.js b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.js new file mode 100644 index 0000000000000..89a7c6910b56b --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndInvalidOperands.js @@ -0,0 +1,44 @@ +//// [exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts] +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +var a: boolean; +var b: string; +var c: Object; + +// operator ** +var r1a1 = undefined ** a; +var r1a2 = undefined ** b; +var r1a3 = undefined ** c; + +var r1b1 = a ** undefined; +var r1b2 = b ** undefined; +var r1b3 = c ** undefined; + +var r1c1 = undefined ** true; +var r1c2 = undefined ** ''; +var r1c3 = undefined ** {}; + +var r1d1 = true ** undefined; +var r1d2 = '' ** undefined; +var r1d3 = {} ** undefined; + +//// [exponentiationOperatorWithUndefinedValueAndInvalidOperands.js] +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. +var a; +var b; +var c; +// operator ** +var r1a1 = Math.pow(undefined, a); +var r1a2 = Math.pow(undefined, b); +var r1a3 = Math.pow(undefined, c); +var r1b1 = Math.pow(a, undefined); +var r1b2 = Math.pow(b, undefined); +var r1b3 = Math.pow(c, undefined); +var r1c1 = Math.pow(undefined, true); +var r1c2 = Math.pow(undefined, ''); +var r1c3 = Math.pow(undefined, {}); +var r1d1 = Math.pow(true, undefined); +var r1d2 = Math.pow('', undefined); +var r1d3 = Math.pow({}, undefined); diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.js b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.js new file mode 100644 index 0000000000000..0f9d04faaa290 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.js @@ -0,0 +1,41 @@ +//// [exponentiationOperatorWithUndefinedValueAndValidOperands.ts] +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { + a, + b +} + +var a: any; +var b: number; + +// operator * +var rk1 = undefined ** a; +var rk2 = undefined ** b; +var rk3 = undefined ** 1; +var rk4 = undefined ** E.a; +var rk5 = a ** undefined; +var rk6 = b ** undefined; +var rk7 = 0 ** undefined; +var rk8 = E.b ** undefined; + +//// [exponentiationOperatorWithUndefinedValueAndValidOperands.js] +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +// operator * +var rk1 = Math.pow(undefined, a); +var rk2 = Math.pow(undefined, b); +var rk3 = Math.pow(undefined, 1); +var rk4 = Math.pow(undefined, E.a); +var rk5 = Math.pow(a, undefined); +var rk6 = Math.pow(b, undefined); +var rk7 = Math.pow(0, undefined); +var rk8 = Math.pow(E.b, undefined); diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.symbols b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.symbols new file mode 100644 index 0000000000000..e15ccecf70ecd --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.symbols @@ -0,0 +1,63 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts === +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : Symbol(E, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + + b +>b : Symbol(E.b, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +} + +var a: any; +>a : Symbol(a, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var b: number; +>b : Symbol(b, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +// operator * +var rk1 = undefined ** a; +>rk1 : Symbol(rk1, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 12, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rk2 = undefined ** b; +>rk2 : Symbol(rk2, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 13, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rk3 = undefined ** 1; +>rk3 : Symbol(rk3, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 14, 3)) +>undefined : Symbol(undefined) + +var rk4 = undefined ** E.a; +>rk4 : Symbol(rk4, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 15, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rk5 = a ** undefined; +>rk5 : Symbol(rk5, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 16, 3)) +>a : Symbol(a, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rk6 = b ** undefined; +>rk6 : Symbol(rk6, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 17, 3)) +>b : Symbol(b, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rk7 = 0 ** undefined; +>rk7 : Symbol(rk7, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 18, 3)) +>undefined : Symbol(undefined) + +var rk8 = E.b ** undefined; +>rk8 : Symbol(rk8, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 19, 3)) +>E.b : Symbol(E.b, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(exponentiationOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types new file mode 100644 index 0000000000000..4e44144511e35 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types @@ -0,0 +1,73 @@ +=== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithUndefinedValueAndValidOperands.ts === +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : E + + a, +>a : E + + b +>b : E +} + +var a: any; +>a : any + +var b: number; +>b : number + +// operator * +var rk1 = undefined ** a; +>rk1 : number +>undefined ** a : number +>undefined : undefined +>a : any + +var rk2 = undefined ** b; +>rk2 : number +>undefined ** b : number +>undefined : undefined +>b : number + +var rk3 = undefined ** 1; +>rk3 : number +>undefined ** 1 : number +>undefined : undefined +>1 : number + +var rk4 = undefined ** E.a; +>rk4 : number +>undefined ** E.a : number +>undefined : undefined +>E.a : E +>E : typeof E +>a : E + +var rk5 = a ** undefined; +>rk5 : number +>a ** undefined : number +>a : any +>undefined : undefined + +var rk6 = b ** undefined; +>rk6 : number +>b ** undefined : number +>b : number +>undefined : undefined + +var rk7 = 0 ** undefined; +>rk7 : number +>0 ** undefined : number +>0 : number +>undefined : undefined + +var rk8 = E.b ** undefined; +>rk8 : number +>E.b ** undefined : number +>E.b : E +>E : typeof E +>b : E +>undefined : undefined + From a3f5666a803176fa575a7f27f6045188ffd6ec95 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 21 Sep 2015 16:47:23 -0700 Subject: [PATCH 09/39] remove unnecessary union --- src/compiler/types.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b8002903586ae..32e4afed5b5d5 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -704,8 +704,6 @@ namespace ts { contextualType?: Type; // Used to temporarily assign a contextual type during overload resolution } - export type UnaryOrBinaryExpression = UnaryExpression | BinaryExpression; - export interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -714,7 +712,7 @@ namespace ts { export interface PrefixUnaryExpression extends UnaryExpression { operator: SyntaxKind; - operand: UnaryOrBinaryExpression; + operand: UnaryExpression | BinaryExpression; } export interface PostfixUnaryExpression extends PostfixExpression { @@ -739,19 +737,19 @@ namespace ts { } export interface DeleteExpression extends UnaryExpression { - expression: UnaryOrBinaryExpression; + expression: UnaryExpression | BinaryExpression; } export interface TypeOfExpression extends UnaryExpression { - expression: UnaryOrBinaryExpression; + expression: UnaryExpression | BinaryExpression; } export interface VoidExpression extends UnaryExpression { - expression: UnaryOrBinaryExpression; + expression: UnaryExpression | BinaryExpression; } export interface AwaitExpression extends UnaryExpression { - expression: UnaryOrBinaryExpression; + expression: UnaryExpression | BinaryExpression; } export interface YieldExpression extends Expression { @@ -858,7 +856,7 @@ namespace ts { export interface TypeAssertion extends UnaryExpression { type: TypeNode; - expression: UnaryOrBinaryExpression; + expression: UnaryExpression | BinaryExpression; } export type AssertionExpression = TypeAssertion | AsExpression; From df18dfcaaed959ea39e0d25233f8d0d138fb5370 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 25 Sep 2015 14:38:08 -0700 Subject: [PATCH 10/39] Address PR --- src/compiler/parser.ts | 31 ++++++++++++++++++++++++++----- src/compiler/types.ts | 13 ++++++++----- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 236a07d224840..aaf460f33cced 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3015,11 +3015,31 @@ namespace ts { let newPrecedence = getBinaryOperatorPrecedence(); // Check the precedence to see if we should "take" this operator - if (token === SyntaxKind.AsteriskAsteriskToken && newPrecedence < precedence) { - // ** operator is right-assocative - break; - } - else if (token !== SyntaxKind.AsteriskAsteriskToken && newPrecedence <= precedence) { + // - For left associative operator (all operator but **), only consume the operator + // , recursively call the function below and parse binaryExpression as a rightOperand + // of the caller if the new precendence of the operator is greater then or equal to the current precendence. + // For example: + // a - b - c; + // ^token; leftOperand = b. Return b to the caller as a rightOperand + // a * b - c + // ^token; leftOperand = b. Return b to the caller as a rightOperand + // a - b * c; + // ^token; leftOperand = b. Return b * c to the caller as a rightOperand + // - For right associative operator (**), only consume the operator, recursively call the function + // and parse binaryExpression as a rightOperand of the caller if the new precendence of + // the operator is strictly grater than the current precendence + // For example: + // a ** b ** c; + // ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand + // a - b ** c; + // ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand + // a ** b - c + // ^token; leftOperand = b. Return b to the caller as a rightOperand + const consumeCurrentOperator = token === SyntaxKind.AsteriskAsteriskToken ? + newPrecedence >= precedence : + newPrecedence > precedence; + + if (!consumeCurrentOperator) { break; } @@ -3226,6 +3246,7 @@ namespace ts { * 3) LeftHandSideExpression[?yield] [[no LineTerminator here]]-- * 4) ++LeftHandSideExpression[?yield] * 5) --LeftHandSideExpression[?yield] + * In TypeScript (2), (3) are parsed as PostfixUnaryExpression. (4), (5) are parsed as PrefixUnaryExpression */ function parseIncrementExpression(): IncrementExpression { if (token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 32e4afed5b5d5..e885aa2b7f415 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -707,15 +707,18 @@ namespace ts { export interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } + + export interface IncrementExpression extends UnaryExpression { + _incrementExpressionBrand: any; + } + //export type IncrementExpression = PrefixUnaryExpression | PostfixUnaryExpression | LeftHandSideExpression; - export interface IncrementExpression extends UnaryExpression { } - - export interface PrefixUnaryExpression extends UnaryExpression { + export interface PrefixUnaryExpression extends IncrementExpression { operator: SyntaxKind; operand: UnaryExpression | BinaryExpression; } - export interface PostfixUnaryExpression extends PostfixExpression { + export interface PostfixUnaryExpression extends IncrementExpression { operand: LeftHandSideExpression; operator: SyntaxKind; } @@ -724,7 +727,7 @@ namespace ts { _postfixExpressionBrand: any; } - export interface LeftHandSideExpression extends PostfixExpression { + export interface LeftHandSideExpression extends IncrementExpression { _leftHandSideExpressionBrand: any; } From 5f7914ca623683889ca45f129a48f8adc51e3fff Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 2 Oct 2015 18:50:45 -0700 Subject: [PATCH 11/39] Downlevel emit --- src/compiler/emitter.ts | 146 ++++++++++++++++++++++++++------------ src/compiler/utilities.ts | 14 +++- 2 files changed, 113 insertions(+), 47 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 541488bd82bc1..db3cef27aa398 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -836,6 +836,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } let node = nodes[start + i]; + let leadcomment = getLeadingCommentsToEmit(node); + let trailcomment = getTrailingCommentRanges(currentSourceFile.text, node.pos); // This emitting is to make sure we emit following comment properly // ...(x, /*comment1*/ y)... // ^ => node.pos @@ -2505,6 +2507,70 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } + /** + * Emit exponentiation operator down-level using Math.pow + * @param node {BinaryExpression} a binary expression node containing exponentiationOperator (**, **=) + */ + function emitExponentiationOperator(node: BinaryExpression) { + let leftHandSideExpression = node.left; + if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { + let synthesizedLHS: ElementAccessExpression | PropertyAccessExpression; + // TODO (yuisu) : comment + let shouldEmitParenthesis = node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BinaryExpression; + + if (isElementAccessExpression(leftHandSideExpression)) { + if (shouldEmitParenthesis) { + write("("); + } + synthesizedLHS = createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false); + let tempExpression = createAndRecordTempVariable(TempFlags.Auto); + emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); + synthesizedLHS.expression = tempExpression + + if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral && + leftHandSideExpression.argumentExpression.kind !== SyntaxKind.StringLiteral) { + let tempArgumentExpression = createAndRecordTempVariable(TempFlags._i); + (synthesizedLHS).argumentExpression = tempArgumentExpression; + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true); + } + else { + (synthesizedLHS).argumentExpression = leftHandSideExpression.argumentExpression; + } + write(", "); + } + else if (isPropertyAccessExpression(leftHandSideExpression)) { + if (shouldEmitParenthesis) { + write("("); + } + synthesizedLHS = createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false); + let tempExpression = createAndRecordTempVariable(TempFlags.Auto); + synthesizedLHS.expression = tempExpression + emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); + (synthesizedLHS).dotToken = leftHandSideExpression.dotToken; + (synthesizedLHS).name = leftHandSideExpression.name; + write(", "); + } + + emit(synthesizedLHS || leftHandSideExpression); + write(" = "); + write("Math.pow("); + emit(synthesizedLHS || leftHandSideExpression); + write(", "); + emit(node.right); + write(")"); + if (shouldEmitParenthesis) { + write(")"); + } + } + else { + write("Math.pow("); + emit(leftHandSideExpression); + write(", "); + emit(node.right); + write(")"); + } + } + function emitBinaryExpression(node: BinaryExpression) { if (languageVersion < ScriptTarget.ES6 && node.operatorToken.kind === SyntaxKind.EqualsToken && (node.left.kind === SyntaxKind.ObjectLiteralExpression || node.left.kind === SyntaxKind.ArrayLiteralExpression)) { @@ -2523,17 +2589,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`", `); } - if (languageVersion < ScriptTarget.ES7 && - (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken || node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken)) { - if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { - emit(node.left); - write(" = "); - } - write("Math.pow("); - emit(node.left); - write(", "); - emit(node.right); - write(")"); + if (languageVersion < ScriptTarget.ES7 && (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken || node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken)) { + emitExponentiationOperator(node); } else { emit(node.left); @@ -3180,6 +3237,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(";"); } + function emitAssignment(name: Identifier, value: Expression, shouldEmitCommaBeforeAssignment: boolean) { + if (shouldEmitCommaBeforeAssignment) { + write(", "); + } + + const isVariableDeclarationOrBindingElement = + name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); + + let exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); + + if (exportChanged) { + write(`${exportFunctionForFile}("`); + emitNodeWithCommentsAndWithoutSourcemap(name); + write(`", `); + } + + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } + + write(" = "); + emit(value); + + if (exportChanged) { + write(")"); + } + } + function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; @@ -3205,36 +3293,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitBindingElement(root, value); } - function emitAssignment(name: Identifier, value: Expression) { - if (emitCount++) { - write(", "); - } - - const isVariableDeclarationOrBindingElement = - name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); - - let exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); - - if (exportChanged) { - write(`${exportFunctionForFile}("`); - emitNodeWithCommentsAndWithoutSourcemap(name); - write(`", `); - } - - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } - - write(" = "); - emit(value); - - if (exportChanged) { - write(")"); - } - } /** * Ensures that there exists a declared identifier whose value holds the given expression. @@ -3254,7 +3312,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expr); + emitAssignment(identifier, expr, /*shouldEmitCommaBeforeAssignment*/ emitCount++ > 0); return identifier; } @@ -3354,7 +3412,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitArrayLiteralAssignment(target, value); } else { - emitAssignment(target, value); + emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount++ > 0); } } @@ -3423,7 +3481,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } else { - emitAssignment(target.name, value); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount++ > 0); } } } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ed8b516b7f30c..9f54a6ff773d0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -892,6 +892,14 @@ namespace ts { return nodeIsDecorated(node) || childIsDecorated(node); } + export function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression { + return node.kind === SyntaxKind.PropertyAccessExpression; + } + + export function isElementAccessExpression(node: Node): node is ElementAccessExpression { + return node.kind === SyntaxKind.ElementAccessExpression; + } + export function isExpression(node: Node): boolean { switch (node.kind) { case SyntaxKind.ThisKeyword: @@ -1402,7 +1410,7 @@ namespace ts { * where Symbol is literally the word "Symbol", and name is any identifierName */ export function isWellKnownSymbolSyntactically(node: Expression): boolean { - return node.kind === SyntaxKind.PropertyAccessExpression && isESSymbolIdentifier((node).expression); + return isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression); } export function getPropertyNameForPropertyNameNode(name: DeclarationName): string { @@ -2035,8 +2043,8 @@ namespace ts { if (node.kind === SyntaxKind.Identifier) { return true; } - else if (node.kind === SyntaxKind.PropertyAccessExpression) { - return isSupportedExpressionWithTypeArgumentsRest((node).expression); + else if (isPropertyAccessExpression(node)) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } else { return false; From ca5da9068a7dda017b5573ab55411d3cf9a27aae Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 2 Oct 2015 19:23:04 -0700 Subject: [PATCH 12/39] Add tests --- ...onentiationAssignmentWithIndexingOnLHS1.ts | 17 +++ ...onentiationAssignmentWithIndexingOnLHS2.ts | 10 ++ ...onentiationAssignmentWithIndexingOnLHS3.ts | 14 +++ ...onentiationAssignmentWithIndexingOnLHS4.ts | 14 +++ ...onAssignmentWithPropertyAccessingOnLHS1.ts | 6 + .../emitCompoundExponentiationOperator1ES7.ts | 22 ++++ .../emitCompoundExponentiationOperator2ES7.ts | 25 ++++ .../emitExponentiationOperator1ES7.ts | 32 +++++ .../emitExponentiationOperator2ES7.ts | 75 ++++++++++++ .../emitExponentiationOperator3ES7.ts | 114 ++++++++++++++++++ ...onentiationOperatorInTemplateString1ES6.ts | 46 +++++++ ...ExponentiationOperatorInTemplateString2.ts | 46 +++++++ ...onentiationOperatorInTemplateString2ES6.ts | 46 +++++++ ...ExponentiationOperatorInTemplateString3.ts | 46 +++++++ ...onentiationOperatorInTemplateString3ES6.ts | 46 +++++++ .../exponentiationOperatorWithNew.ts | 6 + ...iationOperatorWithTemplateStringInvalid.ts | 19 +++ ...ionOperatorWithTemplateStringInvalidES6.ts | 16 +++ 18 files changed, 600 insertions(+) create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts new file mode 100644 index 0000000000000..7e0a7dc37281e --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts @@ -0,0 +1,17 @@ +// @target: es5 + +var array0 = [1, 2, 3] +var i0 = 0; +array0[++i0] **= 2; + +var array1 = [1, 2, 3] +var i1 = 0; +array1[++i1] **= array1[++i1] **= 2; + +var array2 = [1, 2, 3] +var i2 = 0; +array2[++i2] **= array2[++i2] ** 2; + +var array3 = [2, 2, 3]; +var j0 = 0, j1 = 1; +array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts new file mode 100644 index 0000000000000..2648b0d680970 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts @@ -0,0 +1,10 @@ +// @target: es5 +function foo() { + console.log("Call foo()"); + return { 0: 2 }; +} +var result_foo1 = foo()[0] **= foo()[0]; + +var result_foo2 = foo()[0] **= foo()[0] **= 2; + +var result_foo3 = foo()[0] **= foo()[0] ** 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts new file mode 100644 index 0000000000000..afb12a97563ff --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts @@ -0,0 +1,14 @@ +// @target: es5 + +var object = { + _0: 2, + get 0() { + return this._0; + }, + set 0(x: number) { + this._0 = x; + }, +} +object[0] **= object[0]; +object[0] **= object[0] **= 2; +object[0] **= object[0] ** 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts new file mode 100644 index 0000000000000..668d6f0a92b48 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts @@ -0,0 +1,14 @@ +// @target: es5 + +function incrementIdx(max: number) { + let idx = Math.floor(Math.random() * max); + return idx; +} + +var array1 = [1, 2, 3, 4, 5]; + +array1[incrementIdx(array1.length)] **= 3; + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts new file mode 100644 index 0000000000000..bb8530b204f1e --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts @@ -0,0 +1,6 @@ +// @target: es5 + +function foo() { + return { prop: 2 }; +} +foo().prop **= 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts new file mode 100644 index 0000000000000..61b057146fc2b --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts @@ -0,0 +1,22 @@ +// @target:es7 + +var comp: number; + +comp **= 1; +comp **= comp ** comp; +comp **= comp ** comp ** 2; +comp **= comp ** comp + 2; +comp **= comp ** comp - 2; +comp **= comp ** comp * 2; +comp **= comp ** comp / 2; +comp **= comp ** comp % 2; +comp **= (comp - 2) ** 5; +comp **= (comp + 2) ** 5; +comp **= (comp * 2) ** 5; +comp **= (comp / 2) ** 5; +comp **= (comp % 2) ** 5; +comp **= comp ** (5 + 2); +comp **= comp ** (5 - 2); +comp **= comp ** (5 * 2); +comp **= comp ** (5 / 2); +comp **= comp ** (5 % 2); \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts new file mode 100644 index 0000000000000..4cc1a29a5f712 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts @@ -0,0 +1,25 @@ +// @target:es7 + +var comp: number; + +comp **= 1; +comp **= comp **= 1; +comp **= comp **= 1 + 2; +comp **= comp **= 1 - 2; +comp **= comp **= 1 * 2; +comp **= comp **= 1 / 2; + +comp **= comp **= (1 + 2); +comp **= comp **= (1 - 2); +comp **= comp **= (1 * 2); +comp **= comp **= (1 / 2); + +comp **= comp **= 1 + 2 ** 3; +comp **= comp **= 1 - 2 ** 4; +comp **= comp **= 1 * 2 ** 5; +comp **= comp **= 1 / 2 ** 6; + +comp **= comp **= (1 + 2) ** 3; +comp **= comp **= (1 - 2) ** 4; +comp **= comp **= (1 * 2) ** 5; +comp **= comp **= (1 / 2) ** 6; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts new file mode 100644 index 0000000000000..9007a1e33cbcd --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts @@ -0,0 +1,32 @@ +// @target: es7 + +1 ** 2; +1 ** 2 ** 3; +1 ** -2 ** 3; +1 ** -2 ** -3; +-1 ** -2 ** -3; +-(1 ** 2) ** 3; +1 ** -(2 ** 3); + +1 ** 2 + 3; +1 ** 2 - 3; +1 ** 2 * 3; +1 ** 2 / 3; +1 ** 2 % 3; + +1 ** -2 + 3; +1 ** -2 - 3; +1 ** -2 * 3; +1 ** -2 / 3; +1 ** -2 % 3; + +2 + 3 ** 3; +2 - 3 ** 3; +2 * 3 ** 3; +2 / 3 ** 3; +2 % 3 ** 3; + +(2 + 3) ** 4; +(2 - 3) ** 4; +(2 * 3) ** 4; +(2 / 3) ** 4; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts new file mode 100644 index 0000000000000..ded8e7ce6318a --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts @@ -0,0 +1,75 @@ +// @target:es7 + +var temp = 10; + +++temp ** 3; +--temp ** 3; +temp++ ** 3; +temp-- ** 3; +--temp + temp ** 3; +--temp - temp ** 3; +--temp * temp ** 3; +--temp / temp ** 3; +--temp % temp ** 3; +-++temp ** 3; ++--temp ** 3; + +temp-- ** 3; +temp++ ** 3; +-temp++ ** 3; ++temp-- ** 3; + +temp-- + temp ** 3; +temp-- - temp ** 3; +temp-- * temp ** 3; +temp-- / temp ** 3; +temp-- % temp ** 3; + +--temp + 2 ** 3; +--temp - 2 ** 3; +--temp * 2 ** 3; +--temp / 2 ** 3; +--temp % 2 ** 3; + +++temp + 2 ** 3; +++temp - 2 ** 3; +++temp * 2 ** 3; +++temp / 2 ** 3; + +3 ** ++temp; +3 ** --temp; +3 ** temp++; +3 ** temp--; +-3 ** temp++; +-3 ** temp--; +-3 ** ++temp; +-3 ** --temp; ++3 ** temp++; ++3 ** temp--; ++3 ** ++temp; ++3 ** --temp + +3 ** ++temp ** 2; +3 ** --temp ** 2; +3 ** temp++ ** 2; +3 ** temp-- ** 2; +-3 ** temp++ ** 2; +-3 ** temp-- ** 2; +-3 ** ++temp ** 2; +-3 ** --temp ** 2; ++3 ** temp++ ** 2; ++3 ** temp-- ** 2; ++3 ** ++temp ** 2; ++3 ** --temp ** 2; + +3 ** ++temp + 2; +3 ** ++temp - 2; +3 ** ++temp * 2; +3 ** ++temp / 2; +3 ** ++temp % 2; + +3 ** --temp + 2; +3 ** --temp - 2; +3 ** --temp * 2; +3 ** --temp / 2; +3 ** --temp % 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts new file mode 100644 index 0000000000000..466cab93a517f --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts @@ -0,0 +1,114 @@ +// @target: es7 +var temp: any; + +delete --temp ** 3; +delete ++temp ** 3; +delete temp-- ** 3; +delete temp++ ** 3; +delete -++temp ** 3; +delete -temp++ ** 3; +delete -temp-- ** 3; + +delete --temp ** 3 ** 1; +delete ++temp ** 3 ** 1; +delete temp-- ** 3 ** 1; +delete temp++ ** 3 ** 1; +delete -++temp ** 3 ** 1; +delete -temp++ ** 3 ** 1; +delete -temp-- ** 3 ** 1;; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; +-++temp ** 3; +-temp++ ** 3; +-temp-- ** 3; + +--temp ** 3 ** 1; +++temp ** 3 ** 1; +temp-- ** 3 ** 1; +temp++ ** 3 ** 1; +-++temp ** 3 ** 1; +-temp++ ** 3 ** 1; +-temp-- ** 3 ** 1; + +typeof --temp ** 3; +typeof temp-- ** 3; +typeof 3 ** 4; +typeof temp++ ** 4; +typeof temp-- ** 4; +typeof -3 ** 4; +typeof -++temp ** 4; +typeof -temp++ ** 4; +typeof -temp-- ** 4; + +typeof --temp ** 3 ** 1; +typeof temp-- ** 3 ** 1; +typeof 3 ** 4 ** 1; +typeof temp++ ** 4 ** 1; +typeof temp-- ** 4 ** 1; +typeof -3 ** 4 ** 1; +typeof -++temp ** 4 ** 1; +typeof -temp++ ** 4 ** 1; +typeof -temp-- ** 4 ** 1; + +void --temp ** 3; +void temp-- ** 3; +void 3 ** 4; +void temp++ ** 4; +void temp-- ** 4; +void -3 ** 4; +void -++temp ** 4; +void -temp++ ** 4; +void -temp-- ** 4; + +void --temp ** 3 ** 1; +void temp-- ** 3 ** 1; +void 3 ** 4 ** 1; +void temp++ ** 4 ** 1; +void temp-- ** 4 ** 1; +void -3 ** 4 ** 1; +void -++temp ** 4 ** 1; +void -temp++ ** 4 ** 1; +void -temp-- ** 4 ** 1; + +~ --temp ** 3; +~ temp-- ** 3; +~ 3 ** 4; +~ temp++ ** 4; +~ temp-- ** 4; +~ -3 ** 4; +~ -++temp ** 4; +~ -temp++ ** 4; +~ -temp-- ** 4; + +~ --temp ** 3 ** 1; +~ temp-- ** 3 ** 1; +~ 3 ** 4 ** 1; +~ temp++ ** 4 ** 1; +~ temp-- ** 4 ** 1; +~ -3 ** 4 ** 1; +~ -++temp ** 4 ** 1; +~ -temp++ ** 4 ** 1; +~ -temp-- ** 4 ** 1; + +! --temp ** 3; +! temp-- ** 3; +! 3 ** 4; +! temp++ ** 4; +! temp-- ** 4; +! -3 ** 4; +! -++temp ** 4; +! -temp++ ** 4; +! -temp-- ** 4; + +! --temp ** 3 ** 1; +! temp-- ** 3 ** 1; +! 3 ** 4 ** 1; +! temp++ ** 4 ** 1; +! temp-- ** 4 ** 1; +! -3 ** 4 ** 1; +! -++temp ** 4 ** 1; +! -temp++ ** 4 ** 1; +! -temp-- ** 4 ** 1; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts new file mode 100644 index 0000000000000..70cdad5b98f0b --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts @@ -0,0 +1,46 @@ +// @target: es6 + +var t1 = 10; +var t2 = 10; +var s; + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +`${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1 }`; +`${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}`; +`${typeof (t1 ** t2 ** t1) }`; +`${1 + typeof t1 ** t2 ** t1}`; +`${1 + typeof (t1 ** t2 ** t1) }`; + +`${t1 ** t2}${t1 ** t2}`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`${t1 ** t2} hello world ${t1 ** t2}`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts new file mode 100644 index 0000000000000..3c3349879c315 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts @@ -0,0 +1,46 @@ +// @target: es5 + +var t1 = 10; +var t2 = 10; +var s; + +// With templateHead +`hello ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1 }`; +`hello ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof (t1 ** t2 ** t1) }`; + +`hello ${t1 ** t2}${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts new file mode 100644 index 0000000000000..7268768f417ef --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts @@ -0,0 +1,46 @@ +// @target: es6 + +var t1 = 10; +var t2 = 10; +var s; + +// With templateHead +`hello ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1 }`; +`hello ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof (t1 ** t2 ** t1) }`; + +`hello ${t1 ** t2}${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts new file mode 100644 index 0000000000000..8affe231586e5 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts @@ -0,0 +1,46 @@ +// @target: es5 + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** t2} world`; +`${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1 } world`; +`${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1} world`; +`${typeof (t1 ** t2 ** t1) } world`; +`${1 + typeof t1 ** t2 ** t1} world`; +`${1 + typeof (t1 ** t2 ** t1) } world`; + +`${t1 ** t2}${t1 ** t2} world`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts new file mode 100644 index 0000000000000..9c54478708e82 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts @@ -0,0 +1,46 @@ +// @target: es6 + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** t2} world`; +`${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1 } world`; +`${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1} world`; +`${typeof (t1 ** t2 ** t1) } world`; +`${1 + typeof t1 ** t2 ** t1} world`; +`${1 + typeof (t1 ** t2 ** t1) } world`; + +`${t1 ** t2}${t1 ** t2} world`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts new file mode 100644 index 0000000000000..c17b26cc88f5b --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts @@ -0,0 +1,6 @@ +var a: any; +var b: any; +var c: any; +new a ** b ** c; +new a ** new b ** c; +new (a ** b ** c); \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts new file mode 100644 index 0000000000000..6e055caae04f0 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts @@ -0,0 +1,19 @@ +// @target: es5 + +var a = 1 ** `${ 3 }`; +var b = 1 ** `2${ 3 }`; +var c = 1 ** `${ 3 }4`; +var d = 1 ** `2${ 3 }4`; +var e = `${ 3 }` ** 5; +var f = `2${ 3 }` ** 5; +var g = `${ 3 }4` ** 5; +var h = `2${ 3 }4` ** 5; + +var k = 10; +k **= `${ 3 }`; +k **= `2${ 3 }`; +k **= `2${ 3 }4`; +k **= `2${ 3 }4`; + + + \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts new file mode 100644 index 0000000000000..1593d1290e483 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts @@ -0,0 +1,16 @@ +// @target: es6 + +var a = 1 ** `${ 3 }`; +var b = 1 ** `2${ 3 }`; +var c = 1 ** `${ 3 }4`; +var d = 1 ** `2${ 3 }4`; +var e = `${ 3 }` ** 5; +var f = `2${ 3 }` ** 5; +var g = `${ 3 }4` ** 5; +var h = `2${ 3 }4` ** 5; + +var k = 10; +k **= `${ 3 }`; +k **= `2${ 3 }`; +k **= `2${ 3 }4`; +kj **= `2${ 3 }4`; \ No newline at end of file From bf0903bd1be8e706825b13b32956a6462a518ee0 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 2 Oct 2015 19:23:19 -0700 Subject: [PATCH 13/39] Address PR on fixing tempalte tests --- .../emitExponentiationOperator3.ts | 3 +- ...ExponentiationOperatorInTemplateString1.ts | 70 ++++++++++++------- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts index b3b5deaf83dc5..f8c05f47e6b3f 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts @@ -1,4 +1,5 @@ -var temp: any; +// @target: es5 +var temp: any; delete --temp ** 3; delete ++temp ** 3; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts index f79b22fedd771..80fe91ee4628f 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts @@ -1,28 +1,46 @@ -var t1 = 10; +// @target: es5 + +var t1 = 10; var t2 = 10; var s; -`Exp: ${t1 ** t2} abc`; -`Exp: ${t1 ** t2 ** t1} abc`; -`Exp: ${t1 + t2 ** t1} abc`; -`Exp: ${t1 - t2 ** t1} abc`; -`Exp: ${t1 ** t2 + t1} abc`; -`Exp: ${t1 ** t2 - t1} abc`; -`Exp: ${t1 + t2 ** t2 + t1} abc`; -`Exp: ${t1 - t2 ** t2 - t1} abc`; -`Exp: ${-t1 ** t2 - t1} abc`; -`Exp: ${+t1 ** t2 - t1} abc`; -`Exp: ${-++t1 ** t2 - t1} abc`; -`Exp: ${+--t1 ** t2 - t1} abc`; -`Exp: ${-t1++ ** t2 - t1} abc`; -`Exp: ${-t1-- ** t2 - t1} abc`; -`Exp: ${+t1++ ** t2 - t1} abc`; -`Exp: ${+t1-- ** t2 - t1} abc`; -`Exp: ${typeof t1 ** t2 ** t1} abc`; -`Exp: ${typeof t1 ** t2 + t1} abc`; -`Exp: ${typeof t1 ** (t2 - t1)} abc`; -`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; -`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; -`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; -`Exp: ${!t1 ** t2 ** t1} abc`; -`Exp: ${!t1 ** t2 ** ++t1} abc`; -`Exp: ${!t1 ** t2 ** --t1} abc`; + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +`${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1 }`; +`${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}`; +`${typeof (t1 ** t2 ** t1) }`; +`${1 + typeof t1 ** t2 ** t1}`; +`${1 + typeof (t1 ** t2 ** t1) }`; + +`${t1 ** t2}${t1 ** t2}`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`${t1 ** t2} hello world ${t1 ** t2}`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; \ No newline at end of file From 1326ba9820c5cf82fbfc88d6b048aab6560b825d Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 2 Oct 2015 19:23:58 -0700 Subject: [PATCH 14/39] Update grammar to error on none-parenthesis --- src/compiler/parser.ts | 53 +++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index aaf460f33cced..147dbfce9efd5 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3141,7 +3141,7 @@ namespace ts { let node = createNode(SyntaxKind.PrefixUnaryExpression); node.operator = token; nextToken(); - node.operand = parseUnaryExpressionOrHigher(); + node.operand = parseSimpleUnaryExpression(); return finishNode(node); } @@ -3149,21 +3149,21 @@ namespace ts { function parseDeleteExpression() { let node = createNode(SyntaxKind.DeleteExpression); nextToken(); - node.expression = parseUnaryExpressionOrHigher(); + node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { let node = createNode(SyntaxKind.TypeOfExpression); nextToken(); - node.expression = parseUnaryExpressionOrHigher(); + node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { let node = createNode(SyntaxKind.VoidExpression); nextToken(); - node.expression = parseUnaryExpressionOrHigher(); + node.expression = parseSimpleUnaryExpression(); return finishNode(node); } @@ -3183,12 +3183,46 @@ namespace ts { function parseAwaitExpression() { const node = createNode(SyntaxKind.AwaitExpression); nextToken(); - node.expression = parseUnaryExpressionOrHigher(); + node.expression = parseSimpleUnaryExpression(); return finishNode(node); } /** - * Parse UnaryExpression or higher: + * Comment + * @param node + */ + function isIncrementExpression(node: UnaryExpression): node is IncrementExpression { + if (node.kind === SyntaxKind.DeleteExpression || node.kind === SyntaxKind.TypeOfExpression || + node.kind === SyntaxKind.VoidExpression || node.kind === SyntaxKind.TypeAssertionExpression || + node.kind === SyntaxKind.JsxExpression) { + return false; + } + else if (node.kind === SyntaxKind.PrefixUnaryExpression && ((node).operator === SyntaxKind.PlusToken || + (node).operator === SyntaxKind.MinusToken || (node).operator === SyntaxKind.TildeToken || + (node).operator === SyntaxKind.ExclamationToken)) { + return false; + } + return true; + } + + function parseUnaryExpressionOrHigher(): UnaryExpression | BinaryExpression { + let tryParseIncrementExpression = parseSimpleUnaryExpression(); + if (token === SyntaxKind.AsteriskAsteriskToken) { + if (isIncrementExpression(tryParseIncrementExpression)) { + return parseBinaryExpressionRest(getBinaryOperatorPrecedence(), tryParseIncrementExpression); + } + else { + parseErrorAtCurrentToken(Diagnostics.Only_incrementExpression_is_allowed_as_left_operand_of_Asterisk_Asterisk); + return tryParseIncrementExpression; + } + } + else { + return tryParseIncrementExpression; + } + } + + /** + * Parse SimpleUnaryExpression or higher: * In ES7 grammar, * UnaryExpression: * 1) IncrementExpression[?yield] @@ -3201,7 +3235,7 @@ namespace ts { * 8) ! UnaryExpression[?yield] * 9) IncrementExpression[?yield] ** UnaryExpression[?yield] */ - function parseUnaryExpressionOrHigher(): UnaryExpression | BinaryExpression { + function parseSimpleUnaryExpression(): UnaryExpression { if (isAwaitExpression()) { return parseAwaitExpression(); } @@ -3230,10 +3264,7 @@ namespace ts { } // Fall through default: - let tryParseUnaryExpression = parseIncrementExpression(); - return token === SyntaxKind.AsteriskAsteriskToken ? - parseBinaryExpressionRest(getBinaryOperatorPrecedence(), tryParseUnaryExpression) : - tryParseUnaryExpression; + return parseIncrementExpression(); } } From ce7a05440731815721e3cff7e471bc7368d206d8 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 10:34:48 -0700 Subject: [PATCH 15/39] Update parser with new grammar --- .../diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 12 +++-- src/compiler/parser.ts | 46 ++++++++++--------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 37989c3433a4b..5b12e5ac21551 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -618,5 +618,6 @@ namespace ts { JSX_attribute_expected: { code: 17003, category: DiagnosticCategory.Error, key: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: DiagnosticCategory.Error, key: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor cannot contain a 'super' call when its class extends 'null'" }, + Left_hand_side_of_Asterisk_Asterisk_cannot_be_a_simple_unary_expression_Consider_parenthesize_the_expression: { code: 17006, category: DiagnosticCategory.Error, key: "Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c1657a81babb5..34dd1ffa22771 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1700,11 +1700,11 @@ "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead.": { "category": "Error", "code": 2652 - }, + }, "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'.": { "category": "Error", "code": 2653 - }, + }, "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.": { "category": "Error", "code": 2654 @@ -1712,11 +1712,11 @@ "Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition.": { "category": "Error", "code": 2655 - }, + }, "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition.": { "category": "Error", "code": 2656 - }, + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 @@ -2466,5 +2466,9 @@ "A constructor cannot contain a 'super' call when its class extends 'null'": { "category": "Error", "code": 17005 + }, + "Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression.": { + "category": "Error", + "code": 17006 } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 147dbfce9efd5..8cbe82c7c017f 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3191,34 +3191,36 @@ namespace ts { * Comment * @param node */ - function isIncrementExpression(node: UnaryExpression): node is IncrementExpression { - if (node.kind === SyntaxKind.DeleteExpression || node.kind === SyntaxKind.TypeOfExpression || - node.kind === SyntaxKind.VoidExpression || node.kind === SyntaxKind.TypeAssertionExpression || - node.kind === SyntaxKind.JsxExpression) { - return false; - } - else if (node.kind === SyntaxKind.PrefixUnaryExpression && ((node).operator === SyntaxKind.PlusToken || - (node).operator === SyntaxKind.MinusToken || (node).operator === SyntaxKind.TildeToken || - (node).operator === SyntaxKind.ExclamationToken)) { - return false; + function isIncrementExpression(): boolean{ + // TODO(yuisu): Comment why we have to do what are we doing here + switch (token) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.DeleteKeyword: + case SyntaxKind.TypeOfKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.LessThanToken: + return false; + default: + return true; } - return true; } function parseUnaryExpressionOrHigher(): UnaryExpression | BinaryExpression { - let tryParseIncrementExpression = parseSimpleUnaryExpression(); + if (isIncrementExpression()) { + let incrementExpression = parseIncrementExpression(); + return token === SyntaxKind.AsteriskAsteriskToken ? + parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) : + incrementExpression; + } + + let simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === SyntaxKind.AsteriskAsteriskToken) { - if (isIncrementExpression(tryParseIncrementExpression)) { - return parseBinaryExpressionRest(getBinaryOperatorPrecedence(), tryParseIncrementExpression); - } - else { - parseErrorAtCurrentToken(Diagnostics.Only_incrementExpression_is_allowed_as_left_operand_of_Asterisk_Asterisk); - return tryParseIncrementExpression; - } - } - else { - return tryParseIncrementExpression; + parseErrorAtCurrentToken(Diagnostics.Left_hand_side_of_Asterisk_Asterisk_cannot_be_a_simple_unary_expression_Consider_parenthesize_the_expression) } + return simpleUnaryExpression; } /** From 69dc707c1455081166329c82468cf3048dad4857 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 18:56:08 -0700 Subject: [PATCH 16/39] Update parse to use new grammar --- src/compiler/parser.ts | 48 ++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 8cbe82c7c017f..6141e3ba047b1 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3188,8 +3188,14 @@ namespace ts { } /** - * Comment - * @param node + * Check if the current token can possibly be in an ES7 increment expression. + * + * Increment Expression: + * LeftHandSideExpression[?Yield] + * LeftHandSideExpression[?Yield][no LineTerminator here]++ + * LeftHandSideExpression[?Yield][no LineTerminator here]-- + * ++LeftHandSideExpression[?Yield] + * --LeftHandSideExpression[?Yield] */ function isIncrementExpression(): boolean{ // TODO(yuisu): Comment why we have to do what are we doing here @@ -3208,7 +3214,18 @@ namespace ts { } } + /** + * Parse ES7 unary expression and await expression + * + * ES7 UnaryExpression: + * 1) SimpleUnaryExpression[?yield] + * 2) IncrementExpression[?yield] ** UnaryExpression[?yield] + */ function parseUnaryExpressionOrHigher(): UnaryExpression | BinaryExpression { + if (isAwaitExpression()) { + return parseAwaitExpression(); + } + if (isIncrementExpression()) { let incrementExpression = parseIncrementExpression(); return token === SyntaxKind.AsteriskAsteriskToken ? @@ -3224,24 +3241,19 @@ namespace ts { } /** - * Parse SimpleUnaryExpression or higher: - * In ES7 grammar, - * UnaryExpression: - * 1) IncrementExpression[?yield] - * 2) delete UnaryExpression[?yield] - * 3) void UnaryExpression[?yield] - * 4) typeof UnaryExpression[?yield] - * 5) + UnaryExpression[?yield] - * 6) - UnaryExpression[?yield] - * 7) ~ UnaryExpression[?yield] - * 8) ! UnaryExpression[?yield] - * 9) IncrementExpression[?yield] ** UnaryExpression[?yield] + * Parse ES7 simple-unary expression or higher: + * + * SimpleUnaryExpression: + * 1) IncrementExpression[?yield] + * 2) delete UnaryExpression[?yield] + * 3) void UnaryExpression[?yield] + * 4) typeof UnaryExpression[?yield] + * 5) + UnaryExpression[?yield] + * 6) - UnaryExpression[?yield] + * 7) ~ UnaryExpression[?yield] + * 8) ! UnaryExpression[?yield] */ function parseSimpleUnaryExpression(): UnaryExpression { - if (isAwaitExpression()) { - return parseAwaitExpression(); - } - switch (token) { case SyntaxKind.PlusToken: case SyntaxKind.MinusToken: From 7b3de842a0684889f5baa43129d31bb5493e935f Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 18:56:39 -0700 Subject: [PATCH 17/39] Update test harness to pick up new ScriptTarget of ES7 --- src/compiler/commandLineParser.ts | 2 +- src/harness/harness.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1670251973ab1..f63cb36f9ec94 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -204,7 +204,7 @@ namespace ts { { name: "target", shortName: "t", - type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 }, + type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6, "es7": ScriptTarget.ES7 }, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: Diagnostics.VERSION, error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 57eb848ac23ae..f149ceeb26816 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -932,7 +932,16 @@ module Harness { } else { if (fn === defaultLibFileName) { - return languageVersion === ts.ScriptTarget.ES6 ? defaultES6LibSourceFile : defaultLibSourceFile; + switch (languageVersion) { + case ts.ScriptTarget.ES6: + case ts.ScriptTarget.ES7: + // TODO : Update to use ES7 specific lib file + return defaultES6LibSourceFile; + case ts.ScriptTarget.ES3: + case ts.ScriptTarget.ES5: + default: + return defaultLibSourceFile; + } } // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC return undefined; From 80cdfd41874a9f7bdbb6f88fdef13fab72f0922d Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 18:57:11 -0700 Subject: [PATCH 18/39] Fix emitting parenthesis when downlevel --- src/compiler/emitter.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index db3cef27aa398..6a09006d3e3a1 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2508,7 +2508,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } /** - * Emit exponentiation operator down-level using Math.pow + * Emit ES7 exponentiation operator downlevel using Math.pow * @param node {BinaryExpression} a binary expression node containing exponentiationOperator (**, **=) */ function emitExponentiationOperator(node: BinaryExpression) { @@ -2516,12 +2516,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { let synthesizedLHS: ElementAccessExpression | PropertyAccessExpression; // TODO (yuisu) : comment - let shouldEmitParenthesis = node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BinaryExpression; + let shouldEmitParenthesis = false; if (isElementAccessExpression(leftHandSideExpression)) { + shouldEmitParenthesis = node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BinaryExpression; + if (shouldEmitParenthesis) { write("("); } + synthesizedLHS = createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false); let tempExpression = createAndRecordTempVariable(TempFlags.Auto); emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); @@ -2539,9 +2542,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(", "); } else if (isPropertyAccessExpression(leftHandSideExpression)) { + shouldEmitParenthesis = node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BinaryExpression; + if (shouldEmitParenthesis) { write("("); } + synthesizedLHS = createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false); let tempExpression = createAndRecordTempVariable(TempFlags.Auto); synthesizedLHS.expression = tempExpression From a00e90c1700dfd78222bce7d5033bca224c0dfc2 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:03:02 -0700 Subject: [PATCH 19/39] Add and update tests --- ...onentiationAssignmentWithIndexingOnLHS2.ts | 8 +- ...onentiationAssignmentWithIndexingOnLHS4.ts | 2 + ...onAssignmentWithPropertyAccessingOnLHS1.ts | 9 +- .../emitCompoundExponentiationOperator1ES7.ts | 2 +- .../emitExponentiationOperator1.ts | 9 +- .../emitExponentiationOperator1ES7.ts | 9 +- .../emitExponentiationOperator2.ts | 23 +-- .../emitExponentiationOperator2ES7.ts | 23 +-- .../emitExponentiationOperator3.ts | 154 +++++------------- .../emitExponentiationOperator3ES7.ts | 154 +++++------------- .../emitExponentiationOperator4.ts | 37 +++++ .../emitExponentiationOperator4ES7.ts | 37 +++++ ...ExponentiationOperatorInTempalteString4.ts | 28 ++++ ...onentiationOperatorInTempalteString4ES6.ts | 28 ++++ ...ExponentiationOperatorInTemplateString1.ts | 20 +-- ...onentiationOperatorInTemplateString1ES6.ts | 20 +-- ...ExponentiationOperatorInTemplateString2.ts | 20 +-- ...onentiationOperatorInTemplateString2ES6.ts | 20 +-- ...ExponentiationOperatorInTemplateString3.ts | 18 -- ...onentiationOperatorInTemplateString3ES6.ts | 18 -- ...peratorInTemplateStringWithSyntaxError1.ts | 28 ++++ ...peratorInTemplateStringWithSyntaxError2.ts | 28 ++++ ...peratorInTemplateStringWithSyntaxError3.ts | 28 ++++ .../exponentiationOperatorSyntaxError1.ts | 39 +++++ .../exponentiationOperatorSyntaxError2.ts | 63 +++++++ ...ithInvalidSimpleUnaryExpressionOperands.ts | 36 ++++ 26 files changed, 466 insertions(+), 395 deletions(-) create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4ES6.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts create mode 100644 tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts index 2648b0d680970..6a6fdc662c1bf 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts @@ -1,10 +1,12 @@ // @target: es5 +var globalCounter = 0; function foo() { - console.log("Call foo()"); + globalCounter += 1; return { 0: 2 }; } +foo()[0] **= foo()[0]; var result_foo1 = foo()[0] **= foo()[0]; - +foo()[0] **= foo()[0] **= 2; var result_foo2 = foo()[0] **= foo()[0] **= 2; - +foo()[0] **= foo()[0] ** 2; var result_foo3 = foo()[0] **= foo()[0] ** 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts index 668d6f0a92b48..3f4acd74e01e6 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts @@ -1,6 +1,8 @@ // @target: es5 +var globalCounter = 0; function incrementIdx(max: number) { + globalCounter += 1; let idx = Math.floor(Math.random() * max); return idx; } diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts index bb8530b204f1e..c4ca205404b0b 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts @@ -1,6 +1,13 @@ // @target: es5 +var globalCounter = 0; function foo() { + globalCounter += 1; return { prop: 2 }; } -foo().prop **= 2; \ No newline at end of file +foo().prop **= 2; +var result0 = foo().prop **= 2; +foo().prop **= foo().prop **= 2; +var result1 = foo().prop **= foo().prop **= 2; +foo().prop **= foo().prop ** 2; +var result2 = foo().prop **= foo().prop ** 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts index 61b057146fc2b..ca2514b53f951 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts @@ -1,4 +1,4 @@ -// @target:es7 +// @target: es7 var comp: number; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts index 9f8fa8f4d9458..2e6c84b6d43b4 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts @@ -1,12 +1,13 @@ // @target: es5 +1 ** -2; 1 ** 2; +(-1) ** 2 1 ** 2 ** 3; -1 ** -2 ** 3; -1 ** -2 ** -3; --1 ** -2 ** -3; --(1 ** 2) ** 3; +1 ** 2 ** -3; 1 ** -(2 ** 3); +(-(1 ** 2)) ** 3; +(-(1 ** 2)) ** -3; 1 ** 2 + 3; 1 ** 2 - 3; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts index 9007a1e33cbcd..f99051f650099 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts @@ -1,12 +1,13 @@ // @target: es7 +1 ** -2; 1 ** 2; +(-1) ** 2 1 ** 2 ** 3; -1 ** -2 ** 3; -1 ** -2 ** -3; --1 ** -2 ** -3; --(1 ** 2) ** 3; +1 ** 2 ** -3; 1 ** -(2 ** 3); +(-(1 ** 2)) ** 3; +(-(1 ** 2)) ** -3; 1 ** 2 + 3; 1 ** 2 - 3; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts index 317688bf913b8..146eab550d2e7 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2.ts @@ -11,13 +11,10 @@ temp-- ** 3; --temp * temp ** 3; --temp / temp ** 3; --temp % temp ** 3; --++temp ** 3; -+--temp ** 3; - temp-- ** 3; temp++ ** 3; --temp++ ** 3; -+temp-- ** 3; +temp-- ** -temp; +temp++ ** +temp; temp-- + temp ** 3; temp-- - temp ** 3; @@ -40,27 +37,11 @@ temp-- % temp ** 3; 3 ** --temp; 3 ** temp++; 3 ** temp--; --3 ** temp++; --3 ** temp--; --3 ** ++temp; --3 ** --temp; -+3 ** temp++; -+3 ** temp--; -+3 ** ++temp; -+3 ** --temp 3 ** ++temp ** 2; 3 ** --temp ** 2; 3 ** temp++ ** 2; 3 ** temp-- ** 2; --3 ** temp++ ** 2; --3 ** temp-- ** 2; --3 ** ++temp ** 2; --3 ** --temp ** 2; -+3 ** temp++ ** 2; -+3 ** temp-- ** 2; -+3 ** ++temp ** 2; -+3 ** --temp ** 2; 3 ** ++temp + 2; 3 ** ++temp - 2; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts index ded8e7ce6318a..f5429d1ddd57a 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts @@ -11,13 +11,10 @@ temp-- ** 3; --temp * temp ** 3; --temp / temp ** 3; --temp % temp ** 3; --++temp ** 3; -+--temp ** 3; - temp-- ** 3; temp++ ** 3; --temp++ ** 3; -+temp-- ** 3; +temp-- ** -temp; +temp++ ** +temp; temp-- + temp ** 3; temp-- - temp ** 3; @@ -40,27 +37,11 @@ temp-- % temp ** 3; 3 ** --temp; 3 ** temp++; 3 ** temp--; --3 ** temp++; --3 ** temp--; --3 ** ++temp; --3 ** --temp; -+3 ** temp++; -+3 ** temp--; -+3 ** ++temp; -+3 ** --temp 3 ** ++temp ** 2; 3 ** --temp ** 2; 3 ** temp++ ** 2; 3 ** temp-- ** 2; --3 ** temp++ ** 2; --3 ** temp-- ** 2; --3 ** ++temp ** 2; --3 ** --temp ** 2; -+3 ** temp++ ** 2; -+3 ** temp-- ** 2; -+3 ** ++temp ** 2; -+3 ** --temp ** 2; 3 ** ++temp + 2; 3 ** ++temp - 2; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts index f8c05f47e6b3f..597f253d1b8fc 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts @@ -1,114 +1,40 @@ -// @target: es5 -var temp: any; - -delete --temp ** 3; -delete ++temp ** 3; -delete temp-- ** 3; -delete temp++ ** 3; -delete -++temp ** 3; -delete -temp++ ** 3; -delete -temp-- ** 3; - -delete --temp ** 3 ** 1; -delete ++temp ** 3 ** 1; -delete temp-- ** 3 ** 1; -delete temp++ ** 3 ** 1; -delete -++temp ** 3 ** 1; -delete -temp++ ** 3 ** 1; -delete -temp-- ** 3 ** 1;; - ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; --++temp ** 3; --temp++ ** 3; --temp-- ** 3; - ---temp ** 3 ** 1; -++temp ** 3 ** 1; -temp-- ** 3 ** 1; -temp++ ** 3 ** 1; --++temp ** 3 ** 1; --temp++ ** 3 ** 1; --temp-- ** 3 ** 1; - -typeof --temp ** 3; -typeof temp-- ** 3; -typeof 3 ** 4; -typeof temp++ ** 4; -typeof temp-- ** 4; -typeof -3 ** 4; -typeof -++temp ** 4; -typeof -temp++ ** 4; -typeof -temp-- ** 4; - -typeof --temp ** 3 ** 1; -typeof temp-- ** 3 ** 1; -typeof 3 ** 4 ** 1; -typeof temp++ ** 4 ** 1; -typeof temp-- ** 4 ** 1; -typeof -3 ** 4 ** 1; -typeof -++temp ** 4 ** 1; -typeof -temp++ ** 4 ** 1; -typeof -temp-- ** 4 ** 1; - -void --temp ** 3; -void temp-- ** 3; -void 3 ** 4; -void temp++ ** 4; -void temp-- ** 4; -void -3 ** 4; -void -++temp ** 4; -void -temp++ ** 4; -void -temp-- ** 4; - -void --temp ** 3 ** 1; -void temp-- ** 3 ** 1; -void 3 ** 4 ** 1; -void temp++ ** 4 ** 1; -void temp-- ** 4 ** 1; -void -3 ** 4 ** 1; -void -++temp ** 4 ** 1; -void -temp++ ** 4 ** 1; -void -temp-- ** 4 ** 1; - -~ --temp ** 3; -~ temp-- ** 3; -~ 3 ** 4; -~ temp++ ** 4; -~ temp-- ** 4; -~ -3 ** 4; -~ -++temp ** 4; -~ -temp++ ** 4; -~ -temp-- ** 4; - -~ --temp ** 3 ** 1; -~ temp-- ** 3 ** 1; -~ 3 ** 4 ** 1; -~ temp++ ** 4 ** 1; -~ temp-- ** 4 ** 1; -~ -3 ** 4 ** 1; -~ -++temp ** 4 ** 1; -~ -temp++ ** 4 ** 1; -~ -temp-- ** 4 ** 1; - -! --temp ** 3; -! temp-- ** 3; -! 3 ** 4; -! temp++ ** 4; -! temp-- ** 4; -! -3 ** 4; -! -++temp ** 4; -! -temp++ ** 4; -! -temp-- ** 4; - -! --temp ** 3 ** 1; -! temp-- ** 3 ** 1; -! 3 ** 4 ** 1; -! temp++ ** 4 ** 1; -! temp-- ** 4 ** 1; -! -3 ** 4 ** 1; -! -++temp ** 4 ** 1; -! -temp++ ** 4 ** 1; -! -temp-- ** 4 ** 1; \ No newline at end of file +// @target:es5 + +var temp = 10; + +(-++temp) ** 3; +(+--temp) ** 3; +(-temp++) ** 3; +(+temp--) ** 3; +(-(1 ** ++temp)) ** 3; +(-(1 ** --temp)) ** 3; +(-(1 ** temp++)) ** 3; +(-(1 ** temp--)) ** 3; + +(-3) ** temp++; +(-3) ** temp--; +(-3) ** ++temp; +(-3) ** --temp; +(+3) ** temp++; +(+3) ** temp--; +(+3) ** ++temp; +(+3) ** --temp; +(-3) ** temp++ ** 2; +(-3) ** temp-- ** 2; +(-3) ** ++temp ** 2; +(-3) ** --temp ** 2; +(+3) ** temp++ ** 2; +(+3) ** temp-- ** 2; +(+3) ** ++temp ** 2; +(+3) ** --temp ** 2; + +3 ** -temp++; +3 ** -temp--; +3 ** -++temp; +3 ** +--temp; +3 ** (-temp++) ** 2; +3 ** (-temp--) ** 2; +3 ** (+temp++) ** 2; +3 ** (+temp--) ** 2; +3 ** (-++temp) ** 2; +3 ** (+--temp) ** 2; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts index 466cab93a517f..8ebe25e9be174 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts @@ -1,114 +1,40 @@ -// @target: es7 -var temp: any; - -delete --temp ** 3; -delete ++temp ** 3; -delete temp-- ** 3; -delete temp++ ** 3; -delete -++temp ** 3; -delete -temp++ ** 3; -delete -temp-- ** 3; - -delete --temp ** 3 ** 1; -delete ++temp ** 3 ** 1; -delete temp-- ** 3 ** 1; -delete temp++ ** 3 ** 1; -delete -++temp ** 3 ** 1; -delete -temp++ ** 3 ** 1; -delete -temp-- ** 3 ** 1;; - ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; --++temp ** 3; --temp++ ** 3; --temp-- ** 3; - ---temp ** 3 ** 1; -++temp ** 3 ** 1; -temp-- ** 3 ** 1; -temp++ ** 3 ** 1; --++temp ** 3 ** 1; --temp++ ** 3 ** 1; --temp-- ** 3 ** 1; - -typeof --temp ** 3; -typeof temp-- ** 3; -typeof 3 ** 4; -typeof temp++ ** 4; -typeof temp-- ** 4; -typeof -3 ** 4; -typeof -++temp ** 4; -typeof -temp++ ** 4; -typeof -temp-- ** 4; - -typeof --temp ** 3 ** 1; -typeof temp-- ** 3 ** 1; -typeof 3 ** 4 ** 1; -typeof temp++ ** 4 ** 1; -typeof temp-- ** 4 ** 1; -typeof -3 ** 4 ** 1; -typeof -++temp ** 4 ** 1; -typeof -temp++ ** 4 ** 1; -typeof -temp-- ** 4 ** 1; - -void --temp ** 3; -void temp-- ** 3; -void 3 ** 4; -void temp++ ** 4; -void temp-- ** 4; -void -3 ** 4; -void -++temp ** 4; -void -temp++ ** 4; -void -temp-- ** 4; - -void --temp ** 3 ** 1; -void temp-- ** 3 ** 1; -void 3 ** 4 ** 1; -void temp++ ** 4 ** 1; -void temp-- ** 4 ** 1; -void -3 ** 4 ** 1; -void -++temp ** 4 ** 1; -void -temp++ ** 4 ** 1; -void -temp-- ** 4 ** 1; - -~ --temp ** 3; -~ temp-- ** 3; -~ 3 ** 4; -~ temp++ ** 4; -~ temp-- ** 4; -~ -3 ** 4; -~ -++temp ** 4; -~ -temp++ ** 4; -~ -temp-- ** 4; - -~ --temp ** 3 ** 1; -~ temp-- ** 3 ** 1; -~ 3 ** 4 ** 1; -~ temp++ ** 4 ** 1; -~ temp-- ** 4 ** 1; -~ -3 ** 4 ** 1; -~ -++temp ** 4 ** 1; -~ -temp++ ** 4 ** 1; -~ -temp-- ** 4 ** 1; - -! --temp ** 3; -! temp-- ** 3; -! 3 ** 4; -! temp++ ** 4; -! temp-- ** 4; -! -3 ** 4; -! -++temp ** 4; -! -temp++ ** 4; -! -temp-- ** 4; - -! --temp ** 3 ** 1; -! temp-- ** 3 ** 1; -! 3 ** 4 ** 1; -! temp++ ** 4 ** 1; -! temp-- ** 4 ** 1; -! -3 ** 4 ** 1; -! -++temp ** 4 ** 1; -! -temp++ ** 4 ** 1; -! -temp-- ** 4 ** 1; \ No newline at end of file +// @target:es7 + +var temp = 10; + +(-++temp) ** 3; +(+--temp) ** 3; +(-temp++) ** 3; +(+temp--) ** 3; +(-(1 ** ++temp)) ** 3; +(-(1 ** --temp)) ** 3; +(-(1 ** temp++)) ** 3; +(-(1 ** temp--)) ** 3; + +(-3) ** temp++; +(-3) ** temp--; +(-3) ** ++temp; +(-3) ** --temp; +(+3) ** temp++; +(+3) ** temp--; +(+3) ** ++temp; +(+3) ** --temp; +(-3) ** temp++ ** 2; +(-3) ** temp-- ** 2; +(-3) ** ++temp ** 2; +(-3) ** --temp ** 2; +(+3) ** temp++ ** 2; +(+3) ** temp-- ** 2; +(+3) ** ++temp ** 2; +(+3) ** --temp ** 2; + +3 ** -temp++; +3 ** -temp--; +3 ** -++temp; +3 ** +--temp; +3 ** (-temp++) ** 2; +3 ** (-temp--) ** 2; +3 ** (+temp++) ** 2; +3 ** (+temp--) ** 2; +3 ** (-++temp) ** 2; +3 ** (+--temp) ** 2; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts new file mode 100644 index 0000000000000..6788ab36f8651 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts @@ -0,0 +1,37 @@ +// @target: es5 +var temp: any; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; + +1 ** --temp ** 3; +1 ** ++temp ** 3; +1 ** temp-- ** 3; +1 ** temp++ ** 3; + +(void --temp) ** 3; +(void temp--) ** 3; +(void 3) ** 4; +(void temp++) ** 4; +(void temp--) ** 4; + + +1 ** (void --temp) ** 3; +1 ** (void temp--) ** 3; +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +1 ** (void temp--) ** 4; + +(~ --temp) ** 3; +(~ temp--) ** 3; +(~ 3) ** 4; +(~ temp++) ** 4; +(~ temp--) ** 4; + +1 ** (~ --temp) ** 3; +1 ** (~ temp--) ** 3; +1 ** (~ 3) ** 4; +1 ** (~ temp++) ** 4; +1 ** (~ temp--) ** 4; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts new file mode 100644 index 0000000000000..d3b718a20542e --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts @@ -0,0 +1,37 @@ +// @target: es7 +var temp: any; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; + +1 ** --temp ** 3; +1 ** ++temp ** 3; +1 ** temp-- ** 3; +1 ** temp++ ** 3; + +(void --temp) ** 3; +(void temp--) ** 3; +(void 3) ** 4; +(void temp++) ** 4; +(void temp--) ** 4; + + +1 ** (void --temp) ** 3; +1 ** (void temp--) ** 3; +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +1 ** (void temp--) ** 4; + +(~ --temp) ** 3; +(~temp--) ** 3; +(~3) ** 4; +(~temp++) ** 4; +(~temp--) ** 4; + +1 ** (~ --temp) ** 3; +1 ** (~temp--) ** 3; +1 ** (~3) ** 4; +1 ** (~temp++) ** 4; +1 ** (~temp--) ** 4; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4.ts new file mode 100644 index 0000000000000..104033ab57942 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4.ts @@ -0,0 +1,28 @@ +// @target: es5 + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** -t2} world`; +`${(-t1) ** t2 - t1} world`; +`${(-++t1) ** t2 - t1} world`; +`${(-t1++) ** t2 - t1} world`; +`${(~t1) ** t2 ** --t1 } world`; +`${typeof (t1 ** t2 ** t1) } world`; + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +`hello ${(-++t1) ** t2 - t1}`; +`hello ${(-t1++) ** t2 - t1}`; +`hello ${(~t1) ** t2 ** --t1 }`; +`hello ${typeof (t1 ** t2 ** t1)}`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4ES6.ts new file mode 100644 index 0000000000000..611860cc5efb1 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4ES6.ts @@ -0,0 +1,28 @@ +// @target: es6 + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** -t2} world`; +`${(-t1) ** t2 - t1} world`; +`${(-++t1) ** t2 - t1} world`; +`${(-t1++) ** t2 - t1} world`; +`${(~t1) ** t2 ** --t1 } world`; +`${typeof (t1 ** t2 ** t1) } world`; + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +`hello ${(-++t1) ** t2 - t1}`; +`hello ${(-t1++) ** t2 - t1}`; +`hello ${(~t1) ** t2 ** --t1 }`; +`hello ${typeof (t1 ** t2 ** t1)}`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts index 80fe91ee4628f..744e4ed2698fb 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts @@ -10,13 +10,7 @@ var s; `${t1 + t2 ** t1}`; `${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1 }`; -`${-t1 ** t2 - t1}`; -`${-++t1 ** t2 - t1}`; -`${-t1++ ** t2 - t1}`; -`${!t1 ** t2 ** --t1 }`; -`${typeof t1 ** t2 ** t1}`; `${typeof (t1 ** t2 ** t1) }`; -`${1 + typeof t1 ** t2 ** t1}`; `${1 + typeof (t1 ** t2 ** t1) }`; `${t1 ** t2}${t1 ** t2}`; @@ -24,23 +18,11 @@ var s; `${t1 + t2 ** t1}${t1 + t2 ** t1}`; `${t1 ** t2 + t1}${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; -`${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; -`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; -`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; -`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; -`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; `${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; -`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; `${t1 ** t2} hello world ${t1 ** t2}`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; -`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; -`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; -`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; -`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; -`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; -`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; -`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; \ No newline at end of file +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts index 70cdad5b98f0b..90a8b9b26f773 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts @@ -10,13 +10,7 @@ var s; `${t1 + t2 ** t1}`; `${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1 }`; -`${-t1 ** t2 - t1}`; -`${-++t1 ** t2 - t1}`; -`${-t1++ ** t2 - t1}`; -`${!t1 ** t2 ** --t1 }`; -`${typeof t1 ** t2 ** t1}`; `${typeof (t1 ** t2 ** t1) }`; -`${1 + typeof t1 ** t2 ** t1}`; `${1 + typeof (t1 ** t2 ** t1) }`; `${t1 ** t2}${t1 ** t2}`; @@ -24,23 +18,11 @@ var s; `${t1 + t2 ** t1}${t1 + t2 ** t1}`; `${t1 ** t2 + t1}${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; -`${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; -`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; -`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; -`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; -`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; `${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; -`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; `${t1 ** t2} hello world ${t1 ** t2}`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; -`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; -`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; -`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; -`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; -`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; -`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; -`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; \ No newline at end of file +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts index 3c3349879c315..0d5f2129861f7 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts @@ -10,13 +10,7 @@ var s; `hello ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1 }`; -`hello ${-t1 ** t2 - t1}`; -`hello ${-++t1 ** t2 - t1}`; -`hello ${-t1++ ** t2 - t1}`; -`hello ${!t1 ** t2 ** --t1 }`; -`hello ${typeof t1 ** t2 ** t1}`; `hello ${typeof (t1 ** t2 ** t1) }`; -`hello ${1 + typeof t1 ** t2 ** t1}`; `hello ${1 + typeof (t1 ** t2 ** t1) }`; `hello ${t1 ** t2}${t1 ** t2}`; @@ -24,23 +18,11 @@ var s; `hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; -`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; -`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; -`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; -`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; -`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; `hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; -`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; `hello ${t1 ** t2} hello world ${t1 ** t2}`; `hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; -`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; -`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; -`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; -`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; -`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; -`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; -`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts index 7268768f417ef..7f122d505e778 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts @@ -10,13 +10,7 @@ var s; `hello ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1 }`; -`hello ${-t1 ** t2 - t1}`; -`hello ${-++t1 ** t2 - t1}`; -`hello ${-t1++ ** t2 - t1}`; -`hello ${!t1 ** t2 ** --t1 }`; -`hello ${typeof t1 ** t2 ** t1}`; `hello ${typeof (t1 ** t2 ** t1) }`; -`hello ${1 + typeof t1 ** t2 ** t1}`; `hello ${1 + typeof (t1 ** t2 ** t1) }`; `hello ${t1 ** t2}${t1 ** t2}`; @@ -24,23 +18,11 @@ var s; `hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; -`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; -`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; -`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; -`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; -`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; `hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; -`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; `hello ${t1 ** t2} hello world ${t1 ** t2}`; `hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; -`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; -`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; -`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; -`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; -`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; -`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; -`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts index 8affe231586e5..73fc2fcd3a9cd 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts @@ -10,13 +10,7 @@ var s; `${t1 + t2 ** t1} world`; `${t1 ** t2 + t1} world`; `${t1 + t2 ** t2 + t1 } world`; -`${-t1 ** t2 - t1} world`; -`${-++t1 ** t2 - t1} world`; -`${-t1++ ** t2 - t1} world`; -`${!t1 ** t2 ** --t1 } world`; -`${typeof t1 ** t2 ** t1} world`; `${typeof (t1 ** t2 ** t1) } world`; -`${1 + typeof t1 ** t2 ** t1} world`; `${1 + typeof (t1 ** t2 ** t1) } world`; `${t1 ** t2}${t1 ** t2} world`; @@ -24,23 +18,11 @@ var s; `${t1 + t2 ** t1}${t1 + t2 ** t1} world`; `${t1 ** t2 + t1}${t1 ** t2 + t1} world`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; -`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; -`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; -`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; -`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; -`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; `${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; -`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; `${t1 ** t2} hello world ${t1 ** t2} !!`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; -`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; -`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; -`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; -`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; -`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; -`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts index 9c54478708e82..724039acfb2fe 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts @@ -10,13 +10,7 @@ var s; `${t1 + t2 ** t1} world`; `${t1 ** t2 + t1} world`; `${t1 + t2 ** t2 + t1 } world`; -`${-t1 ** t2 - t1} world`; -`${-++t1 ** t2 - t1} world`; -`${-t1++ ** t2 - t1} world`; -`${!t1 ** t2 ** --t1 } world`; -`${typeof t1 ** t2 ** t1} world`; `${typeof (t1 ** t2 ** t1) } world`; -`${1 + typeof t1 ** t2 ** t1} world`; `${1 + typeof (t1 ** t2 ** t1) } world`; `${t1 ** t2}${t1 ** t2} world`; @@ -24,23 +18,11 @@ var s; `${t1 + t2 ** t1}${t1 + t2 ** t1} world`; `${t1 ** t2 + t1}${t1 ** t2 + t1} world`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; -`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; -`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; -`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; -`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; -`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; `${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; -`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; `${t1 ** t2} hello world ${t1 ** t2} !!`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; -`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; -`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; -`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; -`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; -`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; -`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts new file mode 100644 index 0000000000000..d61d3c0745030 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts @@ -0,0 +1,28 @@ +// @target: es5 + +var t1 = 10; +var t2 = 10; +var s; + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// TempateHead & TemplateTail are empty +`${1 + typeof t1 ** t2 ** t1}`; +`${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}`; + +`${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts new file mode 100644 index 0000000000000..c7ee30a95b836 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts @@ -0,0 +1,28 @@ +// @target: es5 + +var t1 = 10; +var t2 = 10; +var s; + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// With templateHead +`hello ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof t1 ** t2 ** t1}`; + +`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts new file mode 100644 index 0000000000000..18ba31f89658c --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts @@ -0,0 +1,28 @@ +// @target: es5 + +var t1 = 10; +var t2 = 10; +var s; + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// With TemplateTail +`${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1} world`; +`${1 + typeof t1 ** t2 ** t1} world`; + +`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; + +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts new file mode 100644 index 0000000000000..a70948c23e239 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts @@ -0,0 +1,39 @@ +// @target: es5 + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +-1 ** 2; ++1 ** 2 +1 ** -2 ** 3; +1 ** -2 ** -3; +-1 ** -2 ** -3; +-(1 ** 2) ** 3; + +var temp = 10; + +-++temp ** 3; ++--temp ** 3; +-temp++ ** 3; ++temp-- ** 3; +1 ** -++temp ** 3; +1 ** +--temp ** 3; +1 ** -temp++ ** 3; +1 ** +temp-- ** 3; + +-3 ** temp++; +-3 ** temp--; +-3 ** ++temp; +-3 ** --temp; ++3 ** temp++; ++3 ** temp--; ++3 ** ++temp; ++3 ** --temp; +-3 ** temp++ ** 2; +-3 ** temp-- ** 2; +-3 ** ++temp ** 2; +-3 ** --temp ** 2; ++3 ** temp++ ** 2; ++3 ** temp-- ** 2; ++3 ** ++temp ** 2; ++3 ** --temp ** 2; + + diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts new file mode 100644 index 0000000000000..da7cf7f0d8580 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts @@ -0,0 +1,63 @@ +// @target: es5 + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +var temp; + +delete --temp ** 3; +delete ++temp ** 3; +delete temp-- ** 3; +delete temp++ ** 3; + + +1 ** delete --temp ** 3; +1 ** delete ++temp ** 3; +1 ** delete temp-- ** 3; +1 ** delete temp++ ** 3; + +typeof --temp ** 3; +typeof temp-- ** 3; +typeof 3 ** 4; +typeof temp++ ** 4; +typeof temp-- ** 4; + +1 ** typeof --temp ** 3; +1 ** typeof temp-- ** 3; +1 ** typeof 3 ** 4; +1 ** typeof temp++ ** 4; +1 ** typeof temp-- ** 4; + +void --temp ** 3; +void temp-- ** 3; +void 3 ** 4; +void temp++ ** 4; +void temp-- ** 4; + +1 ** void --temp ** 3; +1 ** void temp-- ** 3; +1 ** void 3 ** 4; +1 ** void temp++ ** 4; +1 ** void temp-- ** 4 ; + +~ --temp ** 3; +~temp-- ** 3; +~3 ** 4; +~temp++ ** 4; +~temp-- ** 4; + +1 ** ~ --temp ** 3; +1 ** ~temp-- ** 3; +1 ** ~3 ** 4; +1 ** ~temp++ ** 4; +1 ** ~temp-- ** 4; + +! --temp ** 3; +!temp-- ** 3; +!3 ** 4; +!temp++ ** 4; +!temp-- ** 4; + +1 ** ! --temp ** 3; +1 ** !temp-- ** 3; +1 ** !3 ** 4; +1 ** !temp++ ** 4; +1 ** !temp-- ** 4; diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts new file mode 100644 index 0000000000000..77d7c8b668ac0 --- /dev/null +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts @@ -0,0 +1,36 @@ +var temp: any; + +// Error: incorrect type on left-hand side +(! --temp) ** 3; +(!temp--) ** 3; +(!3) ** 4; +(!temp++) ** 4; +(!temp--) ** 4; + +(! --temp) ** 3 ** 1; +(!temp--) ** 3 ** 1; +(!3) ** 4 ** 1; +(!temp++) ** 4 ** 1; +(!temp--) ** 4 ** 1; + +(typeof --temp) ** 3; +(typeof temp--) ** 3; +(typeof 3) ** 4; +(typeof temp++) ** 4; +(typeof temp--) ** 4; + +1 ** (typeof --temp) ** 3; +1 ** (typeof temp--) ** 3; +1 ** (typeof 3) ** 4; +1 ** (typeof temp++) ** 4; +1 ** (typeof temp--) ** 4; + +(delete --temp) ** 3; +(delete ++temp) ** 3; +(delete temp--) ** 3; +(delete temp++) ** 3; + +1 ** (delete --temp) ** 3; +1 ** (delete ++temp) ** 3; +1 ** (delete temp--) ** 3; +1 ** (delete temp++) ** 3; \ No newline at end of file From f8d6b344ee5eebcd951c0b2b3c3acd289614c2b3 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:03:41 -0700 Subject: [PATCH 20/39] Update baselines for exponentiation compound operator with indexing and property assignment --- ...dExponentiationAssignmentLHSIsReference.js | 5 +- ...poundExponentiationAssignmentLHSIsValue.js | 9 +- ...onentiationAssignmentWithIndexingOnLHS1.js | 32 ++++++ ...iationAssignmentWithIndexingOnLHS1.symbols | 51 +++++++++ ...ntiationAssignmentWithIndexingOnLHS1.types | 100 ++++++++++++++++++ ...onentiationAssignmentWithIndexingOnLHS2.js | 26 +++++ ...iationAssignmentWithIndexingOnLHS2.symbols | 51 +++++++++ ...ntiationAssignmentWithIndexingOnLHS2.types | 94 ++++++++++++++++ ...onentiationAssignmentWithIndexingOnLHS3.js | 29 +++++ ...iationAssignmentWithIndexingOnLHS3.symbols | 37 +++++++ ...ntiationAssignmentWithIndexingOnLHS3.types | 60 +++++++++++ ...onentiationAssignmentWithIndexingOnLHS4.js | 29 +++++ ...iationAssignmentWithIndexingOnLHS4.symbols | 60 +++++++++++ ...ntiationAssignmentWithIndexingOnLHS4.types | 90 ++++++++++++++++ ...onAssignmentWithPropertyAccessingOnLHS1.js | 27 +++++ ...ignmentWithPropertyAccessingOnLHS1.symbols | 59 +++++++++++ ...ssignmentWithPropertyAccessingOnLHS1.types | 90 ++++++++++++++++ 17 files changed, 844 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js index 1d43494f3672f..cca4a7b55bf9f 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js @@ -36,8 +36,8 @@ function fn1(x2) { } // property accesses var x3; -x3.a = Math.pow(x3.a, value); -x3['a'] = Math.pow(x3['a'], value); +_a = x3, _a.a = Math.pow(_a.a, value); +_b = x3, _b['a'] = Math.pow(_b['a'], value); // parentheses, the contained expression is reference (x1) = Math.pow((x1), value); function fn2(x4) { @@ -45,3 +45,4 @@ function fn2(x4) { } (x3.a) = Math.pow((x3.a), value); (x3['a']) = Math.pow((x3['a']), value); +var _a, _b; diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index d638984ec3779..ed825904d7a93 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -140,13 +140,16 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { _super.call(this); - _super.prototype. = Math.pow(_super.prototype., value); + _a = _super.prototype, _a. = Math.pow(_a., value); + var _a; } Derived.prototype.foo = function () { - _super.prototype. = Math.pow(_super.prototype., value); + _a = _super.prototype, _a. = Math.pow(_a., value); + var _a; }; Derived.sfoo = function () { - _super. = Math.pow(_super., value); + _a = _super, _a. = Math.pow(_a., value); + var _a; }; return Derived; })(C); diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js new file mode 100644 index 0000000000000..fb2a7d5a88d7b --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js @@ -0,0 +1,32 @@ +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts] + +var array0 = [1, 2, 3] +var i0 = 0; +array0[++i0] **= 2; + +var array1 = [1, 2, 3] +var i1 = 0; +array1[++i1] **= array1[++i1] **= 2; + +var array2 = [1, 2, 3] +var i2 = 0; +array2[++i2] **= array2[++i2] ** 2; + +var array3 = [2, 2, 3]; +var j0 = 0, j1 = 1; +array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; + +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js] +var array0 = [1, 2, 3]; +var i0 = 0; +_a = array0, _i = ++i0, _a[_i] = Math.pow(_a[_i], 2); +var array1 = [1, 2, 3]; +var i1 = 0; +_b = array1, _c = ++i1, _b[_c] = Math.pow(_b[_c], (_d = array1, _e = ++i1, _d[_e] = Math.pow(_d[_e], 2))); +var array2 = [1, 2, 3]; +var i2 = 0; +_f = array2, _g = ++i2, _f[_g] = Math.pow(_f[_g], Math.pow(array2[++i2], 2)); +var array3 = [2, 2, 3]; +var j0 = 0, j1 = 1; +_h = array3, _j = j0++, _h[_j] = Math.pow(_h[_j], (_k = array3, _l = j1++, _k[_l] = Math.pow(_k[_l], (_m = array3, _o = j0++, _m[_o] = Math.pow(_m[_o], 1))))); +var _a, _i, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.symbols new file mode 100644 index 0000000000000..83f71871ec016 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts === + +var array0 = [1, 2, 3] +>array0 : Symbol(array0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 1, 3)) + +var i0 = 0; +>i0 : Symbol(i0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 2, 3)) + +array0[++i0] **= 2; +>array0 : Symbol(array0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 1, 3)) +>i0 : Symbol(i0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 2, 3)) + +var array1 = [1, 2, 3] +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 5, 3)) + +var i1 = 0; +>i1 : Symbol(i1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 6, 3)) + +array1[++i1] **= array1[++i1] **= 2; +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 5, 3)) +>i1 : Symbol(i1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 6, 3)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 5, 3)) +>i1 : Symbol(i1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 6, 3)) + +var array2 = [1, 2, 3] +>array2 : Symbol(array2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 9, 3)) + +var i2 = 0; +>i2 : Symbol(i2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 10, 3)) + +array2[++i2] **= array2[++i2] ** 2; +>array2 : Symbol(array2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 9, 3)) +>i2 : Symbol(i2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 10, 3)) +>array2 : Symbol(array2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 9, 3)) +>i2 : Symbol(i2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 10, 3)) + +var array3 = [2, 2, 3]; +>array3 : Symbol(array3, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 13, 3)) + +var j0 = 0, j1 = 1; +>j0 : Symbol(j0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 14, 3)) +>j1 : Symbol(j1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 14, 11)) + +array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; +>array3 : Symbol(array3, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 13, 3)) +>j0 : Symbol(j0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 14, 3)) +>array3 : Symbol(array3, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 13, 3)) +>j1 : Symbol(j1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 14, 11)) +>array3 : Symbol(array3, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 13, 3)) +>j0 : Symbol(j0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts, 14, 3)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types new file mode 100644 index 0000000000000..393499a931f7d --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types @@ -0,0 +1,100 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts === + +var array0 = [1, 2, 3] +>array0 : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var i0 = 0; +>i0 : number +>0 : number + +array0[++i0] **= 2; +>array0[++i0] **= 2 : number +>array0[++i0] : number +>array0 : number[] +>++i0 : number +>i0 : number +>2 : number + +var array1 = [1, 2, 3] +>array1 : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var i1 = 0; +>i1 : number +>0 : number + +array1[++i1] **= array1[++i1] **= 2; +>array1[++i1] **= array1[++i1] **= 2 : number +>array1[++i1] : number +>array1 : number[] +>++i1 : number +>i1 : number +>array1[++i1] **= 2 : number +>array1[++i1] : number +>array1 : number[] +>++i1 : number +>i1 : number +>2 : number + +var array2 = [1, 2, 3] +>array2 : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var i2 = 0; +>i2 : number +>0 : number + +array2[++i2] **= array2[++i2] ** 2; +>array2[++i2] **= array2[++i2] ** 2 : number +>array2[++i2] : number +>array2 : number[] +>++i2 : number +>i2 : number +>array2[++i2] ** 2 : number +>array2[++i2] : number +>array2 : number[] +>++i2 : number +>i2 : number +>2 : number + +var array3 = [2, 2, 3]; +>array3 : number[] +>[2, 2, 3] : number[] +>2 : number +>2 : number +>3 : number + +var j0 = 0, j1 = 1; +>j0 : number +>0 : number +>j1 : number +>1 : number + +array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; +>array3[j0++] **= array3[j1++] **= array3[j0++] **= 1 : number +>array3[j0++] : number +>array3 : number[] +>j0++ : number +>j0 : number +>array3[j1++] **= array3[j0++] **= 1 : number +>array3[j1++] : number +>array3 : number[] +>j1++ : number +>j1 : number +>array3[j0++] **= 1 : number +>array3[j0++] : number +>array3 : number[] +>j0++ : number +>j0 : number +>1 : number + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js new file mode 100644 index 0000000000000..e2392e4074bef --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js @@ -0,0 +1,26 @@ +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts] +var globalCounter = 0; +function foo() { + globalCounter += 1; + return { 0: 2 }; +} +foo()[0] **= foo()[0]; +var result_foo1 = foo()[0] **= foo()[0]; +foo()[0] **= foo()[0] **= 2; +var result_foo2 = foo()[0] **= foo()[0] **= 2; +foo()[0] **= foo()[0] ** 2; +var result_foo3 = foo()[0] **= foo()[0] ** 2; + +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js] +var globalCounter = 0; +function foo() { + globalCounter += 1; + return { 0: 2 }; +} +_a = foo(), _a[0] = Math.pow(_a[0], foo()[0]); +var result_foo1 = (_b = foo(), _b[0] = Math.pow(_b[0], foo()[0])); +_c = foo(), _c[0] = Math.pow(_c[0], (_d = foo(), _d[0] = Math.pow(_d[0], 2))); +var result_foo2 = (_e = foo(), _e[0] = Math.pow(_e[0], (_f = foo(), _f[0] = Math.pow(_f[0], 2)))); +_g = foo(), _g[0] = Math.pow(_g[0], Math.pow(foo()[0], 2)); +var result_foo3 = (_h = foo(), _h[0] = Math.pow(_h[0], Math.pow(foo()[0], 2))); +var _a, _b, _c, _d, _e, _f, _g, _h; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.symbols new file mode 100644 index 0000000000000..923c0bac1ef48 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts === +var globalCounter = 0; +>globalCounter : Symbol(globalCounter, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 3)) + +function foo() { +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) + + globalCounter += 1; +>globalCounter : Symbol(globalCounter, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 3)) + + return { 0: 2 }; +} +foo()[0] **= foo()[0]; +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) + +var result_foo1 = foo()[0] **= foo()[0]; +>result_foo1 : Symbol(result_foo1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 6, 3)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) + +foo()[0] **= foo()[0] **= 2; +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) + +var result_foo2 = foo()[0] **= foo()[0] **= 2; +>result_foo2 : Symbol(result_foo2, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 8, 3)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) + +foo()[0] **= foo()[0] ** 2; +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) + +var result_foo3 = foo()[0] **= foo()[0] ** 2; +>result_foo3 : Symbol(result_foo3, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 10, 3)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 0, 22)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts, 3, 12)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types new file mode 100644 index 0000000000000..c47f539baf203 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types @@ -0,0 +1,94 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts === +var globalCounter = 0; +>globalCounter : number +>0 : number + +function foo() { +>foo : () => { 0: number; } + + globalCounter += 1; +>globalCounter += 1 : number +>globalCounter : number +>1 : number + + return { 0: 2 }; +>{ 0: 2 } : { 0: number; } +>2 : number +} +foo()[0] **= foo()[0]; +>foo()[0] **= foo()[0] : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number + +var result_foo1 = foo()[0] **= foo()[0]; +>result_foo1 : number +>foo()[0] **= foo()[0] : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number + +foo()[0] **= foo()[0] **= 2; +>foo()[0] **= foo()[0] **= 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>foo()[0] **= 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>2 : number + +var result_foo2 = foo()[0] **= foo()[0] **= 2; +>result_foo2 : number +>foo()[0] **= foo()[0] **= 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>foo()[0] **= 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>2 : number + +foo()[0] **= foo()[0] ** 2; +>foo()[0] **= foo()[0] ** 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>foo()[0] ** 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>2 : number + +var result_foo3 = foo()[0] **= foo()[0] ** 2; +>result_foo3 : number +>foo()[0] **= foo()[0] ** 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>foo()[0] ** 2 : number +>foo()[0] : number +>foo() : { 0: number; } +>foo : () => { 0: number; } +>0 : number +>2 : number + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js new file mode 100644 index 0000000000000..b4b8a8a1b1fe2 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js @@ -0,0 +1,29 @@ +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts] + +var object = { + _0: 2, + get 0() { + return this._0; + }, + set 0(x: number) { + this._0 = x; + }, +} +object[0] **= object[0]; +object[0] **= object[0] **= 2; +object[0] **= object[0] ** 2; + +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js] +var object = { + _0: 2, + get 0() { + return this._0; + }, + set 0(x) { + this._0 = x; + }, +}; +_a = object, _a[0] = Math.pow(_a[0], object[0]); +_b = object, _b[0] = Math.pow(_b[0], (_c = object, _c[0] = Math.pow(_c[0], 2))); +_d = object, _d[0] = Math.pow(_d[0], Math.pow(object[0], 2)); +var _a, _b, _c, _d; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols new file mode 100644 index 0000000000000..dbd5aa150dc5e --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts === + +var object = { +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) + + _0: 2, +>_0 : Symbol(_0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 14)) + + get 0() { + return this._0; + }, + set 0(x: number) { +>x : Symbol(x, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 6, 10)) + + this._0 = x; +>x : Symbol(x, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 6, 10)) + + }, +} +object[0] **= object[0]; +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 2, 10), Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 5, 6)) +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 2, 10), Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 5, 6)) + +object[0] **= object[0] **= 2; +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 2, 10), Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 5, 6)) +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 2, 10), Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 5, 6)) + +object[0] **= object[0] ** 2; +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 2, 10), Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 5, 6)) +>object : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 3)) +>0 : Symbol(0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 2, 10), Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 5, 6)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types new file mode 100644 index 0000000000000..1877f3912070c --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types @@ -0,0 +1,60 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts === + +var object = { +>object : { 0: number; _0: number; } +>{ _0: 2, get 0() { return this._0; }, set 0(x: number) { this._0 = x; },} : { 0: number; _0: number; } + + _0: 2, +>_0 : number +>2 : number + + get 0() { + return this._0; +>this._0 : any +>this : any +>_0 : any + + }, + set 0(x: number) { +>x : number + + this._0 = x; +>this._0 = x : number +>this._0 : any +>this : any +>_0 : any +>x : number + + }, +} +object[0] **= object[0]; +>object[0] **= object[0] : number +>object[0] : number +>object : { 0: number; _0: number; } +>0 : number +>object[0] : number +>object : { 0: number; _0: number; } +>0 : number + +object[0] **= object[0] **= 2; +>object[0] **= object[0] **= 2 : number +>object[0] : number +>object : { 0: number; _0: number; } +>0 : number +>object[0] **= 2 : number +>object[0] : number +>object : { 0: number; _0: number; } +>0 : number +>2 : number + +object[0] **= object[0] ** 2; +>object[0] **= object[0] ** 2 : number +>object[0] : number +>object : { 0: number; _0: number; } +>0 : number +>object[0] ** 2 : number +>object[0] : number +>object : { 0: number; _0: number; } +>0 : number +>2 : number + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js new file mode 100644 index 0000000000000..001f970b0d363 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js @@ -0,0 +1,29 @@ +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts] + +var globalCounter = 0; +function incrementIdx(max: number) { + globalCounter += 1; + let idx = Math.floor(Math.random() * max); + return idx; +} + +var array1 = [1, 2, 3, 4, 5]; + +array1[incrementIdx(array1.length)] **= 3; + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; + +//// [emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js] +var globalCounter = 0; +function incrementIdx(max) { + globalCounter += 1; + var idx = Math.floor(Math.random() * max); + return idx; +} +var array1 = [1, 2, 3, 4, 5]; +_a = array1, _i = incrementIdx(array1.length), _a[_i] = Math.pow(_a[_i], 3); +_b = array1, _c = incrementIdx(array1.length), _b[_c] = Math.pow(_b[_c], (_d = array1, _e = incrementIdx(array1.length), _d[_e] = Math.pow(_d[_e], 2))); +_f = array1, _g = incrementIdx(array1.length), _f[_g] = Math.pow(_f[_g], Math.pow(array1[incrementIdx(array1.length)], 2)); +var _a, _i, _b, _c, _d, _e, _f, _g; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols new file mode 100644 index 0000000000000..5213a451d39bf --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts === + +var globalCounter = 0; +>globalCounter : Symbol(globalCounter, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 3)) + +function incrementIdx(max: number) { +>incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) +>max : Symbol(max, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 2, 22)) + + globalCounter += 1; +>globalCounter : Symbol(globalCounter, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 3)) + + let idx = Math.floor(Math.random() * max); +>idx : Symbol(idx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 4, 7)) +>Math.floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>max : Symbol(max, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 2, 22)) + + return idx; +>idx : Symbol(idx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 4, 7)) +} + +var array1 = [1, 2, 3, 4, 5]; +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) + +array1[incrementIdx(array1.length)] **= 3; +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types new file mode 100644 index 0000000000000..abfc69d7ca61c --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types @@ -0,0 +1,90 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts === + +var globalCounter = 0; +>globalCounter : number +>0 : number + +function incrementIdx(max: number) { +>incrementIdx : (max: number) => number +>max : number + + globalCounter += 1; +>globalCounter += 1 : number +>globalCounter : number +>1 : number + + let idx = Math.floor(Math.random() * max); +>idx : number +>Math.floor(Math.random() * max) : number +>Math.floor : (x: number) => number +>Math : Math +>floor : (x: number) => number +>Math.random() * max : number +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>max : number + + return idx; +>idx : number +} + +var array1 = [1, 2, 3, 4, 5]; +>array1 : number[] +>[1, 2, 3, 4, 5] : number[] +>1 : number +>2 : number +>3 : number +>4 : number +>5 : number + +array1[incrementIdx(array1.length)] **= 3; +>array1[incrementIdx(array1.length)] **= 3 : number +>array1[incrementIdx(array1.length)] : number +>array1 : number[] +>incrementIdx(array1.length) : number +>incrementIdx : (max: number) => number +>array1.length : number +>array1 : number[] +>length : number +>3 : number + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; +>array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2 : number +>array1[incrementIdx(array1.length)] : number +>array1 : number[] +>incrementIdx(array1.length) : number +>incrementIdx : (max: number) => number +>array1.length : number +>array1 : number[] +>length : number +>array1[incrementIdx(array1.length)] **= 2 : number +>array1[incrementIdx(array1.length)] : number +>array1 : number[] +>incrementIdx(array1.length) : number +>incrementIdx : (max: number) => number +>array1.length : number +>array1 : number[] +>length : number +>2 : number + +array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; +>array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2 : number +>array1[incrementIdx(array1.length)] : number +>array1 : number[] +>incrementIdx(array1.length) : number +>incrementIdx : (max: number) => number +>array1.length : number +>array1 : number[] +>length : number +>array1[incrementIdx(array1.length)] ** 2 : number +>array1[incrementIdx(array1.length)] : number +>array1 : number[] +>incrementIdx(array1.length) : number +>incrementIdx : (max: number) => number +>array1.length : number +>array1 : number[] +>length : number +>2 : number + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js new file mode 100644 index 0000000000000..5f51b432e20c4 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js @@ -0,0 +1,27 @@ +//// [emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts] + +var globalCounter = 0; +function foo() { + globalCounter += 1; + return { prop: 2 }; +} +foo().prop **= 2; +var result0 = foo().prop **= 2; +foo().prop **= foo().prop **= 2; +var result1 = foo().prop **= foo().prop **= 2; +foo().prop **= foo().prop ** 2; +var result2 = foo().prop **= foo().prop ** 2; + +//// [emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js] +var globalCounter = 0; +function foo() { + globalCounter += 1; + return { prop: 2 }; +} +_a = foo(), _a.prop = Math.pow(_a.prop, 2); +var result0 = (_b = foo(), _b.prop = Math.pow(_b.prop, 2)); +_c = foo(), _c.prop = Math.pow(_c.prop, (_d = foo(), _d.prop = Math.pow(_d.prop, 2))); +var result1 = (_e = foo(), _e.prop = Math.pow(_e.prop, (_f = foo(), _f.prop = Math.pow(_f.prop, 2)))); +_g = foo(), _g.prop = Math.pow(_g.prop, Math.pow(foo().prop, 2)); +var result2 = (_h = foo(), _h.prop = Math.pow(_h.prop, Math.pow(foo().prop, 2))); +var _a, _b, _c, _d, _e, _f, _g, _h; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.symbols new file mode 100644 index 0000000000000..6bdf5f331fb33 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts === + +var globalCounter = 0; +>globalCounter : Symbol(globalCounter, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 3)) + +function foo() { +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) + + globalCounter += 1; +>globalCounter : Symbol(globalCounter, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 3)) + + return { prop: 2 }; +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +} +foo().prop **= 2; +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) + +var result0 = foo().prop **= 2; +>result0 : Symbol(result0, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 7, 3)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) + +foo().prop **= foo().prop **= 2; +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) + +var result1 = foo().prop **= foo().prop **= 2; +>result1 : Symbol(result1, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 9, 3)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) + +foo().prop **= foo().prop ** 2; +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) + +var result2 = foo().prop **= foo().prop ** 2; +>result2 : Symbol(result2, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 11, 3)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo().prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) +>foo : Symbol(foo, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 1, 22)) +>prop : Symbol(prop, Decl(emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts, 4, 12)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types new file mode 100644 index 0000000000000..b57878e9443e0 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types @@ -0,0 +1,90 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts === + +var globalCounter = 0; +>globalCounter : number +>0 : number + +function foo() { +>foo : () => { prop: number; } + + globalCounter += 1; +>globalCounter += 1 : number +>globalCounter : number +>1 : number + + return { prop: 2 }; +>{ prop: 2 } : { prop: number; } +>prop : number +>2 : number +} +foo().prop **= 2; +>foo().prop **= 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>2 : number + +var result0 = foo().prop **= 2; +>result0 : number +>foo().prop **= 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>2 : number + +foo().prop **= foo().prop **= 2; +>foo().prop **= foo().prop **= 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>foo().prop **= 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>2 : number + +var result1 = foo().prop **= foo().prop **= 2; +>result1 : number +>foo().prop **= foo().prop **= 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>foo().prop **= 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>2 : number + +foo().prop **= foo().prop ** 2; +>foo().prop **= foo().prop ** 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>foo().prop ** 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>2 : number + +var result2 = foo().prop **= foo().prop ** 2; +>result2 : number +>foo().prop **= foo().prop ** 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>foo().prop ** 2 : number +>foo().prop : number +>foo() : { prop: number; } +>foo : () => { prop: number; } +>prop : number +>2 : number + From bf970be0b3de1674f2d6fe41719fea8d9b613ba4 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:05:14 -0700 Subject: [PATCH 21/39] Add baselines for downlevel emit exponentiation and ES7 emit of exponentiation --- .../emitCompoundExponentiationOperator1ES7.js | 43 + ...CompoundExponentiationOperator1ES7.symbols | 83 ++ ...itCompoundExponentiationOperator1ES7.types | 171 ++++ .../emitCompoundExponentiationOperator2ES7.js | 47 + ...CompoundExponentiationOperator2ES7.symbols | 76 ++ ...itCompoundExponentiationOperator2ES7.types | 185 ++++ .../reference/emitExponentiationOperator1.js | 18 +- .../emitExponentiationOperator1.symbols | 9 +- .../emitExponentiationOperator1.types | 54 +- .../emitExponentiationOperator1ES7.js | 62 ++ .../emitExponentiationOperator1ES7.symbols | 34 + .../emitExponentiationOperator1ES7.types | 207 ++++ .../reference/emitExponentiationOperator2.js | 45 +- .../emitExponentiationOperator2.symbols | 60 +- .../emitExponentiationOperator2.types | 162 +-- .../emitExponentiationOperator2ES7.js | 104 ++ .../emitExponentiationOperator2ES7.symbols | 152 +++ .../emitExponentiationOperator2ES7.types | 344 +++++++ .../reference/emitExponentiationOperator3.js | 282 ++---- .../emitExponentiationOperator3.symbols | 305 ++---- .../emitExponentiationOperator3.types | 950 ++++-------------- .../emitExponentiationOperator3ES7.js | 78 ++ .../emitExponentiationOperator3ES7.symbols | 107 ++ .../emitExponentiationOperator3ES7.types | 314 ++++++ .../reference/emitExponentiationOperator4.js | 68 ++ .../emitExponentiationOperator4.symbols | 81 ++ .../emitExponentiationOperator4.types | 245 +++++ .../emitExponentiationOperator4ES7.js | 68 ++ .../emitExponentiationOperator4ES7.symbols | 81 ++ .../emitExponentiationOperator4ES7.types | 245 +++++ 30 files changed, 3215 insertions(+), 1465 deletions(-) create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols create mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types create mode 100644 tests/baselines/reference/emitExponentiationOperator1ES7.js create mode 100644 tests/baselines/reference/emitExponentiationOperator1ES7.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator1ES7.types create mode 100644 tests/baselines/reference/emitExponentiationOperator2ES7.js create mode 100644 tests/baselines/reference/emitExponentiationOperator2ES7.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator2ES7.types create mode 100644 tests/baselines/reference/emitExponentiationOperator3ES7.js create mode 100644 tests/baselines/reference/emitExponentiationOperator3ES7.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator3ES7.types create mode 100644 tests/baselines/reference/emitExponentiationOperator4.js create mode 100644 tests/baselines/reference/emitExponentiationOperator4.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator4.types create mode 100644 tests/baselines/reference/emitExponentiationOperator4ES7.js create mode 100644 tests/baselines/reference/emitExponentiationOperator4ES7.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperator4ES7.types diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js new file mode 100644 index 0000000000000..a1039555694cc --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js @@ -0,0 +1,43 @@ +//// [emitCompoundExponentiationOperator1ES7.ts] + +var comp: number; + +comp **= 1; +comp **= comp ** comp; +comp **= comp ** comp ** 2; +comp **= comp ** comp + 2; +comp **= comp ** comp - 2; +comp **= comp ** comp * 2; +comp **= comp ** comp / 2; +comp **= comp ** comp % 2; +comp **= (comp - 2) ** 5; +comp **= (comp + 2) ** 5; +comp **= (comp * 2) ** 5; +comp **= (comp / 2) ** 5; +comp **= (comp % 2) ** 5; +comp **= comp ** (5 + 2); +comp **= comp ** (5 - 2); +comp **= comp ** (5 * 2); +comp **= comp ** (5 / 2); +comp **= comp ** (5 % 2); + +//// [emitCompoundExponentiationOperator1ES7.js] +var comp; +comp **= 1; +comp **= comp ** comp; +comp **= comp ** comp ** 2; +comp **= comp ** comp + 2; +comp **= comp ** comp - 2; +comp **= comp ** comp * 2; +comp **= comp ** comp / 2; +comp **= comp ** comp % 2; +comp **= (comp - 2) ** 5; +comp **= (comp + 2) ** 5; +comp **= (comp * 2) ** 5; +comp **= (comp / 2) ** 5; +comp **= (comp % 2) ** 5; +comp **= comp ** (5 + 2); +comp **= comp ** (5 - 2); +comp **= comp ** (5 * 2); +comp **= comp ** (5 / 2); +comp **= comp ** (5 % 2); diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols new file mode 100644 index 0000000000000..07037222df828 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols @@ -0,0 +1,83 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts === + +var comp: number; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= 1; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp ** 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp + 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp - 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp * 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp / 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** comp % 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= (comp - 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= (comp + 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= (comp * 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= (comp / 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= (comp % 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** (5 + 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** (5 - 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** (5 * 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** (5 / 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + +comp **= comp ** (5 % 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types new file mode 100644 index 0000000000000..6937e381a2262 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types @@ -0,0 +1,171 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts === + +var comp: number; +>comp : number + +comp **= 1; +>comp **= 1 : number +>comp : number +>1 : number + +comp **= comp ** comp; +>comp **= comp ** comp : number +>comp : number +>comp ** comp : number +>comp : number +>comp : number + +comp **= comp ** comp ** 2; +>comp **= comp ** comp ** 2 : number +>comp : number +>comp ** comp ** 2 : number +>comp : number +>comp ** 2 : number +>comp : number +>2 : number + +comp **= comp ** comp + 2; +>comp **= comp ** comp + 2 : number +>comp : number +>comp ** comp + 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp - 2; +>comp **= comp ** comp - 2 : number +>comp : number +>comp ** comp - 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp * 2; +>comp **= comp ** comp * 2 : number +>comp : number +>comp ** comp * 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp / 2; +>comp **= comp ** comp / 2 : number +>comp : number +>comp ** comp / 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= comp ** comp % 2; +>comp **= comp ** comp % 2 : number +>comp : number +>comp ** comp % 2 : number +>comp ** comp : number +>comp : number +>comp : number +>2 : number + +comp **= (comp - 2) ** 5; +>comp **= (comp - 2) ** 5 : number +>comp : number +>(comp - 2) ** 5 : number +>(comp - 2) : number +>comp - 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp + 2) ** 5; +>comp **= (comp + 2) ** 5 : number +>comp : number +>(comp + 2) ** 5 : number +>(comp + 2) : number +>comp + 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp * 2) ** 5; +>comp **= (comp * 2) ** 5 : number +>comp : number +>(comp * 2) ** 5 : number +>(comp * 2) : number +>comp * 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp / 2) ** 5; +>comp **= (comp / 2) ** 5 : number +>comp : number +>(comp / 2) ** 5 : number +>(comp / 2) : number +>comp / 2 : number +>comp : number +>2 : number +>5 : number + +comp **= (comp % 2) ** 5; +>comp **= (comp % 2) ** 5 : number +>comp : number +>(comp % 2) ** 5 : number +>(comp % 2) : number +>comp % 2 : number +>comp : number +>2 : number +>5 : number + +comp **= comp ** (5 + 2); +>comp **= comp ** (5 + 2) : number +>comp : number +>comp ** (5 + 2) : number +>comp : number +>(5 + 2) : number +>5 + 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 - 2); +>comp **= comp ** (5 - 2) : number +>comp : number +>comp ** (5 - 2) : number +>comp : number +>(5 - 2) : number +>5 - 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 * 2); +>comp **= comp ** (5 * 2) : number +>comp : number +>comp ** (5 * 2) : number +>comp : number +>(5 * 2) : number +>5 * 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 / 2); +>comp **= comp ** (5 / 2) : number +>comp : number +>comp ** (5 / 2) : number +>comp : number +>(5 / 2) : number +>5 / 2 : number +>5 : number +>2 : number + +comp **= comp ** (5 % 2); +>comp **= comp ** (5 % 2) : number +>comp : number +>comp ** (5 % 2) : number +>comp : number +>(5 % 2) : number +>5 % 2 : number +>5 : number +>2 : number + diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js new file mode 100644 index 0000000000000..ac504150becd3 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js @@ -0,0 +1,47 @@ +//// [emitCompoundExponentiationOperator2ES7.ts] + +var comp: number; + +comp **= 1; +comp **= comp **= 1; +comp **= comp **= 1 + 2; +comp **= comp **= 1 - 2; +comp **= comp **= 1 * 2; +comp **= comp **= 1 / 2; + +comp **= comp **= (1 + 2); +comp **= comp **= (1 - 2); +comp **= comp **= (1 * 2); +comp **= comp **= (1 / 2); + +comp **= comp **= 1 + 2 ** 3; +comp **= comp **= 1 - 2 ** 4; +comp **= comp **= 1 * 2 ** 5; +comp **= comp **= 1 / 2 ** 6; + +comp **= comp **= (1 + 2) ** 3; +comp **= comp **= (1 - 2) ** 4; +comp **= comp **= (1 * 2) ** 5; +comp **= comp **= (1 / 2) ** 6; + + +//// [emitCompoundExponentiationOperator2ES7.js] +var comp; +comp **= 1; +comp **= comp **= 1; +comp **= comp **= 1 + 2; +comp **= comp **= 1 - 2; +comp **= comp **= 1 * 2; +comp **= comp **= 1 / 2; +comp **= comp **= (1 + 2); +comp **= comp **= (1 - 2); +comp **= comp **= (1 * 2); +comp **= comp **= (1 / 2); +comp **= comp **= 1 + 2 ** 3; +comp **= comp **= 1 - 2 ** 4; +comp **= comp **= 1 * 2 ** 5; +comp **= comp **= 1 / 2 ** 6; +comp **= comp **= (1 + 2) ** 3; +comp **= comp **= (1 - 2) ** 4; +comp **= comp **= (1 * 2) ** 5; +comp **= comp **= (1 / 2) ** 6; diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols new file mode 100644 index 0000000000000..b3e56cbdbaea0 --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts === + +var comp: number; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= 1; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 + 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 - 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 * 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 / 2; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 + 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 - 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 * 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 / 2); +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 + 2 ** 3; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 - 2 ** 4; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 * 2 ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= 1 / 2 ** 6; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 + 2) ** 3; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 - 2) ** 4; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 * 2) ** 5; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + +comp **= comp **= (1 / 2) ** 6; +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) +>comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types new file mode 100644 index 0000000000000..97a61ec4af4ca --- /dev/null +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types @@ -0,0 +1,185 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts === + +var comp: number; +>comp : number + +comp **= 1; +>comp **= 1 : number +>comp : number +>1 : number + +comp **= comp **= 1; +>comp **= comp **= 1 : number +>comp : number +>comp **= 1 : number +>comp : number +>1 : number + +comp **= comp **= 1 + 2; +>comp **= comp **= 1 + 2 : number +>comp : number +>comp **= 1 + 2 : number +>comp : number +>1 + 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 - 2; +>comp **= comp **= 1 - 2 : number +>comp : number +>comp **= 1 - 2 : number +>comp : number +>1 - 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 * 2; +>comp **= comp **= 1 * 2 : number +>comp : number +>comp **= 1 * 2 : number +>comp : number +>1 * 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 / 2; +>comp **= comp **= 1 / 2 : number +>comp : number +>comp **= 1 / 2 : number +>comp : number +>1 / 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 + 2); +>comp **= comp **= (1 + 2) : number +>comp : number +>comp **= (1 + 2) : number +>comp : number +>(1 + 2) : number +>1 + 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 - 2); +>comp **= comp **= (1 - 2) : number +>comp : number +>comp **= (1 - 2) : number +>comp : number +>(1 - 2) : number +>1 - 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 * 2); +>comp **= comp **= (1 * 2) : number +>comp : number +>comp **= (1 * 2) : number +>comp : number +>(1 * 2) : number +>1 * 2 : number +>1 : number +>2 : number + +comp **= comp **= (1 / 2); +>comp **= comp **= (1 / 2) : number +>comp : number +>comp **= (1 / 2) : number +>comp : number +>(1 / 2) : number +>1 / 2 : number +>1 : number +>2 : number + +comp **= comp **= 1 + 2 ** 3; +>comp **= comp **= 1 + 2 ** 3 : number +>comp : number +>comp **= 1 + 2 ** 3 : number +>comp : number +>1 + 2 ** 3 : number +>1 : number +>2 ** 3 : number +>2 : number +>3 : number + +comp **= comp **= 1 - 2 ** 4; +>comp **= comp **= 1 - 2 ** 4 : number +>comp : number +>comp **= 1 - 2 ** 4 : number +>comp : number +>1 - 2 ** 4 : number +>1 : number +>2 ** 4 : number +>2 : number +>4 : number + +comp **= comp **= 1 * 2 ** 5; +>comp **= comp **= 1 * 2 ** 5 : number +>comp : number +>comp **= 1 * 2 ** 5 : number +>comp : number +>1 * 2 ** 5 : number +>1 : number +>2 ** 5 : number +>2 : number +>5 : number + +comp **= comp **= 1 / 2 ** 6; +>comp **= comp **= 1 / 2 ** 6 : number +>comp : number +>comp **= 1 / 2 ** 6 : number +>comp : number +>1 / 2 ** 6 : number +>1 : number +>2 ** 6 : number +>2 : number +>6 : number + +comp **= comp **= (1 + 2) ** 3; +>comp **= comp **= (1 + 2) ** 3 : number +>comp : number +>comp **= (1 + 2) ** 3 : number +>comp : number +>(1 + 2) ** 3 : number +>(1 + 2) : number +>1 + 2 : number +>1 : number +>2 : number +>3 : number + +comp **= comp **= (1 - 2) ** 4; +>comp **= comp **= (1 - 2) ** 4 : number +>comp : number +>comp **= (1 - 2) ** 4 : number +>comp : number +>(1 - 2) ** 4 : number +>(1 - 2) : number +>1 - 2 : number +>1 : number +>2 : number +>4 : number + +comp **= comp **= (1 * 2) ** 5; +>comp **= comp **= (1 * 2) ** 5 : number +>comp : number +>comp **= (1 * 2) ** 5 : number +>comp : number +>(1 * 2) ** 5 : number +>(1 * 2) : number +>1 * 2 : number +>1 : number +>2 : number +>5 : number + +comp **= comp **= (1 / 2) ** 6; +>comp **= comp **= (1 / 2) ** 6 : number +>comp : number +>comp **= (1 / 2) ** 6 : number +>comp : number +>(1 / 2) ** 6 : number +>(1 / 2) : number +>1 / 2 : number +>1 : number +>2 : number +>6 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator1.js b/tests/baselines/reference/emitExponentiationOperator1.js index 7c37137b83fff..2b270ef708b6d 100644 --- a/tests/baselines/reference/emitExponentiationOperator1.js +++ b/tests/baselines/reference/emitExponentiationOperator1.js @@ -1,12 +1,13 @@ //// [emitExponentiationOperator1.ts] +1 ** -2; 1 ** 2; +(-1) ** 2 1 ** 2 ** 3; -1 ** -2 ** 3; -1 ** -2 ** -3; --1 ** -2 ** -3; --(1 ** 2) ** 3; +1 ** 2 ** -3; 1 ** -(2 ** 3); +(-(1 ** 2)) ** 3; +(-(1 ** 2)) ** -3; 1 ** 2 + 3; 1 ** 2 - 3; @@ -32,13 +33,14 @@ (2 / 3) ** 4; //// [emitExponentiationOperator1.js] +Math.pow(1, -2); Math.pow(1, 2); +Math.pow((-1), 2); Math.pow(1, Math.pow(2, 3)); -Math.pow(1, -Math.pow(2, 3)); -Math.pow(1, -Math.pow(2, -3)); --Math.pow(1, -Math.pow(2, -3)); --Math.pow((Math.pow(1, 2)), 3); +Math.pow(1, Math.pow(2, -3)); Math.pow(1, -(Math.pow(2, 3))); +Math.pow((-(Math.pow(1, 2))), 3); +Math.pow((-(Math.pow(1, 2))), -3); Math.pow(1, 2) + 3; Math.pow(1, 2) - 3; Math.pow(1, 2) * 3; diff --git a/tests/baselines/reference/emitExponentiationOperator1.symbols b/tests/baselines/reference/emitExponentiationOperator1.symbols index 5e2bd27b02c6c..5fb3419d41903 100644 --- a/tests/baselines/reference/emitExponentiationOperator1.symbols +++ b/tests/baselines/reference/emitExponentiationOperator1.symbols @@ -1,12 +1,13 @@ === tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts === +No type information for this code.1 ** -2; No type information for this code.1 ** 2; +No type information for this code.(-1) ** 2 No type information for this code.1 ** 2 ** 3; -No type information for this code.1 ** -2 ** 3; -No type information for this code.1 ** -2 ** -3; -No type information for this code.-1 ** -2 ** -3; -No type information for this code.-(1 ** 2) ** 3; +No type information for this code.1 ** 2 ** -3; No type information for this code.1 ** -(2 ** 3); +No type information for this code.(-(1 ** 2)) ** 3; +No type information for this code.(-(1 ** 2)) ** -3; No type information for this code. No type information for this code.1 ** 2 + 3; No type information for this code.1 ** 2 - 3; diff --git a/tests/baselines/reference/emitExponentiationOperator1.types b/tests/baselines/reference/emitExponentiationOperator1.types index de81d0b2e8f92..a2dc4f1690133 100644 --- a/tests/baselines/reference/emitExponentiationOperator1.types +++ b/tests/baselines/reference/emitExponentiationOperator1.types @@ -1,60 +1,66 @@ === tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1.ts === +1 ** -2; +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number + 1 ** 2; >1 ** 2 : number >1 : number >2 : number -1 ** 2 ** 3; ->1 ** 2 ** 3 : number +(-1) ** 2 +>(-1) ** 2 : number +>(-1) : number +>-1 : number >1 : number ->2 ** 3 : number >2 : number ->3 : number -1 ** -2 ** 3; ->1 ** -2 ** 3 : number +1 ** 2 ** 3; +>1 ** 2 ** 3 : number >1 : number ->-2 ** 3 : number >2 ** 3 : number >2 : number >3 : number -1 ** -2 ** -3; ->1 ** -2 ** -3 : number +1 ** 2 ** -3; +>1 ** 2 ** -3 : number >1 : number ->-2 ** -3 : number >2 ** -3 : number >2 : number >-3 : number >3 : number --1 ** -2 ** -3; ->-1 ** -2 ** -3 : number ->1 ** -2 ** -3 : number +1 ** -(2 ** 3); +>1 ** -(2 ** 3) : number >1 : number ->-2 ** -3 : number ->2 ** -3 : number +>-(2 ** 3) : number +>(2 ** 3) : number +>2 ** 3 : number >2 : number ->-3 : number >3 : number --(1 ** 2) ** 3; ->-(1 ** 2) ** 3 : number ->(1 ** 2) ** 3 : number +(-(1 ** 2)) ** 3; +>(-(1 ** 2)) ** 3 : number +>(-(1 ** 2)) : number +>-(1 ** 2) : number >(1 ** 2) : number >1 ** 2 : number >1 : number >2 : number >3 : number -1 ** -(2 ** 3); ->1 ** -(2 ** 3) : number +(-(1 ** 2)) ** -3; +>(-(1 ** 2)) ** -3 : number +>(-(1 ** 2)) : number +>-(1 ** 2) : number +>(1 ** 2) : number +>1 ** 2 : number >1 : number ->-(2 ** 3) : number ->(2 ** 3) : number ->2 ** 3 : number >2 : number +>-3 : number >3 : number 1 ** 2 + 3; diff --git a/tests/baselines/reference/emitExponentiationOperator1ES7.js b/tests/baselines/reference/emitExponentiationOperator1ES7.js new file mode 100644 index 0000000000000..f9e4924d4b520 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator1ES7.js @@ -0,0 +1,62 @@ +//// [emitExponentiationOperator1ES7.ts] + +1 ** -2; +1 ** 2; +(-1) ** 2 +1 ** 2 ** 3; +1 ** 2 ** -3; +1 ** -(2 ** 3); +(-(1 ** 2)) ** 3; +(-(1 ** 2)) ** -3; + +1 ** 2 + 3; +1 ** 2 - 3; +1 ** 2 * 3; +1 ** 2 / 3; +1 ** 2 % 3; + +1 ** -2 + 3; +1 ** -2 - 3; +1 ** -2 * 3; +1 ** -2 / 3; +1 ** -2 % 3; + +2 + 3 ** 3; +2 - 3 ** 3; +2 * 3 ** 3; +2 / 3 ** 3; +2 % 3 ** 3; + +(2 + 3) ** 4; +(2 - 3) ** 4; +(2 * 3) ** 4; +(2 / 3) ** 4; + +//// [emitExponentiationOperator1ES7.js] +1 ** -2; +1 ** 2; +(-1) ** 2; +1 ** 2 ** 3; +1 ** 2 ** -3; +1 ** -(2 ** 3); +(-(1 ** 2)) ** 3; +(-(1 ** 2)) ** -3; +1 ** 2 + 3; +1 ** 2 - 3; +1 ** 2 * 3; +1 ** 2 / 3; +1 ** 2 % 3; +1 ** -2 + 3; +1 ** -2 - 3; +1 ** -2 * 3; +1 ** -2 / 3; +1 ** -2 % 3; +2 + 3 ** 3; +2 - 3 ** 3; +2 * 3 ** 3; +2 / 3 ** 3; +2 % 3 ** 3; +(2 + 3) ** 4; +(2 - 3) ** 4; +(2 * 3) ** 4; +(2 / 3) ** 4; diff --git a/tests/baselines/reference/emitExponentiationOperator1ES7.symbols b/tests/baselines/reference/emitExponentiationOperator1ES7.symbols new file mode 100644 index 0000000000000..c0cc50e70837d --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator1ES7.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts === + +No type information for this code.1 ** -2; +No type information for this code.1 ** 2; +No type information for this code.(-1) ** 2 +No type information for this code.1 ** 2 ** 3; +No type information for this code.1 ** 2 ** -3; +No type information for this code.1 ** -(2 ** 3); +No type information for this code.(-(1 ** 2)) ** 3; +No type information for this code.(-(1 ** 2)) ** -3; +No type information for this code. +No type information for this code.1 ** 2 + 3; +No type information for this code.1 ** 2 - 3; +No type information for this code.1 ** 2 * 3; +No type information for this code.1 ** 2 / 3; +No type information for this code.1 ** 2 % 3; +No type information for this code. +No type information for this code.1 ** -2 + 3; +No type information for this code.1 ** -2 - 3; +No type information for this code.1 ** -2 * 3; +No type information for this code.1 ** -2 / 3; +No type information for this code.1 ** -2 % 3; +No type information for this code. +No type information for this code.2 + 3 ** 3; +No type information for this code.2 - 3 ** 3; +No type information for this code.2 * 3 ** 3; +No type information for this code.2 / 3 ** 3; +No type information for this code.2 % 3 ** 3; +No type information for this code. +No type information for this code.(2 + 3) ** 4; +No type information for this code.(2 - 3) ** 4; +No type information for this code.(2 * 3) ** 4; +No type information for this code.(2 / 3) ** 4; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emitExponentiationOperator1ES7.types b/tests/baselines/reference/emitExponentiationOperator1ES7.types new file mode 100644 index 0000000000000..067d992c446d7 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator1ES7.types @@ -0,0 +1,207 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts === + +1 ** -2; +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number + +1 ** 2; +>1 ** 2 : number +>1 : number +>2 : number + +(-1) ** 2 +>(-1) ** 2 : number +>(-1) : number +>-1 : number +>1 : number +>2 : number + +1 ** 2 ** 3; +>1 ** 2 ** 3 : number +>1 : number +>2 ** 3 : number +>2 : number +>3 : number + +1 ** 2 ** -3; +>1 ** 2 ** -3 : number +>1 : number +>2 ** -3 : number +>2 : number +>-3 : number +>3 : number + +1 ** -(2 ** 3); +>1 ** -(2 ** 3) : number +>1 : number +>-(2 ** 3) : number +>(2 ** 3) : number +>2 ** 3 : number +>2 : number +>3 : number + +(-(1 ** 2)) ** 3; +>(-(1 ** 2)) ** 3 : number +>(-(1 ** 2)) : number +>-(1 ** 2) : number +>(1 ** 2) : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +(-(1 ** 2)) ** -3; +>(-(1 ** 2)) ** -3 : number +>(-(1 ** 2)) : number +>-(1 ** 2) : number +>(1 ** 2) : number +>1 ** 2 : number +>1 : number +>2 : number +>-3 : number +>3 : number + +1 ** 2 + 3; +>1 ** 2 + 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 - 3; +>1 ** 2 - 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 * 3; +>1 ** 2 * 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 / 3; +>1 ** 2 / 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** 2 % 3; +>1 ** 2 % 3 : number +>1 ** 2 : number +>1 : number +>2 : number +>3 : number + +1 ** -2 + 3; +>1 ** -2 + 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 - 3; +>1 ** -2 - 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 * 3; +>1 ** -2 * 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 / 3; +>1 ** -2 / 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +1 ** -2 % 3; +>1 ** -2 % 3 : number +>1 ** -2 : number +>1 : number +>-2 : number +>2 : number +>3 : number + +2 + 3 ** 3; +>2 + 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 - 3 ** 3; +>2 - 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 * 3 ** 3; +>2 * 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 / 3 ** 3; +>2 / 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +2 % 3 ** 3; +>2 % 3 ** 3 : number +>2 : number +>3 ** 3 : number +>3 : number +>3 : number + +(2 + 3) ** 4; +>(2 + 3) ** 4 : number +>(2 + 3) : number +>2 + 3 : number +>2 : number +>3 : number +>4 : number + +(2 - 3) ** 4; +>(2 - 3) ** 4 : number +>(2 - 3) : number +>2 - 3 : number +>2 : number +>3 : number +>4 : number + +(2 * 3) ** 4; +>(2 * 3) ** 4 : number +>(2 * 3) : number +>2 * 3 : number +>2 : number +>3 : number +>4 : number + +(2 / 3) ** 4; +>(2 / 3) ** 4 : number +>(2 / 3) : number +>2 / 3 : number +>2 : number +>3 : number +>4 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator2.js b/tests/baselines/reference/emitExponentiationOperator2.js index 3a93ee9ec9c11..46f80b44bba4c 100644 --- a/tests/baselines/reference/emitExponentiationOperator2.js +++ b/tests/baselines/reference/emitExponentiationOperator2.js @@ -11,13 +11,10 @@ temp-- ** 3; --temp * temp ** 3; --temp / temp ** 3; --temp % temp ** 3; --++temp ** 3; -+--temp ** 3; - temp-- ** 3; temp++ ** 3; --temp++ ** 3; -+temp-- ** 3; +temp-- ** -temp; +temp++ ** +temp; temp-- + temp ** 3; temp-- - temp ** 3; @@ -40,27 +37,11 @@ temp-- % temp ** 3; 3 ** --temp; 3 ** temp++; 3 ** temp--; --3 ** temp++; --3 ** temp--; --3 ** ++temp; --3 ** --temp; -+3 ** temp++; -+3 ** temp--; -+3 ** ++temp; -+3 ** --temp 3 ** ++temp ** 2; 3 ** --temp ** 2; 3 ** temp++ ** 2; 3 ** temp-- ** 2; --3 ** temp++ ** 2; --3 ** temp-- ** 2; --3 ** ++temp ** 2; --3 ** --temp ** 2; -+3 ** temp++ ** 2; -+3 ** temp-- ** 2; -+3 ** ++temp ** 2; -+3 ** --temp ** 2; 3 ** ++temp + 2; 3 ** ++temp - 2; @@ -85,12 +66,10 @@ Math.pow(temp--, 3); --temp * Math.pow(temp, 3); --temp / Math.pow(temp, 3); --temp % Math.pow(temp, 3); --Math.pow(++temp, 3); -+Math.pow(--temp, 3); Math.pow(temp--, 3); Math.pow(temp++, 3); --Math.pow(temp++, 3); -+Math.pow(temp--, 3); +Math.pow(temp--, -temp); +Math.pow(temp++, +temp); temp-- + Math.pow(temp, 3); temp-- - Math.pow(temp, 3); temp-- * Math.pow(temp, 3); @@ -109,26 +88,10 @@ Math.pow(3, ++temp); Math.pow(3, --temp); Math.pow(3, temp++); Math.pow(3, temp--); --Math.pow(3, temp++); --Math.pow(3, temp--); --Math.pow(3, ++temp); --Math.pow(3, --temp); -+Math.pow(3, temp++); -+Math.pow(3, temp--); -+Math.pow(3, ++temp); -+Math.pow(3, --temp); Math.pow(3, Math.pow(++temp, 2)); Math.pow(3, Math.pow(--temp, 2)); Math.pow(3, Math.pow(temp++, 2)); Math.pow(3, Math.pow(temp--, 2)); --Math.pow(3, Math.pow(temp++, 2)); --Math.pow(3, Math.pow(temp--, 2)); --Math.pow(3, Math.pow(++temp, 2)); --Math.pow(3, Math.pow(--temp, 2)); -+Math.pow(3, Math.pow(temp++, 2)); -+Math.pow(3, Math.pow(temp--, 2)); -+Math.pow(3, Math.pow(++temp, 2)); -+Math.pow(3, Math.pow(--temp, 2)); Math.pow(3, ++temp) + 2; Math.pow(3, ++temp) - 2; Math.pow(3, ++temp) * 2; diff --git a/tests/baselines/reference/emitExponentiationOperator2.symbols b/tests/baselines/reference/emitExponentiationOperator2.symbols index 58aa20a1d5fa1..c3d9e4b25df82 100644 --- a/tests/baselines/reference/emitExponentiationOperator2.symbols +++ b/tests/baselines/reference/emitExponentiationOperator2.symbols @@ -35,22 +35,18 @@ temp-- ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) --++temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+--temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - temp-- ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) temp++ ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) --temp++ ** 3; +temp-- ** -temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) -+temp-- ** 3; +temp++ ** +temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) temp-- + temp ** 3; @@ -112,30 +108,6 @@ temp-- % temp ** 3; 3 ** temp--; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) --3 ** temp++; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - --3 ** temp--; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - --3 ** ++temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - --3 ** --temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** temp++; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** temp--; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** ++temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** --temp ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - 3 ** ++temp ** 2; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) @@ -148,30 +120,6 @@ temp-- % temp ** 3; 3 ** temp-- ** 2; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) --3 ** temp++ ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - --3 ** temp-- ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - --3 ** ++temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - --3 ** --temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** temp++ ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** temp-- ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** ++temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - -+3 ** --temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) - 3 ** ++temp + 2; >temp : Symbol(temp, Decl(emitExponentiationOperator2.ts, 1, 3)) diff --git a/tests/baselines/reference/emitExponentiationOperator2.types b/tests/baselines/reference/emitExponentiationOperator2.types index edd40614a36f3..cd8773624a7b7 100644 --- a/tests/baselines/reference/emitExponentiationOperator2.types +++ b/tests/baselines/reference/emitExponentiationOperator2.types @@ -68,20 +68,6 @@ temp-- ** 3; >temp : number >3 : number --++temp ** 3; ->-++temp ** 3 : number ->++temp ** 3 : number ->++temp : number ->temp : number ->3 : number - -+--temp ** 3; ->+--temp ** 3 : number ->--temp ** 3 : number ->--temp : number ->temp : number ->3 : number - temp-- ** 3; >temp-- ** 3 : number >temp-- : number @@ -94,19 +80,19 @@ temp++ ** 3; >temp : number >3 : number --temp++ ** 3; ->-temp++ ** 3 : number ->temp++ ** 3 : number ->temp++ : number +temp-- ** -temp; +>temp-- ** -temp : number +>temp-- : number +>temp : number +>-temp : number >temp : number ->3 : number -+temp-- ** 3; ->+temp-- ** 3 : number ->temp-- ** 3 : number ->temp-- : number +temp++ ** +temp; +>temp++ ** +temp : number +>temp++ : number +>temp : number +>+temp : number >temp : number ->3 : number temp-- + temp ** 3; >temp-- + temp ** 3 : number @@ -244,62 +230,6 @@ temp-- % temp ** 3; >temp-- : number >temp : number --3 ** temp++; ->-3 ** temp++ : number ->3 ** temp++ : number ->3 : number ->temp++ : number ->temp : number - --3 ** temp--; ->-3 ** temp-- : number ->3 ** temp-- : number ->3 : number ->temp-- : number ->temp : number - --3 ** ++temp; ->-3 ** ++temp : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number - --3 ** --temp; ->-3 ** --temp : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number - -+3 ** temp++; ->+3 ** temp++ : number ->3 ** temp++ : number ->3 : number ->temp++ : number ->temp : number - -+3 ** temp--; ->+3 ** temp-- : number ->3 ** temp-- : number ->3 : number ->temp-- : number ->temp : number - -+3 ** ++temp; ->+3 ** ++temp : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number - -+3 ** --temp ->+3 ** --temp : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number - 3 ** ++temp ** 2; >3 ** ++temp ** 2 : number >3 : number @@ -332,78 +262,6 @@ temp-- % temp ** 3; >temp : number >2 : number --3 ** temp++ ** 2; ->-3 ** temp++ ** 2 : number ->3 ** temp++ ** 2 : number ->3 : number ->temp++ ** 2 : number ->temp++ : number ->temp : number ->2 : number - --3 ** temp-- ** 2; ->-3 ** temp-- ** 2 : number ->3 ** temp-- ** 2 : number ->3 : number ->temp-- ** 2 : number ->temp-- : number ->temp : number ->2 : number - --3 ** ++temp ** 2; ->-3 ** ++temp ** 2 : number ->3 ** ++temp ** 2 : number ->3 : number ->++temp ** 2 : number ->++temp : number ->temp : number ->2 : number - --3 ** --temp ** 2; ->-3 ** --temp ** 2 : number ->3 ** --temp ** 2 : number ->3 : number ->--temp ** 2 : number ->--temp : number ->temp : number ->2 : number - -+3 ** temp++ ** 2; ->+3 ** temp++ ** 2 : number ->3 ** temp++ ** 2 : number ->3 : number ->temp++ ** 2 : number ->temp++ : number ->temp : number ->2 : number - -+3 ** temp-- ** 2; ->+3 ** temp-- ** 2 : number ->3 ** temp-- ** 2 : number ->3 : number ->temp-- ** 2 : number ->temp-- : number ->temp : number ->2 : number - -+3 ** ++temp ** 2; ->+3 ** ++temp ** 2 : number ->3 ** ++temp ** 2 : number ->3 : number ->++temp ** 2 : number ->++temp : number ->temp : number ->2 : number - -+3 ** --temp ** 2; ->+3 ** --temp ** 2 : number ->3 ** --temp ** 2 : number ->3 : number ->--temp ** 2 : number ->--temp : number ->temp : number ->2 : number - 3 ** ++temp + 2; >3 ** ++temp + 2 : number >3 ** ++temp : number diff --git a/tests/baselines/reference/emitExponentiationOperator2ES7.js b/tests/baselines/reference/emitExponentiationOperator2ES7.js new file mode 100644 index 0000000000000..89cef39ebf3d0 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator2ES7.js @@ -0,0 +1,104 @@ +//// [emitExponentiationOperator2ES7.ts] + +var temp = 10; + +++temp ** 3; +--temp ** 3; +temp++ ** 3; +temp-- ** 3; +--temp + temp ** 3; +--temp - temp ** 3; +--temp * temp ** 3; +--temp / temp ** 3; +--temp % temp ** 3; +temp-- ** 3; +temp++ ** 3; +temp-- ** -temp; +temp++ ** +temp; + +temp-- + temp ** 3; +temp-- - temp ** 3; +temp-- * temp ** 3; +temp-- / temp ** 3; +temp-- % temp ** 3; + +--temp + 2 ** 3; +--temp - 2 ** 3; +--temp * 2 ** 3; +--temp / 2 ** 3; +--temp % 2 ** 3; + +++temp + 2 ** 3; +++temp - 2 ** 3; +++temp * 2 ** 3; +++temp / 2 ** 3; + +3 ** ++temp; +3 ** --temp; +3 ** temp++; +3 ** temp--; + +3 ** ++temp ** 2; +3 ** --temp ** 2; +3 ** temp++ ** 2; +3 ** temp-- ** 2; + +3 ** ++temp + 2; +3 ** ++temp - 2; +3 ** ++temp * 2; +3 ** ++temp / 2; +3 ** ++temp % 2; + +3 ** --temp + 2; +3 ** --temp - 2; +3 ** --temp * 2; +3 ** --temp / 2; +3 ** --temp % 2; + +//// [emitExponentiationOperator2ES7.js] +var temp = 10; +++temp ** 3; +--temp ** 3; +temp++ ** 3; +temp-- ** 3; +--temp + temp ** 3; +--temp - temp ** 3; +--temp * temp ** 3; +--temp / temp ** 3; +--temp % temp ** 3; +temp-- ** 3; +temp++ ** 3; +temp-- ** -temp; +temp++ ** +temp; +temp-- + temp ** 3; +temp-- - temp ** 3; +temp-- * temp ** 3; +temp-- / temp ** 3; +temp-- % temp ** 3; +--temp + 2 ** 3; +--temp - 2 ** 3; +--temp * 2 ** 3; +--temp / 2 ** 3; +--temp % 2 ** 3; +++temp + 2 ** 3; +++temp - 2 ** 3; +++temp * 2 ** 3; +++temp / 2 ** 3; +3 ** ++temp; +3 ** --temp; +3 ** temp++; +3 ** temp--; +3 ** ++temp ** 2; +3 ** --temp ** 2; +3 ** temp++ ** 2; +3 ** temp-- ** 2; +3 ** ++temp + 2; +3 ** ++temp - 2; +3 ** ++temp * 2; +3 ** ++temp / 2; +3 ** ++temp % 2; +3 ** --temp + 2; +3 ** --temp - 2; +3 ** --temp * 2; +3 ** --temp / 2; +3 ** --temp % 2; diff --git a/tests/baselines/reference/emitExponentiationOperator2ES7.symbols b/tests/baselines/reference/emitExponentiationOperator2ES7.symbols new file mode 100644 index 0000000000000..0e0ce52a297ab --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator2ES7.symbols @@ -0,0 +1,152 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts === + +var temp = 10; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp + temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp - temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp * temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp / temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp % temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- ** -temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp++ ** +temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- + temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- - temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- * temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- / temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +temp-- % temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp + 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp - 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp * 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp / 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +--temp % 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +++temp + 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +++temp - 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +++temp * 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +++temp / 2 ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp + 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp - 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp * 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp / 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** ++temp % 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp + 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp - 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp * 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp / 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + +3 ** --temp % 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperator2ES7.types b/tests/baselines/reference/emitExponentiationOperator2ES7.types new file mode 100644 index 0000000000000..73fe09c6d8753 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator2ES7.types @@ -0,0 +1,344 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts === + +var temp = 10; +>temp : number +>10 : number + +++temp ** 3; +>++temp ** 3 : number +>++temp : number +>temp : number +>3 : number + +--temp ** 3; +>--temp ** 3 : number +>--temp : number +>temp : number +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ : number +>temp : number +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- : number +>temp : number +>3 : number + +--temp + temp ** 3; +>--temp + temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp - temp ** 3; +>--temp - temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp * temp ** 3; +>--temp * temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp / temp ** 3; +>--temp / temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp % temp ** 3; +>--temp % temp ** 3 : number +>--temp : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- : number +>temp : number +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ : number +>temp : number +>3 : number + +temp-- ** -temp; +>temp-- ** -temp : number +>temp-- : number +>temp : number +>-temp : number +>temp : number + +temp++ ** +temp; +>temp++ ** +temp : number +>temp++ : number +>temp : number +>+temp : number +>temp : number + +temp-- + temp ** 3; +>temp-- + temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- - temp ** 3; +>temp-- - temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- * temp ** 3; +>temp-- * temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- / temp ** 3; +>temp-- / temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +temp-- % temp ** 3; +>temp-- % temp ** 3 : number +>temp-- : number +>temp : number +>temp ** 3 : number +>temp : number +>3 : number + +--temp + 2 ** 3; +>--temp + 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp - 2 ** 3; +>--temp - 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp * 2 ** 3; +>--temp * 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp / 2 ** 3; +>--temp / 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +--temp % 2 ** 3; +>--temp % 2 ** 3 : number +>--temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp + 2 ** 3; +>++temp + 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp - 2 ** 3; +>++temp - 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp * 2 ** 3; +>++temp * 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +++temp / 2 ** 3; +>++temp / 2 ** 3 : number +>++temp : number +>temp : number +>2 ** 3 : number +>2 : number +>3 : number + +3 ** ++temp; +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number + +3 ** --temp; +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number + +3 ** temp++; +>3 ** temp++ : number +>3 : number +>temp++ : number +>temp : number + +3 ** temp--; +>3 ** temp-- : number +>3 : number +>temp-- : number +>temp : number + +3 ** ++temp ** 2; +>3 ** ++temp ** 2 : number +>3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number + +3 ** --temp ** 2; +>3 ** --temp ** 2 : number +>3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number + +3 ** temp++ ** 2; +>3 ** temp++ ** 2 : number +>3 : number +>temp++ ** 2 : number +>temp++ : number +>temp : number +>2 : number + +3 ** temp-- ** 2; +>3 ** temp-- ** 2 : number +>3 : number +>temp-- ** 2 : number +>temp-- : number +>temp : number +>2 : number + +3 ** ++temp + 2; +>3 ** ++temp + 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp - 2; +>3 ** ++temp - 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp * 2; +>3 ** ++temp * 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp / 2; +>3 ** ++temp / 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** ++temp % 2; +>3 ** ++temp % 2 : number +>3 ** ++temp : number +>3 : number +>++temp : number +>temp : number +>2 : number + +3 ** --temp + 2; +>3 ** --temp + 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp - 2; +>3 ** --temp - 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp * 2; +>3 ** --temp * 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp / 2; +>3 ** --temp / 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + +3 ** --temp % 2; +>3 ** --temp % 2 : number +>3 ** --temp : number +>3 : number +>--temp : number +>temp : number +>2 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator3.js b/tests/baselines/reference/emitExponentiationOperator3.js index 7cb92dfae63e2..ceb08c868dbcf 100644 --- a/tests/baselines/reference/emitExponentiationOperator3.js +++ b/tests/baselines/reference/emitExponentiationOperator3.js @@ -1,218 +1,78 @@ //// [emitExponentiationOperator3.ts] -var temp: any; -delete --temp ** 3; -delete ++temp ** 3; -delete temp-- ** 3; -delete temp++ ** 3; -delete -++temp ** 3; -delete -temp++ ** 3; -delete -temp-- ** 3; +var temp = 10; -delete --temp ** 3 ** 1; -delete ++temp ** 3 ** 1; -delete temp-- ** 3 ** 1; -delete temp++ ** 3 ** 1; -delete -++temp ** 3 ** 1; -delete -temp++ ** 3 ** 1; -delete -temp-- ** 3 ** 1;; +(-++temp) ** 3; +(+--temp) ** 3; +(-temp++) ** 3; +(+temp--) ** 3; +(-(1 ** ++temp)) ** 3; +(-(1 ** --temp)) ** 3; +(-(1 ** temp++)) ** 3; +(-(1 ** temp--)) ** 3; ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; --++temp ** 3; --temp++ ** 3; --temp-- ** 3; +(-3) ** temp++; +(-3) ** temp--; +(-3) ** ++temp; +(-3) ** --temp; +(+3) ** temp++; +(+3) ** temp--; +(+3) ** ++temp; +(+3) ** --temp; +(-3) ** temp++ ** 2; +(-3) ** temp-- ** 2; +(-3) ** ++temp ** 2; +(-3) ** --temp ** 2; +(+3) ** temp++ ** 2; +(+3) ** temp-- ** 2; +(+3) ** ++temp ** 2; +(+3) ** --temp ** 2; ---temp ** 3 ** 1; -++temp ** 3 ** 1; -temp-- ** 3 ** 1; -temp++ ** 3 ** 1; --++temp ** 3 ** 1; --temp++ ** 3 ** 1; --temp-- ** 3 ** 1; - -typeof --temp ** 3; -typeof temp-- ** 3; -typeof 3 ** 4; -typeof temp++ ** 4; -typeof temp-- ** 4; -typeof -3 ** 4; -typeof -++temp ** 4; -typeof -temp++ ** 4; -typeof -temp-- ** 4; - -typeof --temp ** 3 ** 1; -typeof temp-- ** 3 ** 1; -typeof 3 ** 4 ** 1; -typeof temp++ ** 4 ** 1; -typeof temp-- ** 4 ** 1; -typeof -3 ** 4 ** 1; -typeof -++temp ** 4 ** 1; -typeof -temp++ ** 4 ** 1; -typeof -temp-- ** 4 ** 1; - -void --temp ** 3; -void temp-- ** 3; -void 3 ** 4; -void temp++ ** 4; -void temp-- ** 4; -void -3 ** 4; -void -++temp ** 4; -void -temp++ ** 4; -void -temp-- ** 4; - -void --temp ** 3 ** 1; -void temp-- ** 3 ** 1; -void 3 ** 4 ** 1; -void temp++ ** 4 ** 1; -void temp-- ** 4 ** 1; -void -3 ** 4 ** 1; -void -++temp ** 4 ** 1; -void -temp++ ** 4 ** 1; -void -temp-- ** 4 ** 1; - -~ --temp ** 3; -~ temp-- ** 3; -~ 3 ** 4; -~ temp++ ** 4; -~ temp-- ** 4; -~ -3 ** 4; -~ -++temp ** 4; -~ -temp++ ** 4; -~ -temp-- ** 4; - -~ --temp ** 3 ** 1; -~ temp-- ** 3 ** 1; -~ 3 ** 4 ** 1; -~ temp++ ** 4 ** 1; -~ temp-- ** 4 ** 1; -~ -3 ** 4 ** 1; -~ -++temp ** 4 ** 1; -~ -temp++ ** 4 ** 1; -~ -temp-- ** 4 ** 1; - -! --temp ** 3; -! temp-- ** 3; -! 3 ** 4; -! temp++ ** 4; -! temp-- ** 4; -! -3 ** 4; -! -++temp ** 4; -! -temp++ ** 4; -! -temp-- ** 4; - -! --temp ** 3 ** 1; -! temp-- ** 3 ** 1; -! 3 ** 4 ** 1; -! temp++ ** 4 ** 1; -! temp-- ** 4 ** 1; -! -3 ** 4 ** 1; -! -++temp ** 4 ** 1; -! -temp++ ** 4 ** 1; -! -temp-- ** 4 ** 1; +3 ** -temp++; +3 ** -temp--; +3 ** -++temp; +3 ** +--temp; +3 ** (-temp++) ** 2; +3 ** (-temp--) ** 2; +3 ** (+temp++) ** 2; +3 ** (+temp--) ** 2; +3 ** (-++temp) ** 2; +3 ** (+--temp) ** 2; + //// [emitExponentiationOperator3.js] -var temp; -delete Math.pow(--temp, 3); -delete Math.pow(++temp, 3); -delete Math.pow(temp--, 3); -delete Math.pow(temp++, 3); -delete -Math.pow(++temp, 3); -delete -Math.pow(temp++, 3); -delete -Math.pow(temp--, 3); -delete Math.pow(--temp, Math.pow(3, 1)); -delete Math.pow(++temp, Math.pow(3, 1)); -delete Math.pow(temp--, Math.pow(3, 1)); -delete Math.pow(temp++, Math.pow(3, 1)); -delete -Math.pow(++temp, Math.pow(3, 1)); -delete -Math.pow(temp++, Math.pow(3, 1)); -delete -Math.pow(temp--, Math.pow(3, 1)); -; -Math.pow(--temp, 3); -Math.pow(++temp, 3); -Math.pow(temp--, 3); -Math.pow(temp++, 3); --Math.pow(++temp, 3); --Math.pow(temp++, 3); --Math.pow(temp--, 3); -Math.pow(--temp, Math.pow(3, 1)); -Math.pow(++temp, Math.pow(3, 1)); -Math.pow(temp--, Math.pow(3, 1)); -Math.pow(temp++, Math.pow(3, 1)); --Math.pow(++temp, Math.pow(3, 1)); --Math.pow(temp++, Math.pow(3, 1)); --Math.pow(temp--, Math.pow(3, 1)); -typeof Math.pow(--temp, 3); -typeof Math.pow(temp--, 3); -typeof Math.pow(3, 4); -typeof Math.pow(temp++, 4); -typeof Math.pow(temp--, 4); -typeof -Math.pow(3, 4); -typeof -Math.pow(++temp, 4); -typeof -Math.pow(temp++, 4); -typeof -Math.pow(temp--, 4); -typeof Math.pow(--temp, Math.pow(3, 1)); -typeof Math.pow(temp--, Math.pow(3, 1)); -typeof Math.pow(3, Math.pow(4, 1)); -typeof Math.pow(temp++, Math.pow(4, 1)); -typeof Math.pow(temp--, Math.pow(4, 1)); -typeof -Math.pow(3, Math.pow(4, 1)); -typeof -Math.pow(++temp, Math.pow(4, 1)); -typeof -Math.pow(temp++, Math.pow(4, 1)); -typeof -Math.pow(temp--, Math.pow(4, 1)); -void Math.pow(--temp, 3); -void Math.pow(temp--, 3); -void Math.pow(3, 4); -void Math.pow(temp++, 4); -void Math.pow(temp--, 4); -void -Math.pow(3, 4); -void -Math.pow(++temp, 4); -void -Math.pow(temp++, 4); -void -Math.pow(temp--, 4); -void Math.pow(--temp, Math.pow(3, 1)); -void Math.pow(temp--, Math.pow(3, 1)); -void Math.pow(3, Math.pow(4, 1)); -void Math.pow(temp++, Math.pow(4, 1)); -void Math.pow(temp--, Math.pow(4, 1)); -void -Math.pow(3, Math.pow(4, 1)); -void -Math.pow(++temp, Math.pow(4, 1)); -void -Math.pow(temp++, Math.pow(4, 1)); -void -Math.pow(temp--, Math.pow(4, 1)); -~Math.pow(--temp, 3); -~Math.pow(temp--, 3); -~Math.pow(3, 4); -~Math.pow(temp++, 4); -~Math.pow(temp--, 4); -~-Math.pow(3, 4); -~-Math.pow(++temp, 4); -~-Math.pow(temp++, 4); -~-Math.pow(temp--, 4); -~Math.pow(--temp, Math.pow(3, 1)); -~Math.pow(temp--, Math.pow(3, 1)); -~Math.pow(3, Math.pow(4, 1)); -~Math.pow(temp++, Math.pow(4, 1)); -~Math.pow(temp--, Math.pow(4, 1)); -~-Math.pow(3, Math.pow(4, 1)); -~-Math.pow(++temp, Math.pow(4, 1)); -~-Math.pow(temp++, Math.pow(4, 1)); -~-Math.pow(temp--, Math.pow(4, 1)); -!Math.pow(--temp, 3); -!Math.pow(temp--, 3); -!Math.pow(3, 4); -!Math.pow(temp++, 4); -!Math.pow(temp--, 4); -!-Math.pow(3, 4); -!-Math.pow(++temp, 4); -!-Math.pow(temp++, 4); -!-Math.pow(temp--, 4); -!Math.pow(--temp, Math.pow(3, 1)); -!Math.pow(temp--, Math.pow(3, 1)); -!Math.pow(3, Math.pow(4, 1)); -!Math.pow(temp++, Math.pow(4, 1)); -!Math.pow(temp--, Math.pow(4, 1)); -!-Math.pow(3, Math.pow(4, 1)); -!-Math.pow(++temp, Math.pow(4, 1)); -!-Math.pow(temp++, Math.pow(4, 1)); -!-Math.pow(temp--, Math.pow(4, 1)); +var temp = 10; +Math.pow((-++temp), 3); +Math.pow((+--temp), 3); +Math.pow((-temp++), 3); +Math.pow((+temp--), 3); +Math.pow((-(Math.pow(1, ++temp))), 3); +Math.pow((-(Math.pow(1, --temp))), 3); +Math.pow((-(Math.pow(1, temp++))), 3); +Math.pow((-(Math.pow(1, temp--))), 3); +Math.pow((-3), temp++); +Math.pow((-3), temp--); +Math.pow((-3), ++temp); +Math.pow((-3), --temp); +Math.pow((+3), temp++); +Math.pow((+3), temp--); +Math.pow((+3), ++temp); +Math.pow((+3), --temp); +Math.pow((-3), Math.pow(temp++, 2)); +Math.pow((-3), Math.pow(temp--, 2)); +Math.pow((-3), Math.pow(++temp, 2)); +Math.pow((-3), Math.pow(--temp, 2)); +Math.pow((+3), Math.pow(temp++, 2)); +Math.pow((+3), Math.pow(temp--, 2)); +Math.pow((+3), Math.pow(++temp, 2)); +Math.pow((+3), Math.pow(--temp, 2)); +Math.pow(3, -temp++); +Math.pow(3, -temp--); +Math.pow(3, -++temp); +Math.pow(3, +--temp); +Math.pow(3, Math.pow((-temp++), 2)); +Math.pow(3, Math.pow((-temp--), 2)); +Math.pow(3, Math.pow((+temp++), 2)); +Math.pow(3, Math.pow((+temp--), 2)); +Math.pow(3, Math.pow((-++temp), 2)); +Math.pow(3, Math.pow((+--temp), 2)); diff --git a/tests/baselines/reference/emitExponentiationOperator3.symbols b/tests/baselines/reference/emitExponentiationOperator3.symbols index 68b70711695f3..231117438551c 100644 --- a/tests/baselines/reference/emitExponentiationOperator3.symbols +++ b/tests/baselines/reference/emitExponentiationOperator3.symbols @@ -1,272 +1,107 @@ === tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts === -var temp: any; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) -delete --temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +var temp = 10; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete ++temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-++temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+--temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete temp++ ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-temp++) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete -++temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete -temp++ ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-(1 ** ++temp)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete -temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-(1 ** --temp)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete --temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-(1 ** temp++)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete ++temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-(1 ** temp--)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete temp++ ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete -++temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete -temp++ ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -delete -temp-- ** 3 ** 1;; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) ---temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -++temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -temp++ ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) --++temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) --temp++ ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) --temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(-3) ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) ---temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -++temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -temp++ ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +(+3) ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) --++temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** -temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) --temp++ ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** -temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) --temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** -++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof --temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** +--temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** (-temp++) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof 3 ** 4; -typeof temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** (-temp--) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** (+temp++) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof -3 ** 4; -typeof -++temp ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** (+temp--) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof -temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** (-++temp) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) -typeof -temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof --temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof 3 ** 4 ** 1; -typeof temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof -3 ** 4 ** 1; -typeof -++temp ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof -temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -typeof -temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void --temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void 3 ** 4; -void temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void -3 ** 4; -void -++temp ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void -temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void -temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void --temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void 3 ** 4 ** 1; -void temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void -3 ** 4 ** 1; -void -++temp ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void -temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -void -temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ --temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ 3 ** 4; -~ temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ -3 ** 4; -~ -++temp ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ -temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ -temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ --temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ 3 ** 4 ** 1; -~ temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ -3 ** 4 ** 1; -~ -++temp ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ -temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -~ -temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! --temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! 3 ** 4; -! temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! -3 ** 4; -! -++temp ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! -temp++ ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! -temp-- ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! --temp ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! temp-- ** 3 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! 3 ** 4 ** 1; -! temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! -3 ** 4 ** 1; -! -++temp ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! -temp++ ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) - -! -temp-- ** 4 ** 1; ->temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 0, 3)) +3 ** (+--temp) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3.ts, 1, 3)) diff --git a/tests/baselines/reference/emitExponentiationOperator3.types b/tests/baselines/reference/emitExponentiationOperator3.types index 8e455b7cd6892..cc4c5374d05ee 100644 --- a/tests/baselines/reference/emitExponentiationOperator3.types +++ b/tests/baselines/reference/emitExponentiationOperator3.types @@ -1,832 +1,314 @@ === tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3.ts === -var temp: any; ->temp : any -delete --temp ** 3; ->delete --temp ** 3 : boolean ->--temp ** 3 : number ->--temp : number ->temp : any ->3 : number +var temp = 10; +>temp : number +>10 : number -delete ++temp ** 3; ->delete ++temp ** 3 : boolean ->++temp ** 3 : number +(-++temp) ** 3; +>(-++temp) ** 3 : number +>(-++temp) : number +>-++temp : number >++temp : number ->temp : any ->3 : number - -delete temp-- ** 3; ->delete temp-- ** 3 : boolean ->temp-- ** 3 : number ->temp-- : number ->temp : any ->3 : number - -delete temp++ ** 3; ->delete temp++ ** 3 : boolean ->temp++ ** 3 : number ->temp++ : number ->temp : any +>temp : number >3 : number -delete -++temp ** 3; ->delete -++temp ** 3 : boolean ->-++temp ** 3 : number ->++temp ** 3 : number ->++temp : number ->temp : any +(+--temp) ** 3; +>(+--temp) ** 3 : number +>(+--temp) : number +>+--temp : number +>--temp : number +>temp : number >3 : number -delete -temp++ ** 3; ->delete -temp++ ** 3 : boolean ->-temp++ ** 3 : number ->temp++ ** 3 : number +(-temp++) ** 3; +>(-temp++) ** 3 : number +>(-temp++) : number +>-temp++ : number >temp++ : number ->temp : any +>temp : number >3 : number -delete -temp-- ** 3; ->delete -temp-- ** 3 : boolean ->-temp-- ** 3 : number ->temp-- ** 3 : number +(+temp--) ** 3; +>(+temp--) ** 3 : number +>(+temp--) : number +>+temp-- : number >temp-- : number ->temp : any +>temp : number >3 : number -delete --temp ** 3 ** 1; ->delete --temp ** 3 ** 1 : boolean ->--temp ** 3 ** 1 : number ->--temp : number ->temp : any ->3 ** 1 : number ->3 : number +(-(1 ** ++temp)) ** 3; +>(-(1 ** ++temp)) ** 3 : number +>(-(1 ** ++temp)) : number +>-(1 ** ++temp) : number +>(1 ** ++temp) : number +>1 ** ++temp : number >1 : number - -delete ++temp ** 3 ** 1; ->delete ++temp ** 3 ** 1 : boolean ->++temp ** 3 ** 1 : number >++temp : number ->temp : any ->3 ** 1 : number +>temp : number >3 : number ->1 : number -delete temp-- ** 3 ** 1; ->delete temp-- ** 3 ** 1 : boolean ->temp-- ** 3 ** 1 : number ->temp-- : number ->temp : any ->3 ** 1 : number ->3 : number +(-(1 ** --temp)) ** 3; +>(-(1 ** --temp)) ** 3 : number +>(-(1 ** --temp)) : number +>-(1 ** --temp) : number +>(1 ** --temp) : number +>1 ** --temp : number >1 : number - -delete temp++ ** 3 ** 1; ->delete temp++ ** 3 ** 1 : boolean ->temp++ ** 3 ** 1 : number ->temp++ : number ->temp : any ->3 ** 1 : number +>--temp : number +>temp : number >3 : number ->1 : number -delete -++temp ** 3 ** 1; ->delete -++temp ** 3 ** 1 : boolean ->-++temp ** 3 ** 1 : number ->++temp ** 3 ** 1 : number ->++temp : number ->temp : any ->3 ** 1 : number ->3 : number +(-(1 ** temp++)) ** 3; +>(-(1 ** temp++)) ** 3 : number +>(-(1 ** temp++)) : number +>-(1 ** temp++) : number +>(1 ** temp++) : number +>1 ** temp++ : number >1 : number - -delete -temp++ ** 3 ** 1; ->delete -temp++ ** 3 ** 1 : boolean ->-temp++ ** 3 ** 1 : number ->temp++ ** 3 ** 1 : number >temp++ : number ->temp : any ->3 ** 1 : number +>temp : number >3 : number ->1 : number -delete -temp-- ** 3 ** 1;; ->delete -temp-- ** 3 ** 1 : boolean ->-temp-- ** 3 ** 1 : number ->temp-- ** 3 ** 1 : number ->temp-- : number ->temp : any ->3 ** 1 : number ->3 : number +(-(1 ** temp--)) ** 3; +>(-(1 ** temp--)) ** 3 : number +>(-(1 ** temp--)) : number +>-(1 ** temp--) : number +>(1 ** temp--) : number +>1 ** temp-- : number >1 : number - ---temp ** 3; ->--temp ** 3 : number ->--temp ** 3 : number ->--temp : number ->temp : any ->3 : number - -++temp ** 3; ->++temp ** 3 : number ->++temp ** 3 : number ->++temp : number ->temp : any ->3 : number - -temp-- ** 3; ->temp-- ** 3 : number ->temp-- ** 3 : number >temp-- : number ->temp : any +>temp : number >3 : number -temp++ ** 3; ->temp++ ** 3 : number ->temp++ ** 3 : number ->temp++ : number ->temp : any +(-3) ** temp++; +>(-3) ** temp++ : number +>(-3) : number +>-3 : number >3 : number - --++temp ** 3; ->-++temp ** 3 : number ->-++temp ** 3 : number ->++temp ** 3 : number ->++temp : number ->temp : any ->3 : number - --temp++ ** 3; ->-temp++ ** 3 : number ->-temp++ ** 3 : number ->temp++ ** 3 : number >temp++ : number ->temp : any ->3 : number - --temp-- ** 3; ->-temp-- ** 3 : number ->-temp-- ** 3 : number ->temp-- ** 3 : number ->temp-- : number ->temp : any ->3 : number +>temp : number ---temp ** 3 ** 1; ->--temp ** 3 ** 1 : number ->--temp ** 3 ** 1 : number ->--temp : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number - -++temp ** 3 ** 1; ->++temp ** 3 ** 1 : number ->++temp ** 3 ** 1 : number ->++temp : number ->temp : any ->3 ** 1 : number +(-3) ** temp--; +>(-3) ** temp-- : number +>(-3) : number +>-3 : number >3 : number ->1 : number - -temp-- ** 3 ** 1; ->temp-- ** 3 ** 1 : number ->temp-- ** 3 ** 1 : number >temp-- : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number +>temp : number -temp++ ** 3 ** 1; ->temp++ ** 3 ** 1 : number ->temp++ ** 3 ** 1 : number ->temp++ : number ->temp : any ->3 ** 1 : number +(-3) ** ++temp; +>(-3) ** ++temp : number +>(-3) : number +>-3 : number >3 : number ->1 : number - --++temp ** 3 ** 1; ->-++temp ** 3 ** 1 : number ->-++temp ** 3 ** 1 : number ->++temp ** 3 ** 1 : number >++temp : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number +>temp : number --temp++ ** 3 ** 1; ->-temp++ ** 3 ** 1 : number ->-temp++ ** 3 ** 1 : number ->temp++ ** 3 ** 1 : number ->temp++ : number ->temp : any ->3 ** 1 : number +(-3) ** --temp; +>(-3) ** --temp : number +>(-3) : number +>-3 : number >3 : number ->1 : number - --temp-- ** 3 ** 1; ->-temp-- ** 3 ** 1 : number ->-temp-- ** 3 ** 1 : number ->temp-- ** 3 ** 1 : number ->temp-- : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number - -typeof --temp ** 3; ->typeof --temp ** 3 : string ->--temp ** 3 : number >--temp : number ->temp : any ->3 : number - -typeof temp-- ** 3; ->typeof temp-- ** 3 : string ->temp-- ** 3 : number ->temp-- : number ->temp : any ->3 : number +>temp : number -typeof 3 ** 4; ->typeof 3 ** 4 : string ->3 ** 4 : number +(+3) ** temp++; +>(+3) ** temp++ : number +>(+3) : number +>+3 : number >3 : number ->4 : number - -typeof temp++ ** 4; ->typeof temp++ ** 4 : string ->temp++ ** 4 : number >temp++ : number ->temp : any ->4 : number - -typeof temp-- ** 4; ->typeof temp-- ** 4 : string ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number - -typeof -3 ** 4; ->typeof -3 ** 4 : string ->-3 ** 4 : number ->3 ** 4 : number ->3 : number ->4 : number - -typeof -++temp ** 4; ->typeof -++temp ** 4 : string ->-++temp ** 4 : number ->++temp ** 4 : number ->++temp : number ->temp : any ->4 : number - -typeof -temp++ ** 4; ->typeof -temp++ ** 4 : string ->-temp++ ** 4 : number ->temp++ ** 4 : number ->temp++ : number ->temp : any ->4 : number - -typeof -temp-- ** 4; ->typeof -temp-- ** 4 : string ->-temp-- ** 4 : number ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number - -typeof --temp ** 3 ** 1; ->typeof --temp ** 3 ** 1 : string ->--temp ** 3 ** 1 : number ->--temp : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number - -typeof temp-- ** 3 ** 1; ->typeof temp-- ** 3 ** 1 : string ->temp-- ** 3 ** 1 : number ->temp-- : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number +>temp : number -typeof 3 ** 4 ** 1; ->typeof 3 ** 4 ** 1 : string ->3 ** 4 ** 1 : number +(+3) ** temp--; +>(+3) ** temp-- : number +>(+3) : number +>+3 : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -typeof temp++ ** 4 ** 1; ->typeof temp++ ** 4 ** 1 : string ->temp++ ** 4 ** 1 : number ->temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -typeof temp-- ** 4 ** 1; ->typeof temp-- ** 4 ** 1 : string ->temp-- ** 4 ** 1 : number >temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number -typeof -3 ** 4 ** 1; ->typeof -3 ** 4 ** 1 : string ->-3 ** 4 ** 1 : number ->3 ** 4 ** 1 : number +(+3) ** ++temp; +>(+3) ** ++temp : number +>(+3) : number +>+3 : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -typeof -++temp ** 4 ** 1; ->typeof -++temp ** 4 ** 1 : string ->-++temp ** 4 ** 1 : number ->++temp ** 4 ** 1 : number >++temp : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number -typeof -temp++ ** 4 ** 1; ->typeof -temp++ ** 4 ** 1 : string ->-temp++ ** 4 ** 1 : number ->temp++ ** 4 ** 1 : number ->temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -typeof -temp-- ** 4 ** 1; ->typeof -temp-- ** 4 ** 1 : string ->-temp-- ** 4 ** 1 : number ->temp-- ** 4 ** 1 : number ->temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -void --temp ** 3; ->void --temp ** 3 : undefined ->--temp ** 3 : number ->--temp : number ->temp : any ->3 : number - -void temp-- ** 3; ->void temp-- ** 3 : undefined ->temp-- ** 3 : number ->temp-- : number ->temp : any +(+3) ** --temp; +>(+3) ** --temp : number +>(+3) : number +>+3 : number >3 : number - -void 3 ** 4; ->void 3 ** 4 : undefined ->3 ** 4 : number ->3 : number ->4 : number - -void temp++ ** 4; ->void temp++ ** 4 : undefined ->temp++ ** 4 : number ->temp++ : number ->temp : any ->4 : number - -void temp-- ** 4; ->void temp-- ** 4 : undefined ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number - -void -3 ** 4; ->void -3 ** 4 : undefined ->-3 ** 4 : number ->3 ** 4 : number ->3 : number ->4 : number - -void -++temp ** 4; ->void -++temp ** 4 : undefined ->-++temp ** 4 : number ->++temp ** 4 : number ->++temp : number ->temp : any ->4 : number - -void -temp++ ** 4; ->void -temp++ ** 4 : undefined ->-temp++ ** 4 : number ->temp++ ** 4 : number ->temp++ : number ->temp : any ->4 : number - -void -temp-- ** 4; ->void -temp-- ** 4 : undefined ->-temp-- ** 4 : number ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number - -void --temp ** 3 ** 1; ->void --temp ** 3 ** 1 : undefined ->--temp ** 3 ** 1 : number >--temp : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number +>temp : number -void temp-- ** 3 ** 1; ->void temp-- ** 3 ** 1 : undefined ->temp-- ** 3 ** 1 : number ->temp-- : number ->temp : any ->3 ** 1 : number +(-3) ** temp++ ** 2; +>(-3) ** temp++ ** 2 : number +>(-3) : number +>-3 : number >3 : number ->1 : number - -void 3 ** 4 ** 1; ->void 3 ** 4 ** 1 : undefined ->3 ** 4 ** 1 : number ->3 : number ->4 ** 1 : number ->4 : number ->1 : number - -void temp++ ** 4 ** 1; ->void temp++ ** 4 ** 1 : undefined ->temp++ ** 4 ** 1 : number +>temp++ ** 2 : number >temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -void temp-- ** 4 ** 1; ->void temp-- ** 4 ** 1 : undefined ->temp-- ** 4 ** 1 : number ->temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number +>2 : number -void -3 ** 4 ** 1; ->void -3 ** 4 ** 1 : undefined ->-3 ** 4 ** 1 : number ->3 ** 4 ** 1 : number +(-3) ** temp-- ** 2; +>(-3) ** temp-- ** 2 : number +>(-3) : number +>-3 : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -void -++temp ** 4 ** 1; ->void -++temp ** 4 ** 1 : undefined ->-++temp ** 4 ** 1 : number ->++temp ** 4 ** 1 : number ->++temp : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -void -temp++ ** 4 ** 1; ->void -temp++ ** 4 ** 1 : undefined ->-temp++ ** 4 ** 1 : number ->temp++ ** 4 ** 1 : number ->temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -void -temp-- ** 4 ** 1; ->void -temp-- ** 4 ** 1 : undefined ->-temp-- ** 4 ** 1 : number ->temp-- ** 4 ** 1 : number +>temp-- ** 2 : number >temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number +>2 : number -~ --temp ** 3; ->~ --temp ** 3 : number ->--temp ** 3 : number ->--temp : number ->temp : any +(-3) ** ++temp ** 2; +>(-3) ** ++temp ** 2 : number +>(-3) : number +>-3 : number >3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number -~ temp-- ** 3; ->~ temp-- ** 3 : number ->temp-- ** 3 : number ->temp-- : number ->temp : any +(-3) ** --temp ** 2; +>(-3) ** --temp ** 2 : number +>(-3) : number +>-3 : number >3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number -~ 3 ** 4; ->~ 3 ** 4 : number ->3 ** 4 : number +(+3) ** temp++ ** 2; +>(+3) ** temp++ ** 2 : number +>(+3) : number +>+3 : number >3 : number ->4 : number - -~ temp++ ** 4; ->~ temp++ ** 4 : number ->temp++ ** 4 : number +>temp++ ** 2 : number >temp++ : number ->temp : any ->4 : number - -~ temp-- ** 4; ->~ temp-- ** 4 : number ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number +>temp : number +>2 : number -~ -3 ** 4; ->~ -3 ** 4 : number ->-3 ** 4 : number ->3 ** 4 : number +(+3) ** temp-- ** 2; +>(+3) ** temp-- ** 2 : number +>(+3) : number +>+3 : number >3 : number ->4 : number - -~ -++temp ** 4; ->~ -++temp ** 4 : number ->-++temp ** 4 : number ->++temp ** 4 : number ->++temp : number ->temp : any ->4 : number - -~ -temp++ ** 4; ->~ -temp++ ** 4 : number ->-temp++ ** 4 : number ->temp++ ** 4 : number ->temp++ : number ->temp : any ->4 : number - -~ -temp-- ** 4; ->~ -temp-- ** 4 : number ->-temp-- ** 4 : number ->temp-- ** 4 : number +>temp-- ** 2 : number >temp-- : number ->temp : any ->4 : number +>temp : number +>2 : number -~ --temp ** 3 ** 1; ->~ --temp ** 3 ** 1 : number ->--temp ** 3 ** 1 : number ->--temp : number ->temp : any ->3 ** 1 : number +(+3) ** ++temp ** 2; +>(+3) ** ++temp ** 2 : number +>(+3) : number +>+3 : number >3 : number ->1 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number -~ temp-- ** 3 ** 1; ->~ temp-- ** 3 ** 1 : number ->temp-- ** 3 ** 1 : number ->temp-- : number ->temp : any ->3 ** 1 : number +(+3) ** --temp ** 2; +>(+3) ** --temp ** 2 : number +>(+3) : number +>+3 : number >3 : number ->1 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number -~ 3 ** 4 ** 1; ->~ 3 ** 4 ** 1 : number ->3 ** 4 ** 1 : number +3 ** -temp++; +>3 ** -temp++ : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -~ temp++ ** 4 ** 1; ->~ temp++ ** 4 ** 1 : number ->temp++ ** 4 ** 1 : number +>-temp++ : number >temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number -~ temp-- ** 4 ** 1; ->~ temp-- ** 4 ** 1 : number ->temp-- ** 4 ** 1 : number ->temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -~ -3 ** 4 ** 1; ->~ -3 ** 4 ** 1 : number ->-3 ** 4 ** 1 : number ->3 ** 4 ** 1 : number +3 ** -temp--; +>3 ** -temp-- : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -~ -++temp ** 4 ** 1; ->~ -++temp ** 4 ** 1 : number ->-++temp ** 4 ** 1 : number ->++temp ** 4 ** 1 : number ->++temp : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -~ -temp++ ** 4 ** 1; ->~ -temp++ ** 4 ** 1 : number ->-temp++ ** 4 ** 1 : number ->temp++ ** 4 ** 1 : number ->temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -~ -temp-- ** 4 ** 1; ->~ -temp-- ** 4 ** 1 : number ->-temp-- ** 4 ** 1 : number ->temp-- ** 4 ** 1 : number +>-temp-- : number >temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number -! --temp ** 3; ->! --temp ** 3 : boolean ->--temp ** 3 : number ->--temp : number ->temp : any ->3 : number - -! temp-- ** 3; ->! temp-- ** 3 : boolean ->temp-- ** 3 : number ->temp-- : number ->temp : any +3 ** -++temp; +>3 ** -++temp : number >3 : number +>-++temp : number +>++temp : number +>temp : number -! 3 ** 4; ->! 3 ** 4 : boolean ->3 ** 4 : number +3 ** +--temp; +>3 ** +--temp : number >3 : number ->4 : number - -! temp++ ** 4; ->! temp++ ** 4 : boolean ->temp++ ** 4 : number ->temp++ : number ->temp : any ->4 : number - -! temp-- ** 4; ->! temp-- ** 4 : boolean ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number +>+--temp : number +>--temp : number +>temp : number -! -3 ** 4; ->! -3 ** 4 : boolean ->-3 ** 4 : number ->3 ** 4 : number +3 ** (-temp++) ** 2; +>3 ** (-temp++) ** 2 : number >3 : number ->4 : number - -! -++temp ** 4; ->! -++temp ** 4 : boolean ->-++temp ** 4 : number ->++temp ** 4 : number ->++temp : number ->temp : any ->4 : number - -! -temp++ ** 4; ->! -temp++ ** 4 : boolean ->-temp++ ** 4 : number ->temp++ ** 4 : number +>(-temp++) ** 2 : number +>(-temp++) : number +>-temp++ : number >temp++ : number ->temp : any ->4 : number +>temp : number +>2 : number -! -temp-- ** 4; ->! -temp-- ** 4 : boolean ->-temp-- ** 4 : number ->temp-- ** 4 : number ->temp-- : number ->temp : any ->4 : number - -! --temp ** 3 ** 1; ->! --temp ** 3 ** 1 : boolean ->--temp ** 3 ** 1 : number ->--temp : number ->temp : any ->3 ** 1 : number +3 ** (-temp--) ** 2; +>3 ** (-temp--) ** 2 : number >3 : number ->1 : number - -! temp-- ** 3 ** 1; ->! temp-- ** 3 ** 1 : boolean ->temp-- ** 3 ** 1 : number +>(-temp--) ** 2 : number +>(-temp--) : number +>-temp-- : number >temp-- : number ->temp : any ->3 ** 1 : number ->3 : number ->1 : number +>temp : number +>2 : number -! 3 ** 4 ** 1; ->! 3 ** 4 ** 1 : boolean ->3 ** 4 ** 1 : number +3 ** (+temp++) ** 2; +>3 ** (+temp++) ** 2 : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -! temp++ ** 4 ** 1; ->! temp++ ** 4 ** 1 : boolean ->temp++ ** 4 ** 1 : number +>(+temp++) ** 2 : number +>(+temp++) : number +>+temp++ : number >temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number +>2 : number -! temp-- ** 4 ** 1; ->! temp-- ** 4 ** 1 : boolean ->temp-- ** 4 ** 1 : number +3 ** (+temp--) ** 2; +>3 ** (+temp--) ** 2 : number +>3 : number +>(+temp--) ** 2 : number +>(+temp--) : number +>+temp-- : number >temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number +>2 : number -! -3 ** 4 ** 1; ->! -3 ** 4 ** 1 : boolean ->-3 ** 4 ** 1 : number ->3 ** 4 ** 1 : number +3 ** (-++temp) ** 2; +>3 ** (-++temp) ** 2 : number >3 : number ->4 ** 1 : number ->4 : number ->1 : number - -! -++temp ** 4 ** 1; ->! -++temp ** 4 ** 1 : boolean ->-++temp ** 4 ** 1 : number ->++temp ** 4 ** 1 : number +>(-++temp) ** 2 : number +>(-++temp) : number +>-++temp : number >++temp : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +>temp : number +>2 : number -! -temp++ ** 4 ** 1; ->! -temp++ ** 4 ** 1 : boolean ->-temp++ ** 4 ** 1 : number ->temp++ ** 4 ** 1 : number ->temp++ : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number - -! -temp-- ** 4 ** 1; ->! -temp-- ** 4 ** 1 : boolean ->-temp-- ** 4 ** 1 : number ->temp-- ** 4 ** 1 : number ->temp-- : number ->temp : any ->4 ** 1 : number ->4 : number ->1 : number +3 ** (+--temp) ** 2; +>3 ** (+--temp) ** 2 : number +>3 : number +>(+--temp) ** 2 : number +>(+--temp) : number +>+--temp : number +>--temp : number +>temp : number +>2 : number diff --git a/tests/baselines/reference/emitExponentiationOperator3ES7.js b/tests/baselines/reference/emitExponentiationOperator3ES7.js new file mode 100644 index 0000000000000..5d556c7f20efe --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator3ES7.js @@ -0,0 +1,78 @@ +//// [emitExponentiationOperator3ES7.ts] + +var temp = 10; + +(-++temp) ** 3; +(+--temp) ** 3; +(-temp++) ** 3; +(+temp--) ** 3; +(-(1 ** ++temp)) ** 3; +(-(1 ** --temp)) ** 3; +(-(1 ** temp++)) ** 3; +(-(1 ** temp--)) ** 3; + +(-3) ** temp++; +(-3) ** temp--; +(-3) ** ++temp; +(-3) ** --temp; +(+3) ** temp++; +(+3) ** temp--; +(+3) ** ++temp; +(+3) ** --temp; +(-3) ** temp++ ** 2; +(-3) ** temp-- ** 2; +(-3) ** ++temp ** 2; +(-3) ** --temp ** 2; +(+3) ** temp++ ** 2; +(+3) ** temp-- ** 2; +(+3) ** ++temp ** 2; +(+3) ** --temp ** 2; + +3 ** -temp++; +3 ** -temp--; +3 ** -++temp; +3 ** +--temp; +3 ** (-temp++) ** 2; +3 ** (-temp--) ** 2; +3 ** (+temp++) ** 2; +3 ** (+temp--) ** 2; +3 ** (-++temp) ** 2; +3 ** (+--temp) ** 2; + + +//// [emitExponentiationOperator3ES7.js] +var temp = 10; +(-++temp) ** 3; +(+--temp) ** 3; +(-temp++) ** 3; +(+temp--) ** 3; +(-(1 ** ++temp)) ** 3; +(-(1 ** --temp)) ** 3; +(-(1 ** temp++)) ** 3; +(-(1 ** temp--)) ** 3; +(-3) ** temp++; +(-3) ** temp--; +(-3) ** ++temp; +(-3) ** --temp; +(+3) ** temp++; +(+3) ** temp--; +(+3) ** ++temp; +(+3) ** --temp; +(-3) ** temp++ ** 2; +(-3) ** temp-- ** 2; +(-3) ** ++temp ** 2; +(-3) ** --temp ** 2; +(+3) ** temp++ ** 2; +(+3) ** temp-- ** 2; +(+3) ** ++temp ** 2; +(+3) ** --temp ** 2; +3 ** -temp++; +3 ** -temp--; +3 ** -++temp; +3 ** +--temp; +3 ** (-temp++) ** 2; +3 ** (-temp--) ** 2; +3 ** (+temp++) ** 2; +3 ** (+temp--) ** 2; +3 ** (-++temp) ** 2; +3 ** (+--temp) ** 2; diff --git a/tests/baselines/reference/emitExponentiationOperator3ES7.symbols b/tests/baselines/reference/emitExponentiationOperator3ES7.symbols new file mode 100644 index 0000000000000..cd668fcf8b7b0 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator3ES7.symbols @@ -0,0 +1,107 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts === + +var temp = 10; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-++temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+--temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-temp++) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-(1 ** ++temp)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-(1 ** --temp)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-(1 ** temp++)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-(1 ** temp--)) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** ++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** --temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(-3) ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** temp++ ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** temp-- ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** ++temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +(+3) ** --temp ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** -temp++; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** -temp--; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** -++temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** +--temp; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** (-temp++) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** (-temp--) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** (+temp++) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** (+temp--) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** (-++temp) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + +3 ** (+--temp) ** 2; +>temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperator3ES7.types b/tests/baselines/reference/emitExponentiationOperator3ES7.types new file mode 100644 index 0000000000000..0585b282b0f9a --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator3ES7.types @@ -0,0 +1,314 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts === + +var temp = 10; +>temp : number +>10 : number + +(-++temp) ** 3; +>(-++temp) ** 3 : number +>(-++temp) : number +>-++temp : number +>++temp : number +>temp : number +>3 : number + +(+--temp) ** 3; +>(+--temp) ** 3 : number +>(+--temp) : number +>+--temp : number +>--temp : number +>temp : number +>3 : number + +(-temp++) ** 3; +>(-temp++) ** 3 : number +>(-temp++) : number +>-temp++ : number +>temp++ : number +>temp : number +>3 : number + +(+temp--) ** 3; +>(+temp--) ** 3 : number +>(+temp--) : number +>+temp-- : number +>temp-- : number +>temp : number +>3 : number + +(-(1 ** ++temp)) ** 3; +>(-(1 ** ++temp)) ** 3 : number +>(-(1 ** ++temp)) : number +>-(1 ** ++temp) : number +>(1 ** ++temp) : number +>1 ** ++temp : number +>1 : number +>++temp : number +>temp : number +>3 : number + +(-(1 ** --temp)) ** 3; +>(-(1 ** --temp)) ** 3 : number +>(-(1 ** --temp)) : number +>-(1 ** --temp) : number +>(1 ** --temp) : number +>1 ** --temp : number +>1 : number +>--temp : number +>temp : number +>3 : number + +(-(1 ** temp++)) ** 3; +>(-(1 ** temp++)) ** 3 : number +>(-(1 ** temp++)) : number +>-(1 ** temp++) : number +>(1 ** temp++) : number +>1 ** temp++ : number +>1 : number +>temp++ : number +>temp : number +>3 : number + +(-(1 ** temp--)) ** 3; +>(-(1 ** temp--)) ** 3 : number +>(-(1 ** temp--)) : number +>-(1 ** temp--) : number +>(1 ** temp--) : number +>1 ** temp-- : number +>1 : number +>temp-- : number +>temp : number +>3 : number + +(-3) ** temp++; +>(-3) ** temp++ : number +>(-3) : number +>-3 : number +>3 : number +>temp++ : number +>temp : number + +(-3) ** temp--; +>(-3) ** temp-- : number +>(-3) : number +>-3 : number +>3 : number +>temp-- : number +>temp : number + +(-3) ** ++temp; +>(-3) ** ++temp : number +>(-3) : number +>-3 : number +>3 : number +>++temp : number +>temp : number + +(-3) ** --temp; +>(-3) ** --temp : number +>(-3) : number +>-3 : number +>3 : number +>--temp : number +>temp : number + +(+3) ** temp++; +>(+3) ** temp++ : number +>(+3) : number +>+3 : number +>3 : number +>temp++ : number +>temp : number + +(+3) ** temp--; +>(+3) ** temp-- : number +>(+3) : number +>+3 : number +>3 : number +>temp-- : number +>temp : number + +(+3) ** ++temp; +>(+3) ** ++temp : number +>(+3) : number +>+3 : number +>3 : number +>++temp : number +>temp : number + +(+3) ** --temp; +>(+3) ** --temp : number +>(+3) : number +>+3 : number +>3 : number +>--temp : number +>temp : number + +(-3) ** temp++ ** 2; +>(-3) ** temp++ ** 2 : number +>(-3) : number +>-3 : number +>3 : number +>temp++ ** 2 : number +>temp++ : number +>temp : number +>2 : number + +(-3) ** temp-- ** 2; +>(-3) ** temp-- ** 2 : number +>(-3) : number +>-3 : number +>3 : number +>temp-- ** 2 : number +>temp-- : number +>temp : number +>2 : number + +(-3) ** ++temp ** 2; +>(-3) ** ++temp ** 2 : number +>(-3) : number +>-3 : number +>3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number + +(-3) ** --temp ** 2; +>(-3) ** --temp ** 2 : number +>(-3) : number +>-3 : number +>3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number + +(+3) ** temp++ ** 2; +>(+3) ** temp++ ** 2 : number +>(+3) : number +>+3 : number +>3 : number +>temp++ ** 2 : number +>temp++ : number +>temp : number +>2 : number + +(+3) ** temp-- ** 2; +>(+3) ** temp-- ** 2 : number +>(+3) : number +>+3 : number +>3 : number +>temp-- ** 2 : number +>temp-- : number +>temp : number +>2 : number + +(+3) ** ++temp ** 2; +>(+3) ** ++temp ** 2 : number +>(+3) : number +>+3 : number +>3 : number +>++temp ** 2 : number +>++temp : number +>temp : number +>2 : number + +(+3) ** --temp ** 2; +>(+3) ** --temp ** 2 : number +>(+3) : number +>+3 : number +>3 : number +>--temp ** 2 : number +>--temp : number +>temp : number +>2 : number + +3 ** -temp++; +>3 ** -temp++ : number +>3 : number +>-temp++ : number +>temp++ : number +>temp : number + +3 ** -temp--; +>3 ** -temp-- : number +>3 : number +>-temp-- : number +>temp-- : number +>temp : number + +3 ** -++temp; +>3 ** -++temp : number +>3 : number +>-++temp : number +>++temp : number +>temp : number + +3 ** +--temp; +>3 ** +--temp : number +>3 : number +>+--temp : number +>--temp : number +>temp : number + +3 ** (-temp++) ** 2; +>3 ** (-temp++) ** 2 : number +>3 : number +>(-temp++) ** 2 : number +>(-temp++) : number +>-temp++ : number +>temp++ : number +>temp : number +>2 : number + +3 ** (-temp--) ** 2; +>3 ** (-temp--) ** 2 : number +>3 : number +>(-temp--) ** 2 : number +>(-temp--) : number +>-temp-- : number +>temp-- : number +>temp : number +>2 : number + +3 ** (+temp++) ** 2; +>3 ** (+temp++) ** 2 : number +>3 : number +>(+temp++) ** 2 : number +>(+temp++) : number +>+temp++ : number +>temp++ : number +>temp : number +>2 : number + +3 ** (+temp--) ** 2; +>3 ** (+temp--) ** 2 : number +>3 : number +>(+temp--) ** 2 : number +>(+temp--) : number +>+temp-- : number +>temp-- : number +>temp : number +>2 : number + +3 ** (-++temp) ** 2; +>3 ** (-++temp) ** 2 : number +>3 : number +>(-++temp) ** 2 : number +>(-++temp) : number +>-++temp : number +>++temp : number +>temp : number +>2 : number + +3 ** (+--temp) ** 2; +>3 ** (+--temp) ** 2 : number +>3 : number +>(+--temp) ** 2 : number +>(+--temp) : number +>+--temp : number +>--temp : number +>temp : number +>2 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator4.js b/tests/baselines/reference/emitExponentiationOperator4.js new file mode 100644 index 0000000000000..185616601bee7 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator4.js @@ -0,0 +1,68 @@ +//// [emitExponentiationOperator4.ts] +var temp: any; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; + +1 ** --temp ** 3; +1 ** ++temp ** 3; +1 ** temp-- ** 3; +1 ** temp++ ** 3; + +(void --temp) ** 3; +(void temp--) ** 3; +(void 3) ** 4; +(void temp++) ** 4; +(void temp--) ** 4; + + +1 ** (void --temp) ** 3; +1 ** (void temp--) ** 3; +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +1 ** (void temp--) ** 4; + +(~ --temp) ** 3; +(~ temp--) ** 3; +(~ 3) ** 4; +(~ temp++) ** 4; +(~ temp--) ** 4; + +1 ** (~ --temp) ** 3; +1 ** (~ temp--) ** 3; +1 ** (~ 3) ** 4; +1 ** (~ temp++) ** 4; +1 ** (~ temp--) ** 4; + +//// [emitExponentiationOperator4.js] +var temp; +Math.pow(--temp, 3); +Math.pow(++temp, 3); +Math.pow(temp--, 3); +Math.pow(temp++, 3); +Math.pow(1, Math.pow(--temp, 3)); +Math.pow(1, Math.pow(++temp, 3)); +Math.pow(1, Math.pow(temp--, 3)); +Math.pow(1, Math.pow(temp++, 3)); +Math.pow((void --temp), 3); +Math.pow((void temp--), 3); +Math.pow((void 3), 4); +Math.pow((void temp++), 4); +Math.pow((void temp--), 4); +Math.pow(1, Math.pow((void --temp), 3)); +Math.pow(1, Math.pow((void temp--), 3)); +Math.pow(1, Math.pow((void 3), 4)); +Math.pow(1, Math.pow((void temp++), 4)); +Math.pow(1, Math.pow((void temp--), 4)); +Math.pow((~--temp), 3); +Math.pow((~temp--), 3); +Math.pow((~3), 4); +Math.pow((~temp++), 4); +Math.pow((~temp--), 4); +Math.pow(1, Math.pow((~--temp), 3)); +Math.pow(1, Math.pow((~temp--), 3)); +Math.pow(1, Math.pow((~3), 4)); +Math.pow(1, Math.pow((~temp++), 4)); +Math.pow(1, Math.pow((~temp--), 4)); diff --git a/tests/baselines/reference/emitExponentiationOperator4.symbols b/tests/baselines/reference/emitExponentiationOperator4.symbols new file mode 100644 index 0000000000000..c57825f908a8d --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator4.symbols @@ -0,0 +1,81 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts === +var temp: any; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +--temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** ++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(void --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(void temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(void 3) ** 4; +(void temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(void temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + + +1 ** (void --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (void temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (void temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(~ --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(~ temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(~ 3) ** 4; +(~ temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +(~ temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (~ --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (~ temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (~ 3) ** 4; +1 ** (~ temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (~ temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperator4.types b/tests/baselines/reference/emitExponentiationOperator4.types new file mode 100644 index 0000000000000..2d5a7ea48f41c --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator4.types @@ -0,0 +1,245 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts === +var temp: any; +>temp : any + +--temp ** 3; +>--temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +++temp ** 3; +>++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +1 ** --temp ** 3; +>1 ** --temp ** 3 : number +>1 : number +>--temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +1 ** ++temp ** 3; +>1 ** ++temp ** 3 : number +>1 : number +>++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +1 ** temp-- ** 3; +>1 ** temp-- ** 3 : number +>1 : number +>temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +1 ** temp++ ** 3; +>1 ** temp++ ** 3 : number +>1 : number +>temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +(void --temp) ** 3; +>(void --temp) ** 3 : number +>(void --temp) : undefined +>void --temp : undefined +>--temp : number +>temp : any +>3 : number + +(void temp--) ** 3; +>(void temp--) ** 3 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>3 : number + +(void 3) ** 4; +>(void 3) ** 4 : number +>(void 3) : undefined +>void 3 : undefined +>3 : number +>4 : number + +(void temp++) ** 4; +>(void temp++) ** 4 : number +>(void temp++) : undefined +>void temp++ : undefined +>temp++ : number +>temp : any +>4 : number + +(void temp--) ** 4; +>(void temp--) ** 4 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>4 : number + + +1 ** (void --temp) ** 3; +>1 ** (void --temp) ** 3 : number +>1 : number +>(void --temp) ** 3 : number +>(void --temp) : undefined +>void --temp : undefined +>--temp : number +>temp : any +>3 : number + +1 ** (void temp--) ** 3; +>1 ** (void temp--) ** 3 : number +>1 : number +>(void temp--) ** 3 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>3 : number + +1 ** (void 3) ** 4; +>1 ** (void 3) ** 4 : number +>1 : number +>(void 3) ** 4 : number +>(void 3) : undefined +>void 3 : undefined +>3 : number +>4 : number + +1 ** (void temp++) ** 4; +>1 ** (void temp++) ** 4 : number +>1 : number +>(void temp++) ** 4 : number +>(void temp++) : undefined +>void temp++ : undefined +>temp++ : number +>temp : any +>4 : number + +1 ** (void temp--) ** 4; +>1 ** (void temp--) ** 4 : number +>1 : number +>(void temp--) ** 4 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>4 : number + +(~ --temp) ** 3; +>(~ --temp) ** 3 : number +>(~ --temp) : number +>~ --temp : number +>--temp : number +>temp : any +>3 : number + +(~ temp--) ** 3; +>(~ temp--) ** 3 : number +>(~ temp--) : number +>~ temp-- : number +>temp-- : number +>temp : any +>3 : number + +(~ 3) ** 4; +>(~ 3) ** 4 : number +>(~ 3) : number +>~ 3 : number +>3 : number +>4 : number + +(~ temp++) ** 4; +>(~ temp++) ** 4 : number +>(~ temp++) : number +>~ temp++ : number +>temp++ : number +>temp : any +>4 : number + +(~ temp--) ** 4; +>(~ temp--) ** 4 : number +>(~ temp--) : number +>~ temp-- : number +>temp-- : number +>temp : any +>4 : number + +1 ** (~ --temp) ** 3; +>1 ** (~ --temp) ** 3 : number +>1 : number +>(~ --temp) ** 3 : number +>(~ --temp) : number +>~ --temp : number +>--temp : number +>temp : any +>3 : number + +1 ** (~ temp--) ** 3; +>1 ** (~ temp--) ** 3 : number +>1 : number +>(~ temp--) ** 3 : number +>(~ temp--) : number +>~ temp-- : number +>temp-- : number +>temp : any +>3 : number + +1 ** (~ 3) ** 4; +>1 ** (~ 3) ** 4 : number +>1 : number +>(~ 3) ** 4 : number +>(~ 3) : number +>~ 3 : number +>3 : number +>4 : number + +1 ** (~ temp++) ** 4; +>1 ** (~ temp++) ** 4 : number +>1 : number +>(~ temp++) ** 4 : number +>(~ temp++) : number +>~ temp++ : number +>temp++ : number +>temp : any +>4 : number + +1 ** (~ temp--) ** 4; +>1 ** (~ temp--) ** 4 : number +>1 : number +>(~ temp--) ** 4 : number +>(~ temp--) : number +>~ temp-- : number +>temp-- : number +>temp : any +>4 : number + diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.js b/tests/baselines/reference/emitExponentiationOperator4ES7.js new file mode 100644 index 0000000000000..fb32144575d1c --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator4ES7.js @@ -0,0 +1,68 @@ +//// [emitExponentiationOperator4ES7.ts] +var temp: any; + +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; + +1 ** --temp ** 3; +1 ** ++temp ** 3; +1 ** temp-- ** 3; +1 ** temp++ ** 3; + +(void --temp) ** 3; +(void temp--) ** 3; +(void 3) ** 4; +(void temp++) ** 4; +(void temp--) ** 4; + + +1 ** (void --temp) ** 3; +1 ** (void temp--) ** 3; +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +1 ** (void temp--) ** 4; + +(~ --temp) ** 3; +(~temp--) ** 3; +(~3) ** 4; +(~temp++) ** 4; +(~temp--) ** 4; + +1 ** (~ --temp) ** 3; +1 ** (~temp--) ** 3; +1 ** (~3) ** 4; +1 ** (~temp++) ** 4; +1 ** (~temp--) ** 4; + +//// [emitExponentiationOperator4ES7.js] +var temp; +--temp ** 3; +++temp ** 3; +temp-- ** 3; +temp++ ** 3; +1 ** --temp ** 3; +1 ** ++temp ** 3; +1 ** temp-- ** 3; +1 ** temp++ ** 3; +(void --temp) ** 3; +(void temp--) ** 3; +(void 3) ** 4; +(void temp++) ** 4; +(void temp--) ** 4; +1 ** (void --temp) ** 3; +1 ** (void temp--) ** 3; +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +1 ** (void temp--) ** 4; +(~--temp) ** 3; +(~temp--) ** 3; +(~3) ** 4; +(~temp++) ** 4; +(~temp--) ** 4; +1 ** (~--temp) ** 3; +1 ** (~temp--) ** 3; +1 ** (~3) ** 4; +1 ** (~temp++) ** 4; +1 ** (~temp--) ** 4; diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.symbols b/tests/baselines/reference/emitExponentiationOperator4ES7.symbols new file mode 100644 index 0000000000000..53701ed5aef75 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator4ES7.symbols @@ -0,0 +1,81 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts === +var temp: any; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +--temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** --temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** ++temp ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** temp-- ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** temp++ ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(void --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(void temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(void 3) ** 4; +(void temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(void temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + + +1 ** (void --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (void temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (void 3) ** 4; +1 ** (void temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (void temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(~ --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(~temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(~3) ** 4; +(~temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +(~temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (~ --temp) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (~temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (~3) ** 4; +1 ** (~temp++) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (~temp--) ** 4; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.types b/tests/baselines/reference/emitExponentiationOperator4ES7.types new file mode 100644 index 0000000000000..78eacba9e39d9 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperator4ES7.types @@ -0,0 +1,245 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts === +var temp: any; +>temp : any + +--temp ** 3; +>--temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +++temp ** 3; +>++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +temp-- ** 3; +>temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +temp++ ** 3; +>temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +1 ** --temp ** 3; +>1 ** --temp ** 3 : number +>1 : number +>--temp ** 3 : number +>--temp ** 3 : number +>--temp : number +>temp : any +>3 : number + +1 ** ++temp ** 3; +>1 ** ++temp ** 3 : number +>1 : number +>++temp ** 3 : number +>++temp ** 3 : number +>++temp : number +>temp : any +>3 : number + +1 ** temp-- ** 3; +>1 ** temp-- ** 3 : number +>1 : number +>temp-- ** 3 : number +>temp-- ** 3 : number +>temp-- : number +>temp : any +>3 : number + +1 ** temp++ ** 3; +>1 ** temp++ ** 3 : number +>1 : number +>temp++ ** 3 : number +>temp++ ** 3 : number +>temp++ : number +>temp : any +>3 : number + +(void --temp) ** 3; +>(void --temp) ** 3 : number +>(void --temp) : undefined +>void --temp : undefined +>--temp : number +>temp : any +>3 : number + +(void temp--) ** 3; +>(void temp--) ** 3 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>3 : number + +(void 3) ** 4; +>(void 3) ** 4 : number +>(void 3) : undefined +>void 3 : undefined +>3 : number +>4 : number + +(void temp++) ** 4; +>(void temp++) ** 4 : number +>(void temp++) : undefined +>void temp++ : undefined +>temp++ : number +>temp : any +>4 : number + +(void temp--) ** 4; +>(void temp--) ** 4 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>4 : number + + +1 ** (void --temp) ** 3; +>1 ** (void --temp) ** 3 : number +>1 : number +>(void --temp) ** 3 : number +>(void --temp) : undefined +>void --temp : undefined +>--temp : number +>temp : any +>3 : number + +1 ** (void temp--) ** 3; +>1 ** (void temp--) ** 3 : number +>1 : number +>(void temp--) ** 3 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>3 : number + +1 ** (void 3) ** 4; +>1 ** (void 3) ** 4 : number +>1 : number +>(void 3) ** 4 : number +>(void 3) : undefined +>void 3 : undefined +>3 : number +>4 : number + +1 ** (void temp++) ** 4; +>1 ** (void temp++) ** 4 : number +>1 : number +>(void temp++) ** 4 : number +>(void temp++) : undefined +>void temp++ : undefined +>temp++ : number +>temp : any +>4 : number + +1 ** (void temp--) ** 4; +>1 ** (void temp--) ** 4 : number +>1 : number +>(void temp--) ** 4 : number +>(void temp--) : undefined +>void temp-- : undefined +>temp-- : number +>temp : any +>4 : number + +(~ --temp) ** 3; +>(~ --temp) ** 3 : number +>(~ --temp) : number +>~ --temp : number +>--temp : number +>temp : any +>3 : number + +(~temp--) ** 3; +>(~temp--) ** 3 : number +>(~temp--) : number +>~temp-- : number +>temp-- : number +>temp : any +>3 : number + +(~3) ** 4; +>(~3) ** 4 : number +>(~3) : number +>~3 : number +>3 : number +>4 : number + +(~temp++) ** 4; +>(~temp++) ** 4 : number +>(~temp++) : number +>~temp++ : number +>temp++ : number +>temp : any +>4 : number + +(~temp--) ** 4; +>(~temp--) ** 4 : number +>(~temp--) : number +>~temp-- : number +>temp-- : number +>temp : any +>4 : number + +1 ** (~ --temp) ** 3; +>1 ** (~ --temp) ** 3 : number +>1 : number +>(~ --temp) ** 3 : number +>(~ --temp) : number +>~ --temp : number +>--temp : number +>temp : any +>3 : number + +1 ** (~temp--) ** 3; +>1 ** (~temp--) ** 3 : number +>1 : number +>(~temp--) ** 3 : number +>(~temp--) : number +>~temp-- : number +>temp-- : number +>temp : any +>3 : number + +1 ** (~3) ** 4; +>1 ** (~3) ** 4 : number +>1 : number +>(~3) ** 4 : number +>(~3) : number +>~3 : number +>3 : number +>4 : number + +1 ** (~temp++) ** 4; +>1 ** (~temp++) ** 4 : number +>1 : number +>(~temp++) ** 4 : number +>(~temp++) : number +>~temp++ : number +>temp++ : number +>temp : any +>4 : number + +1 ** (~temp--) ** 4; +>1 ** (~temp--) ** 4 : number +>1 : number +>(~temp--) ** 4 : number +>(~temp--) : number +>~temp-- : number +>temp-- : number +>temp : any +>4 : number + From 46d799e05db02e57b3f73d8e97626095fa8a18e8 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:05:37 -0700 Subject: [PATCH 22/39] Add baselines for using exponentiation in template string --- ...ExponentiationOperatorInTempalteString4.js | 53 ++++ ...entiationOperatorInTempalteString4.symbols | 114 ++++++++ ...onentiationOperatorInTempalteString4.types | 233 +++++++++++++++ ...ExponentiationOperatorInTemplateString1.js | 95 +++---- ...entiationOperatorInTemplateString1.symbols | 265 +++++++++--------- ...onentiationOperatorInTemplateString1.types | 256 ++++++++--------- ...onentiationOperatorInTemplateString1ES6.js | 53 ++++ ...iationOperatorInTemplateString1ES6.symbols | 143 ++++++++++ ...ntiationOperatorInTemplateString1ES6.types | 240 ++++++++++++++++ ...ExponentiationOperatorInTemplateString2.js | 53 ++++ ...entiationOperatorInTemplateString2.symbols | 143 ++++++++++ ...onentiationOperatorInTemplateString2.types | 240 ++++++++++++++++ ...onentiationOperatorInTemplateString2ES6.js | 53 ++++ ...iationOperatorInTemplateString2ES6.symbols | 143 ++++++++++ ...ntiationOperatorInTemplateString2ES6.types | 240 ++++++++++++++++ ...ExponentiationOperatorInTemplateString3.js | 54 ++++ ...entiationOperatorInTemplateString3.symbols | 143 ++++++++++ ...onentiationOperatorInTemplateString3.types | 240 ++++++++++++++++ ...onentiationOperatorInTemplateString3ES6.js | 54 ++++ ...iationOperatorInTemplateString3ES6.symbols | 143 ++++++++++ ...ntiationOperatorInTemplateString3ES6.types | 240 ++++++++++++++++ 21 files changed, 2886 insertions(+), 312 deletions(-) create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTempalteString4.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString2.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString3.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js new file mode 100644 index 0000000000000..433cd76472684 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js @@ -0,0 +1,53 @@ +//// [emitExponentiationOperatorInTempalteString4.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** -t2} world`; +`${(-t1) ** t2 - t1} world`; +`${(-++t1) ** t2 - t1} world`; +`${(-t1++) ** t2 - t1} world`; +`${(~t1) ** t2 ** --t1 } world`; +`${typeof (t1 ** t2 ** t1) } world`; + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +`hello ${(-++t1) ** t2 - t1}`; +`hello ${(-t1++) ** t2 - t1}`; +`hello ${(~t1) ** t2 ** --t1 }`; +`hello ${typeof (t1 ** t2 ** t1)}`; + +//// [emitExponentiationOperatorInTempalteString4.js] +var t1 = 10; +var t2 = 10; +var s; +// With TemplateTail +(Math.pow(t1, -t2)) + " world"; +(Math.pow((-t1), t2) - t1) + " world"; +(Math.pow((-++t1), t2) - t1) + " world"; +(Math.pow((-t1++), t2) - t1) + " world"; +(Math.pow((~t1), Math.pow(t2, --t1))) + " world"; +typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; +// TempateHead & TemplateTail are empt +(Math.pow(t1, -t2)) + " hello world " + (Math.pow(t1, -t2)); +(Math.pow((-t1), t2) - t1) + " hello world " + (Math.pow((-t1), t2) - t1); +(Math.pow((-++t1), t2) - t1) + " hello world " + (Math.pow(t1, Math.pow((-++t1), -t1))); +(Math.pow((-t1++), t2) - t1) + " hello world " + (Math.pow(t2, Math.pow((-t1++), -t1))); +(Math.pow((~t1), Math.pow(t2, --t1))) + " hello world " + (Math.pow((~t1), Math.pow(t2, --t1))); +typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))); +// With templateHead +"hello " + (Math.pow((-t1), t2) - t1); +"hello " + (Math.pow((-++t1), t2) - t1); +"hello " + (Math.pow((-t1++), t2) - t1); +"hello " + (Math.pow((~t1), Math.pow(t2, --t1))); +"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.symbols b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.symbols new file mode 100644 index 0000000000000..7892323ef1d0f --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTempalteString4.ts, 3, 3)) + +// With TemplateTail +`${t1 ** -t2} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) + +`${(-t1) ** t2 - t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${(-++t1) ** t2 - t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${(-t1++) ** t2 - t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${(~t1) ** t2 ** --t1 } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) + +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`hello ${(-++t1) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`hello ${(-t1++) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`hello ${(~t1) ** t2 ** --t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1)}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types new file mode 100644 index 0000000000000..b4d1aebd4f687 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types @@ -0,0 +1,233 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// With TemplateTail +`${t1 ** -t2} world`; +>`${t1 ** -t2} world` : string +>t1 ** -t2 : number +>t1 : number +>-t2 : number +>t2 : number + +`${(-t1) ** t2 - t1} world`; +>`${(-t1) ** t2 - t1} world` : string +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number + +`${(-++t1) ** t2 - t1} world`; +>`${(-++t1) ** t2 - t1} world` : string +>(-++t1) ** t2 - t1 : number +>(-++t1) ** t2 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number + +`${(-t1++) ** t2 - t1} world`; +>`${(-t1++) ** t2 - t1} world` : string +>(-t1++) ** t2 - t1 : number +>(-t1++) ** t2 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number + +`${(~t1) ** t2 ** --t1 } world`; +>`${(~t1) ** t2 ** --t1 } world` : string +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } world`; +>`${typeof (t1 ** t2 ** t1) } world` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +>`${t1 ** -t2} hello world ${t1 ** -t2}` : string +>t1 ** -t2 : number +>t1 : number +>-t2 : number +>t2 : number +>t1 ** -t2 : number +>t1 : number +>-t2 : number +>t2 : number + +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +>`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}` : string +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number + +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +>`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}` : string +>(-++t1) ** t2 - t1 : number +>(-++t1) ** t2 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** (-++t1) **- t1 : number +>t1 : number +>(-++t1) **- t1 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>- t1 : number +>t1 : number + +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +>`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}` : string +>(-t1++) ** t2 - t1 : number +>(-t1++) ** t2 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number +>t2 ** (-t1++) ** - t1 : number +>t2 : number +>(-t1++) ** - t1 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>- t1 : number +>t1 : number + +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +>`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }` : string +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; +>`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +>`hello ${(-t1) ** t2 - t1}` : string +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${(-++t1) ** t2 - t1}`; +>`hello ${(-++t1) ** t2 - t1}` : string +>(-++t1) ** t2 - t1 : number +>(-++t1) ** t2 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${(-t1++) ** t2 - t1}`; +>`hello ${(-t1++) ** t2 - t1}` : string +>(-t1++) ** t2 - t1 : number +>(-t1++) ** t2 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${(~t1) ** t2 ** --t1 }`; +>`hello ${(~t1) ** t2 ** --t1 }` : string +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1)}`; +>`hello ${typeof (t1 ** t2 ** t1)}` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js index cea4b78963b64..eb879cce6a54d 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js @@ -1,60 +1,53 @@ //// [emitExponentiationOperatorInTemplateString1.ts] + var t1 = 10; var t2 = 10; var s; -`Exp: ${t1 ** t2} abc`; -`Exp: ${t1 ** t2 ** t1} abc`; -`Exp: ${t1 + t2 ** t1} abc`; -`Exp: ${t1 - t2 ** t1} abc`; -`Exp: ${t1 ** t2 + t1} abc`; -`Exp: ${t1 ** t2 - t1} abc`; -`Exp: ${t1 + t2 ** t2 + t1} abc`; -`Exp: ${t1 - t2 ** t2 - t1} abc`; -`Exp: ${-t1 ** t2 - t1} abc`; -`Exp: ${+t1 ** t2 - t1} abc`; -`Exp: ${-++t1 ** t2 - t1} abc`; -`Exp: ${+--t1 ** t2 - t1} abc`; -`Exp: ${-t1++ ** t2 - t1} abc`; -`Exp: ${-t1-- ** t2 - t1} abc`; -`Exp: ${+t1++ ** t2 - t1} abc`; -`Exp: ${+t1-- ** t2 - t1} abc`; -`Exp: ${typeof t1 ** t2 ** t1} abc`; -`Exp: ${typeof t1 ** t2 + t1} abc`; -`Exp: ${typeof t1 ** (t2 - t1)} abc`; -`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; -`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; -`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; -`Exp: ${!t1 ** t2 ** t1} abc`; -`Exp: ${!t1 ** t2 ** ++t1} abc`; -`Exp: ${!t1 ** t2 ** --t1} abc`; - + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +`${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1 }`; +`${typeof (t1 ** t2 ** t1) }`; +`${1 + typeof (t1 ** t2 ** t1) }`; + +`${t1 ** t2}${t1 ** t2}`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; + +`${t1 ** t2} hello world ${t1 ** t2}`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; //// [emitExponentiationOperatorInTemplateString1.js] var t1 = 10; var t2 = 10; var s; -"Exp: " + (Math.pow(t1, t2)) + " abc"; -"Exp: " + (Math.pow(t1, Math.pow(t2, t1))) + " abc"; -"Exp: " + (t1 + Math.pow(t2, t1)) + " abc"; -"Exp: " + (t1 - Math.pow(t2, t1)) + " abc"; -"Exp: " + (Math.pow(t1, t2) + t1) + " abc"; -"Exp: " + (Math.pow(t1, t2) - t1) + " abc"; -"Exp: " + (t1 + Math.pow(t2, t2) + t1) + " abc"; -"Exp: " + (t1 - Math.pow(t2, t2) - t1) + " abc"; -"Exp: " + (-Math.pow(t1, t2) - t1) + " abc"; -"Exp: " + (+Math.pow(t1, t2) - t1) + " abc"; -"Exp: " + (-Math.pow(++t1, t2) - t1) + " abc"; -"Exp: " + (+Math.pow(--t1, t2) - t1) + " abc"; -"Exp: " + (-Math.pow(t1++, t2) - t1) + " abc"; -"Exp: " + (-Math.pow(t1--, t2) - t1) + " abc"; -"Exp: " + (+Math.pow(t1++, t2) - t1) + " abc"; -"Exp: " + (+Math.pow(t1--, t2) - t1) + " abc"; -"Exp: " + typeof Math.pow(t1, Math.pow(t2, t1)) + " abc"; -"Exp: " + (typeof Math.pow(t1, t2) + t1) + " abc"; -"Exp: " + typeof Math.pow(t1, (t2 - t1)) + " abc"; -"Exp: " + (1 + typeof Math.pow(t1, Math.pow(t2, t1))) + " abc"; -"Exp: " + (2 + typeof Math.pow(t1, Math.pow(t2, ++t1))) + " abc"; -"Exp: " + (3 + typeof Math.pow(t1, Math.pow(t2, --t1))) + " abc"; -"Exp: " + !Math.pow(t1, Math.pow(t2, t1)) + " abc"; -"Exp: " + !Math.pow(t1, Math.pow(t2, ++t1)) + " abc"; -"Exp: " + !Math.pow(t1, Math.pow(t2, --t1)) + " abc"; +// TempateHead & TemplateTail are empty +"" + (Math.pow(t1, t2)); +"" + (Math.pow(t1, Math.pow(t2, t1))); +"" + (t1 + Math.pow(t2, t1)); +"" + (Math.pow(t1, t2) + t1); +"" + (t1 + Math.pow(t2, t2) + t1); +"" + typeof (Math.pow(t1, Math.pow(t2, t1))); +"" + (1 + typeof (Math.pow(t1, Math.pow(t2, t1)))); +"" + (Math.pow(t1, t2)) + (Math.pow(t1, t2)); +"" + (Math.pow(t1, Math.pow(t2, t1))) + (Math.pow(t1, Math.pow(t2, t1))); +"" + (t1 + Math.pow(t2, t1)) + (t1 + Math.pow(t2, t1)); +"" + (Math.pow(t1, t2) + t1) + (Math.pow(t1, t2) + t1); +"" + (t1 + Math.pow(t2, t2) + t1) + (t1 + Math.pow(t2, t2) + t1); +"" + typeof (Math.pow(t1, Math.pow(t2, t1))) + typeof (Math.pow(t1, Math.pow(t2, t1))); +(Math.pow(t1, t2)) + " hello world " + (Math.pow(t1, t2)); +(Math.pow(t1, Math.pow(t2, t1))) + " hello world " + (Math.pow(t1, Math.pow(t2, t1))); +(t1 + Math.pow(t2, t1)) + " hello world " + (t1 + Math.pow(t2, t1)); +(Math.pow(t1, t2) + t1) + " hello world " + (Math.pow(t1, t2) + t1); +(t1 + Math.pow(t2, t2) + t1) + " hello world " + (t1 + Math.pow(t2, t2) + t1); +typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols index 5ef2abc439589..8830135987eaf 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.symbols @@ -1,136 +1,143 @@ === tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts === + var t1 = 10; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) var t2 = 10; ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) var s; ->s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) - -`Exp: ${t1 ** t2} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) - -`Exp: ${t1 ** t2 ** t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${t1 + t2 ** t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${t1 - t2 ** t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${t1 ** t2 + t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${t1 ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${t1 + t2 ** t2 + t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${t1 - t2 ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${-t1 ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${+t1 ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${-++t1 ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${+--t1 ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${-t1++ ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${-t1-- ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${+t1++ ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${+t1-- ** t2 - t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${typeof t1 ** t2 ** t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${typeof t1 ** t2 + t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${typeof t1 ** (t2 - t1)} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${!t1 ** t2 ** t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${!t1 ** t2 ** ++t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) - -`Exp: ${!t1 ** t2 ** --t1} abc`; ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) ->t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) ->t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 0, 3)) +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString1.ts, 3, 3)) + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) + +`${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${1 + typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 ** t2}${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 ** t2} hello world ${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1.ts, 1, 3)) diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types index b6324c4bd4c98..02ae523c168e3 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1.ts === + var t1 = 10; >t1 : number >10 : number @@ -10,54 +11,39 @@ var t2 = 10; var s; >s : any -`Exp: ${t1 ** t2} abc`; ->`Exp: ${t1 ** t2} abc` : string +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +>`${t1 ** t2}` : string >t1 ** t2 : number >t1 : number >t2 : number -`Exp: ${t1 ** t2 ** t1} abc`; ->`Exp: ${t1 ** t2 ** t1} abc` : string +`${t1 ** t2 ** t1}`; +>`${t1 ** t2 ** t1}` : string >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${t1 + t2 ** t1} abc`; ->`Exp: ${t1 + t2 ** t1} abc` : string +`${t1 + t2 ** t1}`; +>`${t1 + t2 ** t1}` : string >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${t1 - t2 ** t1} abc`; ->`Exp: ${t1 - t2 ** t1} abc` : string ->t1 - t2 ** t1 : number ->t1 : number ->t2 ** t1 : number ->t2 : number ->t1 : number - -`Exp: ${t1 ** t2 + t1} abc`; ->`Exp: ${t1 ** t2 + t1} abc` : string +`${t1 ** t2 + t1}`; +>`${t1 ** t2 + t1}` : string >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number >t2 : number >t1 : number -`Exp: ${t1 ** t2 - t1} abc`; ->`Exp: ${t1 ** t2 - t1} abc` : string ->t1 ** t2 - t1 : number ->t1 ** t2 : number ->t1 : number ->t2 : number ->t1 : number - -`Exp: ${t1 + t2 ** t2 + t1} abc`; ->`Exp: ${t1 + t2 ** t2 + t1} abc` : string +`${t1 + t2 ** t2 + t1 }`; +>`${t1 + t2 ** t2 + t1 }` : string >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -66,183 +52,189 @@ var s; >t2 : number >t1 : number -`Exp: ${t1 - t2 ** t2 - t1} abc`; ->`Exp: ${t1 - t2 ** t2 - t1} abc` : string ->t1 - t2 ** t2 - t1 : number ->t1 - t2 ** t2 : number +`${typeof (t1 ** t2 ** t1) }`; +>`${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number >t1 : number ->t2 ** t2 : number ->t2 : number +>t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${-t1 ** t2 - t1} abc`; ->`Exp: ${-t1 ** t2 - t1} abc` : string ->-t1 ** t2 - t1 : number ->-t1 ** t2 : number ->t1 ** t2 : number +`${1 + typeof (t1 ** t2 ** t1) }`; +>`${1 + typeof (t1 ** t2 ** t1) }` : string +>1 + typeof (t1 ** t2 ** t1) : string +>1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number >t1 : number +>t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${+t1 ** t2 - t1} abc`; ->`Exp: ${+t1 ** t2 - t1} abc` : string ->+t1 ** t2 - t1 : number ->+t1 ** t2 : number +`${t1 ** t2}${t1 ** t2}`; +>`${t1 ** t2}${t1 ** t2}` : string >t1 ** t2 : number >t1 : number >t2 : number +>t1 ** t2 : number >t1 : number +>t2 : number -`Exp: ${-++t1 ** t2 - t1} abc`; ->`Exp: ${-++t1 ** t2 - t1} abc` : string ->-++t1 ** t2 - t1 : number ->-++t1 ** t2 : number ->++t1 ** t2 : number ->++t1 : number +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number >t1 : number +>t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${+--t1 ** t2 - t1} abc`; ->`Exp: ${+--t1 ** t2 - t1} abc` : string ->+--t1 ** t2 - t1 : number ->+--t1 ** t2 : number ->--t1 ** t2 : number ->--t1 : number +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>`${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number >t1 : number +>t2 ** t1 : number >t2 : number >t1 : number - -`Exp: ${-t1++ ** t2 - t1} abc`; ->`Exp: ${-t1++ ** t2 - t1} abc` : string ->-t1++ ** t2 - t1 : number ->-t1++ ** t2 : number ->t1++ ** t2 : number ->t1++ : number +>t1 + t2 ** t1 : number >t1 : number +>t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${-t1-- ** t2 - t1} abc`; ->`Exp: ${-t1-- ** t2 - t1} abc` : string ->-t1-- ** t2 - t1 : number ->-t1-- ** t2 : number ->t1-- ** t2 : number ->t1-- : number +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>`${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number >t1 : number >t2 : number >t1 : number - -`Exp: ${+t1++ ** t2 - t1} abc`; ->`Exp: ${+t1++ ** t2 - t1} abc` : string ->+t1++ ** t2 - t1 : number ->+t1++ ** t2 : number ->t1++ ** t2 : number ->t1++ : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number >t1 : number >t2 : number >t1 : number -`Exp: ${+t1-- ** t2 - t1} abc`; ->`Exp: ${+t1-- ** t2 - t1} abc` : string ->+t1-- ** t2 - t1 : number ->+t1-- ** t2 : number ->t1-- ** t2 : number ->t1-- : number +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number >t1 : number +>t2 ** t2 : number +>t2 : number >t2 : number >t1 : number -`Exp: ${typeof t1 ** t2 ** t1} abc`; ->`Exp: ${typeof t1 ** t2 ** t1} abc` : string ->typeof t1 ** t2 ** t1 : string +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; +>`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${typeof t1 ** t2 + t1} abc`; ->`Exp: ${typeof t1 ** t2 + t1} abc` : string ->typeof t1 ** t2 + t1 : string ->typeof t1 ** t2 : string +`${t1 ** t2} hello world ${t1 ** t2}`; +>`${t1 ** t2} hello world ${t1 ** t2}` : string >t1 ** t2 : number >t1 : number >t2 : number +>t1 ** t2 : number >t1 : number +>t2 : number -`Exp: ${typeof t1 ** (t2 - t1)} abc`; ->`Exp: ${typeof t1 ** (t2 - t1)} abc` : string ->typeof t1 ** (t2 - t1) : string ->t1 ** (t2 - t1) : number +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number >t1 : number ->(t2 - t1) : number ->t2 - t1 : number +>t2 ** t1 : number >t2 : number >t1 : number - -`Exp: ${1 + typeof t1 ** t2 ** t1} abc`; ->`Exp: ${1 + typeof t1 ** t2 ** t1} abc` : string ->1 + typeof t1 ** t2 ** t1 : string ->1 : number ->typeof t1 ** t2 ** t1 : string >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc`; ->`Exp: ${2 + typeof t1 ** t2 ** ++t1} abc` : string ->2 + typeof t1 ** t2 ** ++t1 : string ->2 : number ->typeof t1 ** t2 ** ++t1 : string ->t1 ** t2 ** ++t1 : number +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number >t1 : number ->t2 ** ++t1 : number +>t2 ** t1 : number >t2 : number ->++t1 : number >t1 : number - -`Exp: ${3 + typeof t1 ** t2 ** --t1} abc`; ->`Exp: ${3 + typeof t1 ** t2 ** --t1} abc` : string ->3 + typeof t1 ** t2 ** --t1 : string ->3 : number ->typeof t1 ** t2 ** --t1 : string ->t1 ** t2 ** --t1 : number +>t1 + t2 ** t1 : number >t1 : number ->t2 ** --t1 : number +>t2 ** t1 : number >t2 : number ->--t1 : number >t1 : number -`Exp: ${!t1 ** t2 ** t1} abc`; ->`Exp: ${!t1 ** t2 ** t1} abc` : string ->!t1 ** t2 ** t1 : boolean ->t1 ** t2 ** t1 : number +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number >t1 : number ->t2 ** t1 : number >t2 : number >t1 : number -`Exp: ${!t1 ** t2 ** ++t1} abc`; ->`Exp: ${!t1 ** t2 ** ++t1} abc` : string ->!t1 ** t2 ** ++t1 : boolean ->t1 ** t2 ** ++t1 : number +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number >t1 : number ->t2 ** ++t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number >t2 : number ->++t1 : number >t1 : number -`Exp: ${!t1 ** t2 ** --t1} abc`; ->`Exp: ${!t1 ** t2 ** --t1} abc` : string ->!t1 ** t2 ** --t1 : boolean ->t1 ** t2 ** --t1 : number +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number >t1 : number ->t2 ** --t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number >t2 : number ->--t1 : number >t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.js new file mode 100644 index 0000000000000..d32caf4510644 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.js @@ -0,0 +1,53 @@ +//// [emitExponentiationOperatorInTemplateString1ES6.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +`${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1 }`; +`${typeof (t1 ** t2 ** t1) }`; +`${1 + typeof (t1 ** t2 ** t1) }`; + +`${t1 ** t2}${t1 ** t2}`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; + +`${t1 ** t2} hello world ${t1 ** t2}`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; + +//// [emitExponentiationOperatorInTemplateString1ES6.js] +var t1 = 10; +var t2 = 10; +var s; +// TempateHead & TemplateTail are empty +`${Math.pow(t1, t2)}`; +`${Math.pow(t1, Math.pow(t2, t1))}`; +`${t1 + Math.pow(t2, t1)}`; +`${Math.pow(t1, t2) + t1}`; +`${t1 + Math.pow(t2, t2) + t1}`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +`${1 + typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +`${Math.pow(t1, t2)}${Math.pow(t1, t2)}`; +`${Math.pow(t1, Math.pow(t2, t1))}${Math.pow(t1, Math.pow(t2, t1))}`; +`${t1 + Math.pow(t2, t1)}${t1 + Math.pow(t2, t1)}`; +`${Math.pow(t1, t2) + t1}${Math.pow(t1, t2) + t1}`; +`${t1 + Math.pow(t2, t2) + t1}${t1 + Math.pow(t2, t2) + t1}`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))}${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +`${Math.pow(t1, t2)} hello world ${Math.pow(t1, t2)}`; +`${Math.pow(t1, Math.pow(t2, t1))} hello world ${Math.pow(t1, Math.pow(t2, t1))}`; +`${t1 + Math.pow(t2, t1)} hello world ${t1 + Math.pow(t2, t1)}`; +`${Math.pow(t1, t2) + t1} hello world ${Math.pow(t1, t2) + t1}`; +`${t1 + Math.pow(t2, t2) + t1} hello world ${t1 + Math.pow(t2, t2) + t1}`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))} hello world ${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.symbols new file mode 100644 index 0000000000000..7b07fa26bba13 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.symbols @@ -0,0 +1,143 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 3, 3)) + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) + +`${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${1 + typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 ** t2}${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 ** t2} hello world ${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString1ES6.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types new file mode 100644 index 0000000000000..c2ee01ff23fa0 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types @@ -0,0 +1,240 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString1ES6.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// TempateHead & TemplateTail are empty +`${t1 ** t2}`; +>`${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1}`; +>`${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1}`; +>`${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1}`; +>`${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1 }`; +>`${t1 + t2 ** t2 + t1 }` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) }`; +>`${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${1 + typeof (t1 ** t2 ** t1) }`; +>`${1 + typeof (t1 ** t2 ** t1) }` : string +>1 + typeof (t1 ** t2 ** t1) : string +>1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2}${t1 ** t2}`; +>`${t1 ** t2}${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>`${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>`${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; +>`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2} hello world ${t1 ** t2}`; +>`${t1 ** t2} hello world ${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js new file mode 100644 index 0000000000000..733847627067c --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js @@ -0,0 +1,53 @@ +//// [emitExponentiationOperatorInTemplateString2.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// With templateHead +`hello ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1 }`; +`hello ${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof (t1 ** t2 ** t1) }`; + +`hello ${t1 ** t2}${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; + +//// [emitExponentiationOperatorInTemplateString2.js] +var t1 = 10; +var t2 = 10; +var s; +// With templateHead +"hello " + (Math.pow(t1, t2)); +"hello " + (Math.pow(t1, Math.pow(t2, t1))); +"hello " + (t1 + Math.pow(t2, t1)); +"hello " + (Math.pow(t1, t2) + t1); +"hello " + (t1 + Math.pow(t2, t2) + t1); +"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))); +"hello " + (1 + typeof (Math.pow(t1, Math.pow(t2, t1)))); +"hello " + (Math.pow(t1, t2)) + (Math.pow(t1, t2)); +"hello " + (Math.pow(t1, Math.pow(t2, t1))) + (Math.pow(t1, Math.pow(t2, t1))); +"hello " + (t1 + Math.pow(t2, t1)) + (t1 + Math.pow(t2, t1)); +"hello " + (Math.pow(t1, t2) + t1) + (Math.pow(t1, t2) + t1); +"hello " + (t1 + Math.pow(t2, t2) + t1) + (t1 + Math.pow(t2, t2) + t1); +"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))) + typeof (Math.pow(t1, Math.pow(t2, t1))); +"hello " + (Math.pow(t1, t2)) + " hello world " + (Math.pow(t1, t2)); +"hello " + (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + (Math.pow(t1, Math.pow(t2, t1))); +"hello " + (t1 + Math.pow(t2, t1)) + " hello world " + (t1 + Math.pow(t2, t1)); +"hello " + (Math.pow(t1, t2) + t1) + " hello world " + (Math.pow(t1, t2) + t1); +"hello " + (t1 + Math.pow(t2, t2) + t1) + " hello world " + (t1 + Math.pow(t2, t2) + t1); +"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.symbols new file mode 100644 index 0000000000000..224499c12894f --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.symbols @@ -0,0 +1,143 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString2.ts, 3, 3)) + +// With templateHead +`hello ${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) + +`hello ${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 + t2 ** t2 + t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${1 + typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 ** t2}${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) + +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) + +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types new file mode 100644 index 0000000000000..05816e94c6c62 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types @@ -0,0 +1,240 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// With templateHead +`hello ${t1 ** t2}`; +>`hello ${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number + +`hello ${t1 ** t2 ** t1}`; +>`hello ${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t1}`; +>`hello ${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2 + t1}`; +>`hello ${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t2 + t1 }`; +>`hello ${t1 + t2 ** t2 + t1 }` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1) }`; +>`hello ${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${1 + typeof (t1 ** t2 ** t1) }`; +>`hello ${1 + typeof (t1 ** t2 ** t1) }` : string +>1 + typeof (t1 ** t2 ** t1) : string +>1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2}${t1 ** t2}`; +>`hello ${t1 ** t2}${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; +>`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +>`hello ${t1 ** t2} hello world ${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.js new file mode 100644 index 0000000000000..ac92b4598aa2f --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.js @@ -0,0 +1,53 @@ +//// [emitExponentiationOperatorInTemplateString2ES6.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// With templateHead +`hello ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1 }`; +`hello ${typeof (t1 ** t2 ** t1) }`; +`hello ${1 + typeof (t1 ** t2 ** t1) }`; + +`hello ${t1 ** t2}${t1 ** t2}`; +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; + +//// [emitExponentiationOperatorInTemplateString2ES6.js] +var t1 = 10; +var t2 = 10; +var s; +// With templateHead +`hello ${Math.pow(t1, t2)}`; +`hello ${Math.pow(t1, Math.pow(t2, t1))}`; +`hello ${t1 + Math.pow(t2, t1)}`; +`hello ${Math.pow(t1, t2) + t1}`; +`hello ${t1 + Math.pow(t2, t2) + t1}`; +`hello ${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +`hello ${1 + typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +`hello ${Math.pow(t1, t2)}${Math.pow(t1, t2)}`; +`hello ${Math.pow(t1, Math.pow(t2, t1))}${Math.pow(t1, Math.pow(t2, t1))}`; +`hello ${t1 + Math.pow(t2, t1)}${t1 + Math.pow(t2, t1)}`; +`hello ${Math.pow(t1, t2) + t1}${Math.pow(t1, t2) + t1}`; +`hello ${t1 + Math.pow(t2, t2) + t1}${t1 + Math.pow(t2, t2) + t1}`; +`hello ${typeof (Math.pow(t1, Math.pow(t2, t1)))}${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +`hello ${Math.pow(t1, t2)} hello world ${Math.pow(t1, t2)}`; +`hello ${Math.pow(t1, Math.pow(t2, t1))} hello world ${Math.pow(t1, Math.pow(t2, t1))}`; +`hello ${t1 + Math.pow(t2, t1)} hello world ${t1 + Math.pow(t2, t1)}`; +`hello ${Math.pow(t1, t2) + t1} hello world ${Math.pow(t1, t2) + t1}`; +`hello ${t1 + Math.pow(t2, t2) + t1} hello world ${t1 + Math.pow(t2, t2) + t1}`; +`hello ${typeof (Math.pow(t1, Math.pow(t2, t1)))} hello world ${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.symbols new file mode 100644 index 0000000000000..fd674b21d330a --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.symbols @@ -0,0 +1,143 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 3, 3)) + +// With templateHead +`hello ${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) + +`hello ${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 + t2 ** t2 + t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${1 + typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 ** t2}${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) + +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) + +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString2ES6.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types new file mode 100644 index 0000000000000..b77e38587c2cd --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types @@ -0,0 +1,240 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString2ES6.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// With templateHead +`hello ${t1 ** t2}`; +>`hello ${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number + +`hello ${t1 ** t2 ** t1}`; +>`hello ${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t1}`; +>`hello ${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2 + t1}`; +>`hello ${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t2 + t1 }`; +>`hello ${t1 + t2 ** t2 + t1 }` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1) }`; +>`hello ${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${1 + typeof (t1 ** t2 ** t1) }`; +>`hello ${1 + typeof (t1 ** t2 ** t1) }` : string +>1 + typeof (t1 ** t2 ** t1) : string +>1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2}${t1 ** t2}`; +>`hello ${t1 ** t2}${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; +>`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; +>`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; +>`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; +>`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; +>`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2} hello world ${t1 ** t2}`; +>`hello ${t1 ** t2} hello world ${t1 ** t2}` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; +>`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; +>`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; +>`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; +>`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; +>`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js new file mode 100644 index 0000000000000..9c3b937d94bf3 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js @@ -0,0 +1,54 @@ +//// [emitExponentiationOperatorInTemplateString3.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** t2} world`; +`${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1 } world`; +`${typeof (t1 ** t2 ** t1) } world`; +`${1 + typeof (t1 ** t2 ** t1) } world`; + +`${t1 ** t2}${t1 ** t2} world`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; + + +//// [emitExponentiationOperatorInTemplateString3.js] +var t1 = 10; +var t2 = 10; +var s; +// With TemplateTail +(Math.pow(t1, t2)) + " world"; +(Math.pow(t1, Math.pow(t2, t1))) + " world"; +(t1 + Math.pow(t2, t1)) + " world"; +(Math.pow(t1, t2) + t1) + " world"; +(t1 + Math.pow(t2, t2) + t1) + " world"; +typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; +(1 + typeof (Math.pow(t1, Math.pow(t2, t1)))) + " world"; +"" + (Math.pow(t1, t2)) + (Math.pow(t1, t2)) + " world"; +"" + (Math.pow(t1, Math.pow(t2, t1))) + (Math.pow(t1, Math.pow(t2, t1))) + " world"; +"" + (t1 + Math.pow(t2, t1)) + (t1 + Math.pow(t2, t1)) + " world"; +"" + (Math.pow(t1, t2) + t1) + (Math.pow(t1, t2) + t1) + " world"; +"" + (t1 + Math.pow(t2, t2) + t1) + (t1 + Math.pow(t2, t2) + t1) + " world"; +"" + typeof (Math.pow(t1, Math.pow(t2, t1))) + typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; +(Math.pow(t1, t2)) + " hello world " + (Math.pow(t1, t2)) + " !!"; +(Math.pow(t1, Math.pow(t2, t1))) + " hello world " + (Math.pow(t1, Math.pow(t2, t1))) + " !!"; +(t1 + Math.pow(t2, t1)) + " hello world " + (t1 + Math.pow(t2, t1)) + " !!"; +(Math.pow(t1, t2) + t1) + " hello world " + (Math.pow(t1, t2) + t1) + " !!"; +(t1 + Math.pow(t2, t2) + t1) + " hello world " + (t1 + Math.pow(t2, t2) + t1) + " !!"; +typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))) + " !!"; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.symbols new file mode 100644 index 0000000000000..758a0e2956be6 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.symbols @@ -0,0 +1,143 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString3.ts, 3, 3)) + +// With TemplateTail +`${t1 ** t2} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) + +`${t1 ** t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 + t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 ** t2 + t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1 } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${1 + typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 ** t2}${t1 ** t2} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types new file mode 100644 index 0000000000000..88c23ee8a0b47 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types @@ -0,0 +1,240 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// With TemplateTail +`${t1 ** t2} world`; +>`${t1 ** t2} world` : string +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1} world`; +>`${t1 ** t2 ** t1} world` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1} world`; +>`${t1 + t2 ** t1} world` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1} world`; +>`${t1 ** t2 + t1} world` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1 } world`; +>`${t1 + t2 ** t2 + t1 } world` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } world`; +>`${typeof (t1 ** t2 ** t1) } world` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${1 + typeof (t1 ** t2 ** t1) } world`; +>`${1 + typeof (t1 ** t2 ** t1) } world` : string +>1 + typeof (t1 ** t2 ** t1) : string +>1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2}${t1 ** t2} world`; +>`${t1 ** t2}${t1 ** t2} world` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +>`${t1 + t2 ** t1}${t1 + t2 ** t1} world` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +>`${t1 ** t2 + t1}${t1 ** t2 + t1} world` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; +>`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +>`${t1 ** t2} hello world ${t1 ** t2} !!` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.js new file mode 100644 index 0000000000000..ec037dd2150b0 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.js @@ -0,0 +1,54 @@ +//// [emitExponentiationOperatorInTemplateString3ES6.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** t2} world`; +`${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1 } world`; +`${typeof (t1 ** t2 ** t1) } world`; +`${1 + typeof (t1 ** t2 ** t1) } world`; + +`${t1 ** t2}${t1 ** t2} world`; +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; + + +//// [emitExponentiationOperatorInTemplateString3ES6.js] +var t1 = 10; +var t2 = 10; +var s; +// With TemplateTail +`${Math.pow(t1, t2)} world`; +`${Math.pow(t1, Math.pow(t2, t1))} world`; +`${t1 + Math.pow(t2, t1)} world`; +`${Math.pow(t1, t2) + t1} world`; +`${t1 + Math.pow(t2, t2) + t1} world`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))} world`; +`${1 + typeof (Math.pow(t1, Math.pow(t2, t1)))} world`; +`${Math.pow(t1, t2)}${Math.pow(t1, t2)} world`; +`${Math.pow(t1, Math.pow(t2, t1))}${Math.pow(t1, Math.pow(t2, t1))} world`; +`${t1 + Math.pow(t2, t1)}${t1 + Math.pow(t2, t1)} world`; +`${Math.pow(t1, t2) + t1}${Math.pow(t1, t2) + t1} world`; +`${t1 + Math.pow(t2, t2) + t1}${t1 + Math.pow(t2, t2) + t1} world`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))}${typeof (Math.pow(t1, Math.pow(t2, t1)))} world`; +`${Math.pow(t1, t2)} hello world ${Math.pow(t1, t2)} !!`; +`${Math.pow(t1, Math.pow(t2, t1))} hello world ${Math.pow(t1, Math.pow(t2, t1))} !!`; +`${t1 + Math.pow(t2, t1)} hello world ${t1 + Math.pow(t2, t1)} !!`; +`${Math.pow(t1, t2) + t1} hello world ${Math.pow(t1, t2) + t1} !!`; +`${t1 + Math.pow(t2, t2) + t1} hello world ${t1 + Math.pow(t2, t2) + t1} !!`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))} hello world ${typeof (Math.pow(t1, Math.pow(t2, t1)))} !!`; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.symbols b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.symbols new file mode 100644 index 0000000000000..a6062348432a1 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.symbols @@ -0,0 +1,143 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 3, 3)) + +// With TemplateTail +`${t1 ** t2} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) + +`${t1 ** t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 + t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 ** t2 + t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1 } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${1 + typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 ** t2}${t1 ** t2} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTemplateString3ES6.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types new file mode 100644 index 0000000000000..e0d59cc1319ab --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types @@ -0,0 +1,240 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTemplateString3ES6.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// With TemplateTail +`${t1 ** t2} world`; +>`${t1 ** t2} world` : string +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1} world`; +>`${t1 ** t2 ** t1} world` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1} world`; +>`${t1 + t2 ** t1} world` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1} world`; +>`${t1 ** t2 + t1} world` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1 } world`; +>`${t1 + t2 ** t2 + t1 } world` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } world`; +>`${typeof (t1 ** t2 ** t1) } world` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${1 + typeof (t1 ** t2 ** t1) } world`; +>`${1 + typeof (t1 ** t2 ** t1) } world` : string +>1 + typeof (t1 ** t2 ** t1) : string +>1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2}${t1 ** t2} world`; +>`${t1 ** t2}${t1 ** t2} world` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1}${t1 + t2 ** t1} world`; +>`${t1 + t2 ** t1}${t1 + t2 ** t1} world` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1}${t1 ** t2 + t1} world`; +>`${t1 ** t2 + t1}${t1 ** t2 + t1} world` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; +>`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2} hello world ${t1 ** t2} !!`; +>`${t1 ** t2} hello world ${t1 ** t2} !!` : string +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 ** t2 : number +>t1 : number +>t2 : number + +`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!` : string +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!` : string +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>t1 + t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!` : string +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** t2 + t1 : number +>t1 ** t2 : number +>t1 : number +>t2 : number +>t1 : number + +`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!` : string +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number +>t1 + t2 ** t2 + t1 : number +>t1 + t2 ** t2 : number +>t1 : number +>t2 ** t2 : number +>t2 : number +>t2 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + From d0aaf412520e713654fcbc26cfd376a11ffd1995 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:06:17 -0700 Subject: [PATCH 23/39] Add baselines when having early syntax error in exponentiation --- ...nTemplateStringWithSyntaxError1.errors.txt | 165 ++++++++++ ...peratorInTemplateStringWithSyntaxError1.js | 53 ++++ ...nTemplateStringWithSyntaxError2.errors.txt | 166 ++++++++++ ...peratorInTemplateStringWithSyntaxError2.js | 54 ++++ ...nTemplateStringWithSyntaxError3.errors.txt | 165 ++++++++++ ...peratorInTemplateStringWithSyntaxError3.js | 53 ++++ ...onentiationOperatorSyntaxError1.errors.txt | 135 ++++++++ .../exponentiationOperatorSyntaxError1.js | 74 +++++ ...onentiationOperatorSyntaxError2.errors.txt | 294 ++++++++++++++++++ .../exponentiationOperatorSyntaxError2.js | 116 +++++++ 10 files changed, 1275 insertions(+) create mode 100644 tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js create mode 100644 tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js create mode 100644 tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js create mode 100644 tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorSyntaxError1.js create mode 100644 tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorSyntaxError2.js diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt new file mode 100644 index 0000000000000..dee60064e8510 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt @@ -0,0 +1,165 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(9,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(10,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(11,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,25): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,25): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,28): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,36): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,46): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,38): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,41): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,51): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,59): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts (45 errors) ==== + + var t1 = 10; + var t2 = 10; + var s; + + // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () + // TempateHead & TemplateTail are empty + `${1 + typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-++t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1++ ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${!t1 ** t2 ** --t1 }`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + `${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js new file mode 100644 index 0000000000000..cf97360b23aa5 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js @@ -0,0 +1,53 @@ +//// [exponentiationOperatorInTemplateStringWithSyntaxError1.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// TempateHead & TemplateTail are empty +`${1 + typeof t1 ** t2 ** t1}`; +`${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}`; + +`${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; + +//// [exponentiationOperatorInTemplateStringWithSyntaxError1.js] +var t1 = 10; +var t2 = 10; +var s; +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// TempateHead & TemplateTail are empty +"" + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"" + (Math.pow(-t1, t2) - t1); +"" + (Math.pow(-++t1, t2) - t1); +"" + (Math.pow(-t1++, t2) - t1); +"" + (Math.pow(!t1, Math.pow(t2, --t1))); +"" + (Math.pow(typeof t1, Math.pow(t2, t1))); +"" + (Math.pow(-t1, t2) - t1) + (Math.pow(-t1, t2) - t1); +"" + (Math.pow(-++t1, t2) - t1) + (Math.pow(-++t1, t2) - t1); +"" + (Math.pow(-t1++, t2) - t1) + (Math.pow(-t1++, t2) - t1); +"" + (Math.pow(!t1, Math.pow(t2, --t1))) + (Math.pow(!t1, Math.pow(t2, --t1))); +"" + (Math.pow(typeof t1, Math.pow(t2, t1))) + (Math.pow(typeof t1, Math.pow(t2, t1))); +"" + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); +(Math.pow(-t1, t2) - t1) + " hello world " + (Math.pow(-t1, t2) - t1); +(Math.pow(-++t1, t2) - t1) + " hello world " + (Math.pow(-++t1, t2) - t1); +(Math.pow(-t1++, t2) - t1) + " hello world " + (Math.pow(-t1++, t2) - t1); +(Math.pow(!t1, Math.pow(t2, --t1))) + " hello world " + (Math.pow(!t1, Math.pow(t2, --t1))); +(Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (Math.pow(typeof t1, Math.pow(t2, t1))); +(1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt new file mode 100644 index 0000000000000..b73c8b4493275 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt @@ -0,0 +1,166 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(8,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(9,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(10,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,24): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,31): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,35): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,35): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,31): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,35): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,34): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,44): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,24): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,42): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,52): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,44): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,48): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,48): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,44): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,48): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,47): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,57): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,24): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,55): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,65): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts (45 errors) ==== + + var t1 = 10; + var t2 = 10; + var s; + + // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () + // With templateHead + `hello ${-t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${-++t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${-t1++ ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${!t1 ** t2 ** --t1 }`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${1 + typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + `hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + `hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js new file mode 100644 index 0000000000000..486c07f8af677 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js @@ -0,0 +1,54 @@ +//// [exponentiationOperatorInTemplateStringWithSyntaxError2.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// With templateHead +`hello ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof t1 ** t2 ** t1}`; + +`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; + +`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; +`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; +`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; +`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; +`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; +`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; + + +//// [exponentiationOperatorInTemplateStringWithSyntaxError2.js] +var t1 = 10; +var t2 = 10; +var s; +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// With templateHead +"hello " + (Math.pow(-t1, t2) - t1); +"hello " + (Math.pow(-++t1, t2) - t1); +"hello " + (Math.pow(-t1++, t2) - t1); +"hello " + (Math.pow(!t1, Math.pow(t2, --t1))); +"hello " + (Math.pow(typeof t1, Math.pow(t2, t1))); +"hello " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"hello " + (Math.pow(-t1, t2) - t1) + (Math.pow(-t1, t2) - t1); +"hello " + (Math.pow(-++t1, t2) - t1) + (Math.pow(-++t1, t2) - t1); +"hello " + (Math.pow(-t1++, t2) - t1) + (Math.pow(-t1++, t2) - t1); +"hello " + (Math.pow(!t1, Math.pow(t2, --t1))) + (Math.pow(!t1, Math.pow(t2, --t1))); +"hello " + (Math.pow(typeof t1, Math.pow(t2, t1))) + (Math.pow(typeof t1, Math.pow(t2, t1))); +"hello " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"hello " + (Math.pow(-t1, t2) - t1) + " hello world " + (Math.pow(-t1, t2) - t1); +"hello " + (Math.pow(-++t1, t2) - t1) + " hello world " + (Math.pow(-++t1, t2) - t1); +"hello " + (Math.pow(-t1++, t2) - t1) + " hello world " + (Math.pow(-t1++, t2) - t1); +"hello " + (Math.pow(!t1, Math.pow(t2, --t1))) + " hello world " + (Math.pow(!t1, Math.pow(t2, --t1))); +"hello " + (Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (Math.pow(typeof t1, Math.pow(t2, t1))); +"hello " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt new file mode 100644 index 0000000000000..9fdf5712851d8 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt @@ -0,0 +1,165 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(8,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(9,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(10,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,25): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,25): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,28): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,36): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,46): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,38): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,41): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,51): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,59): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts (45 errors) ==== + + var t1 = 10; + var t2 = 10; + var s; + + // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () + // With TemplateTail + `${-t1 ** t2 - t1} world`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-++t1 ** t2 - t1} world`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1++ ** t2 - t1} world`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${!t1 ** t2 ** --t1 } world`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${typeof t1 ** t2 ** t1} world`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${1 + typeof t1 ** t2 ** t1} world`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + `${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js new file mode 100644 index 0000000000000..1641c2bbb8080 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js @@ -0,0 +1,53 @@ +//// [exponentiationOperatorInTemplateStringWithSyntaxError3.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// With TemplateTail +`${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1} world`; +`${1 + typeof t1 ** t2 ** t1} world`; + +`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; +`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; +`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; +`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; +`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; +`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; + +`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; +`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; +`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; +`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; +`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; +`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; + +//// [exponentiationOperatorInTemplateStringWithSyntaxError3.js] +var t1 = 10; +var t2 = 10; +var s; +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +// With TemplateTail +(Math.pow(-t1, t2) - t1) + " world"; +(Math.pow(-++t1, t2) - t1) + " world"; +(Math.pow(-t1++, t2) - t1) + " world"; +(Math.pow(!t1, Math.pow(t2, --t1))) + " world"; +(Math.pow(typeof t1, Math.pow(t2, t1))) + " world"; +(1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " world"; +"" + (Math.pow(-t1, t2) - t1) + (Math.pow(-t1, t2) - t1) + " world"; +"" + (Math.pow(-++t1, t2) - t1) + (Math.pow(-++t1, t2) - t1) + " world"; +"" + (Math.pow(-t1++, t2) - t1) + (Math.pow(-t1++, t2) - t1) + " world"; +"" + (Math.pow(!t1, Math.pow(t2, --t1))) + (Math.pow(!t1, Math.pow(t2, --t1))) + " world"; +"" + (Math.pow(typeof t1, Math.pow(t2, t1))) + (Math.pow(typeof t1, Math.pow(t2, t1))) + " world"; +"" + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " world"; +(Math.pow(-t1, t2) - t1) + " hello world " + (Math.pow(-t1, t2) - t1) + " !!"; +(Math.pow(-++t1, t2) - t1) + " hello world " + (Math.pow(-++t1, t2) - t1) + " !!"; +(Math.pow(-t1++, t2) - t1) + " hello world " + (Math.pow(-t1++, t2) - t1) + " !!"; +(Math.pow(!t1, Math.pow(t2, --t1))) + " hello world " + (Math.pow(!t1, Math.pow(t2, --t1))) + " !!"; +(Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (Math.pow(typeof t1, Math.pow(t2, t1))) + " !!"; +(1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " !!"; diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt new file mode 100644 index 0000000000000..774f733748d10 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt @@ -0,0 +1,135 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(3,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(4,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(5,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(6,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(8,11): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(12,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(13,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(14,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(15,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(16,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(17,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(18,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(19,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(21,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(22,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(23,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(24,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(25,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(26,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(27,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(28,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(29,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(30,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(31,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(32,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(33,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(34,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(35,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(36,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts (31 errors) ==== + + // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () + -1 ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +1 ** 2 + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** -2 ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** -2 ** -3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -1 ** -2 ** -3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -(1 ** 2) ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + var temp = 10; + + -++temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +--temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -temp++ ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** -++temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** +--temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** -temp++ ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** +temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + -3 ** temp++; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** temp--; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** ++temp; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** --temp; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** temp++; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** temp--; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** ++temp; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** --temp; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** temp++ ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** temp-- ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** ++temp ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + -3 ** --temp ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** temp++ ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** temp-- ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** ++temp ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + +3 ** --temp ** 2; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + + \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError1.js b/tests/baselines/reference/exponentiationOperatorSyntaxError1.js new file mode 100644 index 0000000000000..059941516102a --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError1.js @@ -0,0 +1,74 @@ +//// [exponentiationOperatorSyntaxError1.ts] + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +-1 ** 2; ++1 ** 2 +1 ** -2 ** 3; +1 ** -2 ** -3; +-1 ** -2 ** -3; +-(1 ** 2) ** 3; + +var temp = 10; + +-++temp ** 3; ++--temp ** 3; +-temp++ ** 3; ++temp-- ** 3; +1 ** -++temp ** 3; +1 ** +--temp ** 3; +1 ** -temp++ ** 3; +1 ** +temp-- ** 3; + +-3 ** temp++; +-3 ** temp--; +-3 ** ++temp; +-3 ** --temp; ++3 ** temp++; ++3 ** temp--; ++3 ** ++temp; ++3 ** --temp; +-3 ** temp++ ** 2; +-3 ** temp-- ** 2; +-3 ** ++temp ** 2; +-3 ** --temp ** 2; ++3 ** temp++ ** 2; ++3 ** temp-- ** 2; ++3 ** ++temp ** 2; ++3 ** --temp ** 2; + + + + +//// [exponentiationOperatorSyntaxError1.js] +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +Math.pow(-1, 2); +Math.pow(+1, 2); +Math.pow(1, Math.pow(-2, 3)); +Math.pow(1, Math.pow(-2, -3)); +Math.pow(-1, Math.pow(-2, -3)); +Math.pow(-(Math.pow(1, 2)), 3); +var temp = 10; +Math.pow(-++temp, 3); +Math.pow(+--temp, 3); +Math.pow(-temp++, 3); +Math.pow(+temp--, 3); +Math.pow(1, Math.pow(-++temp, 3)); +Math.pow(1, Math.pow(+--temp, 3)); +Math.pow(1, Math.pow(-temp++, 3)); +Math.pow(1, Math.pow(+temp--, 3)); +Math.pow(-3, temp++); +Math.pow(-3, temp--); +Math.pow(-3, ++temp); +Math.pow(-3, --temp); +Math.pow(+3, temp++); +Math.pow(+3, temp--); +Math.pow(+3, ++temp); +Math.pow(+3, --temp); +Math.pow(-3, Math.pow(temp++, 2)); +Math.pow(-3, Math.pow(temp--, 2)); +Math.pow(-3, Math.pow(++temp, 2)); +Math.pow(-3, Math.pow(--temp, 2)); +Math.pow(+3, Math.pow(temp++, 2)); +Math.pow(+3, Math.pow(temp--, 2)); +Math.pow(+3, Math.pow(++temp, 2)); +Math.pow(+3, Math.pow(--temp, 2)); diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt new file mode 100644 index 0000000000000..67ff666729285 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt @@ -0,0 +1,294 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(28,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(29,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(30,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(31,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(32,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(34,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(35,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(36,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(37,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(38,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(40,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(41,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(42,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(43,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(44,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(46,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(47,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(48,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(49,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(50,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts (76 errors) ==== + + // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () + var temp; + + delete --temp ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + delete ++temp ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + delete temp-- ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + delete temp++ ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + + 1 ** delete --temp ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** delete ++temp ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** delete temp-- ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** delete temp++ ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + typeof --temp ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + typeof temp-- ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + typeof 3 ** 4; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + typeof temp++ ** 4; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + typeof temp-- ** 4; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + 1 ** typeof --temp ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** typeof temp-- ** 3; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** typeof 3 ** 4; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** typeof temp++ ** 4; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** typeof temp-- ** 4; + ~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + void --temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + void temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + void 3 ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + void temp++ ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + void temp-- ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + 1 ** void --temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** void temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** void 3 ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** void temp++ ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** void temp-- ** 4 ; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + ~ --temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~3 ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~temp++ ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~temp-- ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + 1 ** ~ --temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** ~temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** ~3 ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** ~temp++ ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** ~temp-- ** 4; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + ! --temp ** 3; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + !temp-- ** 3; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + !3 ** 4; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + !temp++ ** 4; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + !temp-- ** 4; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + + 1 ** ! --temp ** 3; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** !temp-- ** 3; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** !3 ** 4; + ~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** !temp++ ** 4; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + 1 ** !temp-- ** 4; + ~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.js b/tests/baselines/reference/exponentiationOperatorSyntaxError2.js new file mode 100644 index 0000000000000..758160ec31240 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.js @@ -0,0 +1,116 @@ +//// [exponentiationOperatorSyntaxError2.ts] + +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +var temp; + +delete --temp ** 3; +delete ++temp ** 3; +delete temp-- ** 3; +delete temp++ ** 3; + + +1 ** delete --temp ** 3; +1 ** delete ++temp ** 3; +1 ** delete temp-- ** 3; +1 ** delete temp++ ** 3; + +typeof --temp ** 3; +typeof temp-- ** 3; +typeof 3 ** 4; +typeof temp++ ** 4; +typeof temp-- ** 4; + +1 ** typeof --temp ** 3; +1 ** typeof temp-- ** 3; +1 ** typeof 3 ** 4; +1 ** typeof temp++ ** 4; +1 ** typeof temp-- ** 4; + +void --temp ** 3; +void temp-- ** 3; +void 3 ** 4; +void temp++ ** 4; +void temp-- ** 4; + +1 ** void --temp ** 3; +1 ** void temp-- ** 3; +1 ** void 3 ** 4; +1 ** void temp++ ** 4; +1 ** void temp-- ** 4 ; + +~ --temp ** 3; +~temp-- ** 3; +~3 ** 4; +~temp++ ** 4; +~temp-- ** 4; + +1 ** ~ --temp ** 3; +1 ** ~temp-- ** 3; +1 ** ~3 ** 4; +1 ** ~temp++ ** 4; +1 ** ~temp-- ** 4; + +! --temp ** 3; +!temp-- ** 3; +!3 ** 4; +!temp++ ** 4; +!temp-- ** 4; + +1 ** ! --temp ** 3; +1 ** !temp-- ** 3; +1 ** !3 ** 4; +1 ** !temp++ ** 4; +1 ** !temp-- ** 4; + + +//// [exponentiationOperatorSyntaxError2.js] +// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () +var temp; +Math.pow(delete --temp, 3); +Math.pow(delete ++temp, 3); +Math.pow(delete temp--, 3); +Math.pow(delete temp++, 3); +Math.pow(1, Math.pow(delete --temp, 3)); +Math.pow(1, Math.pow(delete ++temp, 3)); +Math.pow(1, Math.pow(delete temp--, 3)); +Math.pow(1, Math.pow(delete temp++, 3)); +Math.pow(typeof --temp, 3); +Math.pow(typeof temp--, 3); +Math.pow(typeof 3, 4); +Math.pow(typeof temp++, 4); +Math.pow(typeof temp--, 4); +Math.pow(1, Math.pow(typeof --temp, 3)); +Math.pow(1, Math.pow(typeof temp--, 3)); +Math.pow(1, Math.pow(typeof 3, 4)); +Math.pow(1, Math.pow(typeof temp++, 4)); +Math.pow(1, Math.pow(typeof temp--, 4)); +Math.pow(void --temp, 3); +Math.pow(void temp--, 3); +Math.pow(void 3, 4); +Math.pow(void temp++, 4); +Math.pow(void temp--, 4); +Math.pow(1, Math.pow(void --temp, 3)); +Math.pow(1, Math.pow(void temp--, 3)); +Math.pow(1, Math.pow(void 3, 4)); +Math.pow(1, Math.pow(void temp++, 4)); +Math.pow(1, Math.pow(void temp--, 4)); +Math.pow(~--temp, 3); +Math.pow(~temp--, 3); +Math.pow(~3, 4); +Math.pow(~temp++, 4); +Math.pow(~temp--, 4); +Math.pow(1, Math.pow(~--temp, 3)); +Math.pow(1, Math.pow(~temp--, 3)); +Math.pow(1, Math.pow(~3, 4)); +Math.pow(1, Math.pow(~temp++, 4)); +Math.pow(1, Math.pow(~temp--, 4)); +Math.pow(!--temp, 3); +Math.pow(!temp--, 3); +Math.pow(!3, 4); +Math.pow(!temp++, 4); +Math.pow(!temp--, 4); +Math.pow(1, Math.pow(!--temp, 3)); +Math.pow(1, Math.pow(!temp--, 3)); +Math.pow(1, Math.pow(!3, 4)); +Math.pow(1, Math.pow(!temp++, 4)); +Math.pow(1, Math.pow(!temp--, 4)); From bd7cc1e7ef5b86b730ae712056a3c15cdd6a11f7 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:06:48 -0700 Subject: [PATCH 24/39] Invalid usage of exponentiation --- ...idSimpleUnaryExpressionOperands.errors.txt | 123 ++++++++++++++++++ ...ithInvalidSimpleUnaryExpressionOperands.js | 69 ++++++++++ ...eratorWithTemplateStringInvalid.errors.txt | 57 ++++++++ ...iationOperatorWithTemplateStringInvalid.js | 34 +++++ ...torWithTemplateStringInvalidES6.errors.txt | 57 ++++++++ ...ionOperatorWithTemplateStringInvalidES6.js | 31 +++++ 6 files changed, 371 insertions(+) create mode 100644 tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js create mode 100644 tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.js diff --git a/tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.errors.txt b/tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.errors.txt new file mode 100644 index 0000000000000..f43cbd0042a04 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.errors.txt @@ -0,0 +1,123 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(4,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(10,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(11,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(12,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(13,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(14,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(16,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(17,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(19,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(20,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(22,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(23,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(24,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(25,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(26,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(28,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(29,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(31,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(33,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(34,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(35,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts(36,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts (28 errors) ==== + var temp: any; + + // Error: incorrect type on left-hand side + (! --temp) ** 3; + ~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!temp--) ** 3; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!3) ** 4; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!temp++) ** 4; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!temp--) ** 4; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + (! --temp) ** 3 ** 1; + ~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!temp--) ** 3 ** 1; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!3) ** 4 ** 1; + ~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!temp++) ** 4 ** 1; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (!temp--) ** 4 ** 1; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + (typeof --temp) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (typeof temp--) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (typeof 3) ** 4; + ~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (typeof temp++) ** 4; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (typeof temp--) ** 4; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + 1 ** (typeof --temp) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (typeof temp--) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (typeof 3) ** 4; + ~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (typeof temp++) ** 4; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (typeof temp--) ** 4; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + (delete --temp) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (delete ++temp) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (delete temp--) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (delete temp++) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + 1 ** (delete --temp) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (delete ++temp) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (delete temp--) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + 1 ** (delete temp++) ** 3; + ~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.js b/tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.js new file mode 100644 index 0000000000000..8977ea10eed06 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.js @@ -0,0 +1,69 @@ +//// [exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts] +var temp: any; + +// Error: incorrect type on left-hand side +(! --temp) ** 3; +(!temp--) ** 3; +(!3) ** 4; +(!temp++) ** 4; +(!temp--) ** 4; + +(! --temp) ** 3 ** 1; +(!temp--) ** 3 ** 1; +(!3) ** 4 ** 1; +(!temp++) ** 4 ** 1; +(!temp--) ** 4 ** 1; + +(typeof --temp) ** 3; +(typeof temp--) ** 3; +(typeof 3) ** 4; +(typeof temp++) ** 4; +(typeof temp--) ** 4; + +1 ** (typeof --temp) ** 3; +1 ** (typeof temp--) ** 3; +1 ** (typeof 3) ** 4; +1 ** (typeof temp++) ** 4; +1 ** (typeof temp--) ** 4; + +(delete --temp) ** 3; +(delete ++temp) ** 3; +(delete temp--) ** 3; +(delete temp++) ** 3; + +1 ** (delete --temp) ** 3; +1 ** (delete ++temp) ** 3; +1 ** (delete temp--) ** 3; +1 ** (delete temp++) ** 3; + +//// [exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.js] +var temp; +// Error: incorrect type on left-hand side +Math.pow((!--temp), 3); +Math.pow((!temp--), 3); +Math.pow((!3), 4); +Math.pow((!temp++), 4); +Math.pow((!temp--), 4); +Math.pow((!--temp), Math.pow(3, 1)); +Math.pow((!temp--), Math.pow(3, 1)); +Math.pow((!3), Math.pow(4, 1)); +Math.pow((!temp++), Math.pow(4, 1)); +Math.pow((!temp--), Math.pow(4, 1)); +Math.pow((typeof --temp), 3); +Math.pow((typeof temp--), 3); +Math.pow((typeof 3), 4); +Math.pow((typeof temp++), 4); +Math.pow((typeof temp--), 4); +Math.pow(1, Math.pow((typeof --temp), 3)); +Math.pow(1, Math.pow((typeof temp--), 3)); +Math.pow(1, Math.pow((typeof 3), 4)); +Math.pow(1, Math.pow((typeof temp++), 4)); +Math.pow(1, Math.pow((typeof temp--), 4)); +Math.pow((delete --temp), 3); +Math.pow((delete ++temp), 3); +Math.pow((delete temp--), 3); +Math.pow((delete temp++), 3); +Math.pow(1, Math.pow((delete --temp), 3)); +Math.pow(1, Math.pow((delete ++temp), 3)); +Math.pow(1, Math.pow((delete temp--), 3)); +Math.pow(1, Math.pow((delete temp++), 3)); diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.errors.txt b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.errors.txt new file mode 100644 index 0000000000000..53379f29933c1 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(2,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(3,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(4,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(5,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(6,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(8,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(9,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(12,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(13,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(14,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts(15,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalid.ts (12 errors) ==== + + var a = 1 ** `${ 3 }`; + ~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var b = 1 ** `2${ 3 }`; + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var c = 1 ** `${ 3 }4`; + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var d = 1 ** `2${ 3 }4`; + ~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var e = `${ 3 }` ** 5; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var f = `2${ 3 }` ** 5; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var g = `${ 3 }4` ** 5; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var h = `2${ 3 }4` ** 5; + ~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var k = 10; + k **= `${ 3 }`; + ~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + k **= `2${ 3 }`; + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + k **= `2${ 3 }4`; + ~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + k **= `2${ 3 }4`; + ~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + + \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js new file mode 100644 index 0000000000000..5bd9a9609a059 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js @@ -0,0 +1,34 @@ +//// [exponentiationOperatorWithTemplateStringInvalid.ts] + +var a = 1 ** `${ 3 }`; +var b = 1 ** `2${ 3 }`; +var c = 1 ** `${ 3 }4`; +var d = 1 ** `2${ 3 }4`; +var e = `${ 3 }` ** 5; +var f = `2${ 3 }` ** 5; +var g = `${ 3 }4` ** 5; +var h = `2${ 3 }4` ** 5; + +var k = 10; +k **= `${ 3 }`; +k **= `2${ 3 }`; +k **= `2${ 3 }4`; +k **= `2${ 3 }4`; + + + + +//// [exponentiationOperatorWithTemplateStringInvalid.js] +var a = Math.pow(1, "" + 3); +var b = Math.pow(1, "2" + 3); +var c = Math.pow(1, 3 + "4"); +var d = Math.pow(1, "2" + 3 + "4"); +var e = Math.pow("" + 3, 5); +var f = Math.pow("2" + 3, 5); +var g = Math.pow(3 + "4", 5); +var h = Math.pow("2" + 3 + "4", 5); +var k = 10; +k = Math.pow(k, "" + 3); +k = Math.pow(k, "2" + 3); +k = Math.pow(k, "2" + 3 + "4"); +k = Math.pow(k, "2" + 3 + "4"); diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.errors.txt b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.errors.txt new file mode 100644 index 0000000000000..39ade9df20531 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(2,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(3,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(4,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(5,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(6,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(8,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(9,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(12,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(13,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(14,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(15,1): error TS2304: Cannot find name 'kj'. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts(15,8): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithTemplateStringInvalidES6.ts (13 errors) ==== + + var a = 1 ** `${ 3 }`; + ~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var b = 1 ** `2${ 3 }`; + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var c = 1 ** `${ 3 }4`; + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var d = 1 ** `2${ 3 }4`; + ~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var e = `${ 3 }` ** 5; + ~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var f = `2${ 3 }` ** 5; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var g = `${ 3 }4` ** 5; + ~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var h = `2${ 3 }4` ** 5; + ~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var k = 10; + k **= `${ 3 }`; + ~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + k **= `2${ 3 }`; + ~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + k **= `2${ 3 }4`; + ~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + kj **= `2${ 3 }4`; + ~~ +!!! error TS2304: Cannot find name 'kj'. + ~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.js b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.js new file mode 100644 index 0000000000000..cde5133039f0f --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.js @@ -0,0 +1,31 @@ +//// [exponentiationOperatorWithTemplateStringInvalidES6.ts] + +var a = 1 ** `${ 3 }`; +var b = 1 ** `2${ 3 }`; +var c = 1 ** `${ 3 }4`; +var d = 1 ** `2${ 3 }4`; +var e = `${ 3 }` ** 5; +var f = `2${ 3 }` ** 5; +var g = `${ 3 }4` ** 5; +var h = `2${ 3 }4` ** 5; + +var k = 10; +k **= `${ 3 }`; +k **= `2${ 3 }`; +k **= `2${ 3 }4`; +kj **= `2${ 3 }4`; + +//// [exponentiationOperatorWithTemplateStringInvalidES6.js] +var a = Math.pow(1, `${3}`); +var b = Math.pow(1, `2${3}`); +var c = Math.pow(1, `${3}4`); +var d = Math.pow(1, `2${3}4`); +var e = Math.pow(`${3}`, 5); +var f = Math.pow(`2${3}`, 5); +var g = Math.pow(`${3}4`, 5); +var h = Math.pow(`2${3}4`, 5); +var k = 10; +k = Math.pow(k, `${3}`); +k = Math.pow(k, `2${3}`); +k = Math.pow(k, `2${3}4`); +kj = Math.pow(kj, `2${3}4`); From fbe559eef02748babc1914179158e12ed274aa35 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:07:02 -0700 Subject: [PATCH 25/39] Address PR and add new with exponentiation --- .../exponentiationOperatorWithNew.errors.txt | 12 ++++++++++++ .../reference/exponentiationOperatorWithNew.js | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/baselines/reference/exponentiationOperatorWithNew.errors.txt create mode 100644 tests/baselines/reference/exponentiationOperatorWithNew.js diff --git a/tests/baselines/reference/exponentiationOperatorWithNew.errors.txt b/tests/baselines/reference/exponentiationOperatorWithNew.errors.txt new file mode 100644 index 0000000000000..ae694a321b48e --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNew.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts(6,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts (1 errors) ==== + var a: any; + var b: any; + var c: any; + new a ** b ** c; + new a ** new b ** c; + new (a ** b ** c); + ~~~~~~~~~~~~~~~~~ +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorWithNew.js b/tests/baselines/reference/exponentiationOperatorWithNew.js new file mode 100644 index 0000000000000..6fb7e62c450c8 --- /dev/null +++ b/tests/baselines/reference/exponentiationOperatorWithNew.js @@ -0,0 +1,15 @@ +//// [exponentiationOperatorWithNew.ts] +var a: any; +var b: any; +var c: any; +new a ** b ** c; +new a ** new b ** c; +new (a ** b ** c); + +//// [exponentiationOperatorWithNew.js] +var a; +var b; +var c; +Math.pow(new a, Math.pow(b, c)); +Math.pow(new a, Math.pow(new b, c)); +new (Math.pow(a, Math.pow(b, c))); From 788f22205946a07e87e9ae24cd6d4ff89f7d6917 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:07:49 -0700 Subject: [PATCH 26/39] parenthesized exponentiation with template string --- ...onentiationOperatorInTempalteString4ES6.js | 53 ++++ ...iationOperatorInTempalteString4ES6.symbols | 114 +++++++++ ...ntiationOperatorInTempalteString4ES6.types | 233 ++++++++++++++++++ 3 files changed, 400 insertions(+) create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.js create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.symbols create mode 100644 tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.js b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.js new file mode 100644 index 0000000000000..bda3f8be251a9 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.js @@ -0,0 +1,53 @@ +//// [emitExponentiationOperatorInTempalteString4ES6.ts] + +var t1 = 10; +var t2 = 10; +var s; + +// With TemplateTail +`${t1 ** -t2} world`; +`${(-t1) ** t2 - t1} world`; +`${(-++t1) ** t2 - t1} world`; +`${(-t1++) ** t2 - t1} world`; +`${(~t1) ** t2 ** --t1 } world`; +`${typeof (t1 ** t2 ** t1) } world`; + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +`hello ${(-++t1) ** t2 - t1}`; +`hello ${(-t1++) ** t2 - t1}`; +`hello ${(~t1) ** t2 ** --t1 }`; +`hello ${typeof (t1 ** t2 ** t1)}`; + +//// [emitExponentiationOperatorInTempalteString4ES6.js] +var t1 = 10; +var t2 = 10; +var s; +// With TemplateTail +`${Math.pow(t1, -t2)} world`; +`${Math.pow((-t1), t2) - t1} world`; +`${Math.pow((-++t1), t2) - t1} world`; +`${Math.pow((-t1++), t2) - t1} world`; +`${Math.pow((~t1), Math.pow(t2, --t1))} world`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))} world`; +// TempateHead & TemplateTail are empt +`${Math.pow(t1, -t2)} hello world ${Math.pow(t1, -t2)}`; +`${Math.pow((-t1), t2) - t1} hello world ${Math.pow((-t1), t2) - t1}`; +`${Math.pow((-++t1), t2) - t1} hello world ${Math.pow(t1, Math.pow((-++t1), -t1))}`; +`${Math.pow((-t1++), t2) - t1} hello world ${Math.pow(t2, Math.pow((-t1++), -t1))}`; +`${Math.pow((~t1), Math.pow(t2, --t1))} hello world ${Math.pow((~t1), Math.pow(t2, --t1))}`; +`${typeof (Math.pow(t1, Math.pow(t2, t1)))} hello world ${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; +// With templateHead +`hello ${Math.pow((-t1), t2) - t1}`; +`hello ${Math.pow((-++t1), t2) - t1}`; +`hello ${Math.pow((-t1++), t2) - t1}`; +`hello ${Math.pow((~t1), Math.pow(t2, --t1))}`; +`hello ${typeof (Math.pow(t1, Math.pow(t2, t1)))}`; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.symbols b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.symbols new file mode 100644 index 0000000000000..1f4cd74502ba0 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4ES6.ts === + +var t1 = 10; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +var t2 = 10; +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) + +var s; +>s : Symbol(s, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 3, 3)) + +// With TemplateTail +`${t1 ** -t2} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) + +`${(-t1) ** t2 - t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${(-++t1) ** t2 - t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${(-t1++) ** t2 - t1} world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${(~t1) ** t2 ** --t1 } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1) } world`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) + +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`hello ${(-++t1) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`hello ${(-t1++) ** t2 - t1}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`hello ${(~t1) ** t2 ** --t1 }`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + +`hello ${typeof (t1 ** t2 ** t1)}`; +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) +>t2 : Symbol(t2, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 2, 3)) +>t1 : Symbol(t1, Decl(emitExponentiationOperatorInTempalteString4ES6.ts, 1, 3)) + diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types new file mode 100644 index 0000000000000..ed2f4b522e965 --- /dev/null +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types @@ -0,0 +1,233 @@ +=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperatorInTempalteString4ES6.ts === + +var t1 = 10; +>t1 : number +>10 : number + +var t2 = 10; +>t2 : number +>10 : number + +var s; +>s : any + +// With TemplateTail +`${t1 ** -t2} world`; +>`${t1 ** -t2} world` : string +>t1 ** -t2 : number +>t1 : number +>-t2 : number +>t2 : number + +`${(-t1) ** t2 - t1} world`; +>`${(-t1) ** t2 - t1} world` : string +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number + +`${(-++t1) ** t2 - t1} world`; +>`${(-++t1) ** t2 - t1} world` : string +>(-++t1) ** t2 - t1 : number +>(-++t1) ** t2 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number + +`${(-t1++) ** t2 - t1} world`; +>`${(-t1++) ** t2 - t1} world` : string +>(-t1++) ** t2 - t1 : number +>(-t1++) ** t2 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number + +`${(~t1) ** t2 ** --t1 } world`; +>`${(~t1) ** t2 ** --t1 } world` : string +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1) } world`; +>`${typeof (t1 ** t2 ** t1) } world` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +// TempateHead & TemplateTail are empt +`${t1 ** -t2} hello world ${t1 ** -t2}`; +>`${t1 ** -t2} hello world ${t1 ** -t2}` : string +>t1 ** -t2 : number +>t1 : number +>-t2 : number +>t2 : number +>t1 ** -t2 : number +>t1 : number +>-t2 : number +>t2 : number + +`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; +>`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}` : string +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number + +`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; +>`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}` : string +>(-++t1) ** t2 - t1 : number +>(-++t1) ** t2 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number +>t1 ** (-++t1) **- t1 : number +>t1 : number +>(-++t1) **- t1 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>- t1 : number +>t1 : number + +`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; +>`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}` : string +>(-t1++) ** t2 - t1 : number +>(-t1++) ** t2 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number +>t2 ** (-t1++) ** - t1 : number +>t2 : number +>(-t1++) ** - t1 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>- t1 : number +>t1 : number + +`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; +>`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }` : string +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; +>`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + +// With templateHead +`hello ${(-t1) ** t2 - t1}`; +>`hello ${(-t1) ** t2 - t1}` : string +>(-t1) ** t2 - t1 : number +>(-t1) ** t2 : number +>(-t1) : number +>-t1 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${(-++t1) ** t2 - t1}`; +>`hello ${(-++t1) ** t2 - t1}` : string +>(-++t1) ** t2 - t1 : number +>(-++t1) ** t2 : number +>(-++t1) : number +>-++t1 : number +>++t1 : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${(-t1++) ** t2 - t1}`; +>`hello ${(-t1++) ** t2 - t1}` : string +>(-t1++) ** t2 - t1 : number +>(-t1++) ** t2 : number +>(-t1++) : number +>-t1++ : number +>t1++ : number +>t1 : number +>t2 : number +>t1 : number + +`hello ${(~t1) ** t2 ** --t1 }`; +>`hello ${(~t1) ** t2 ** --t1 }` : string +>(~t1) ** t2 ** --t1 : number +>(~t1) : number +>~t1 : number +>t1 : number +>t2 ** --t1 : number +>t2 : number +>--t1 : number +>t1 : number + +`hello ${typeof (t1 ** t2 ** t1)}`; +>`hello ${typeof (t1 ** t2 ** t1)}` : string +>typeof (t1 ** t2 ** t1) : string +>(t1 ** t2 ** t1) : number +>t1 ** t2 ** t1 : number +>t1 : number +>t2 ** t1 : number +>t2 : number +>t1 : number + From bfaa51b4e9bcc28ac9c3f8d1df735bfe2507db2b Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 6 Oct 2015 14:09:47 -0700 Subject: [PATCH 27/39] Add comment and address PR on comment --- src/compiler/emitter.ts | 13 +++++++- src/compiler/parser.ts | 69 +++++++++++++++++++++-------------------- src/compiler/types.ts | 13 ++++---- 3 files changed, 53 insertions(+), 42 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6a09006d3e3a1..115979bd30b73 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2515,7 +2515,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi let leftHandSideExpression = node.left; if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { let synthesizedLHS: ElementAccessExpression | PropertyAccessExpression; - // TODO (yuisu) : comment + + // This is used to decide whether to emit parenthesis around the expresison. + // Parenthesis is required for following cases: + // capture variable while emitting right-hand side operand. + // a[0] **= a[0] **= 2 + // _a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2))); + // ^ -> required extra parenthesis controlled by shouldEmitParenthesis + // exponentiation compount in variable declaration + // var x = a[0] **= a[0] **= 2 + // var x = (_a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2)))); + // ^ -> required extra parenthesis controlled by shouldEmitParenthesis + // Otherwise, false let shouldEmitParenthesis = false; if (isElementAccessExpression(leftHandSideExpression)) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 6141e3ba047b1..af46229d57f5e 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3015,8 +3015,8 @@ namespace ts { let newPrecedence = getBinaryOperatorPrecedence(); // Check the precedence to see if we should "take" this operator - // - For left associative operator (all operator but **), only consume the operator - // , recursively call the function below and parse binaryExpression as a rightOperand + // - For left associative operator (all operator but **), consume the operator, + // recursively call the function below, and parse binaryExpression as a rightOperand // of the caller if the new precendence of the operator is greater then or equal to the current precendence. // For example: // a - b - c; @@ -3025,7 +3025,7 @@ namespace ts { // ^token; leftOperand = b. Return b to the caller as a rightOperand // a - b * c; // ^token; leftOperand = b. Return b * c to the caller as a rightOperand - // - For right associative operator (**), only consume the operator, recursively call the function + // - For right associative operator (**), consume the operator, recursively call the function // and parse binaryExpression as a rightOperand of the caller if the new precendence of // the operator is strictly grater than the current precendence // For example: @@ -3187,33 +3187,6 @@ namespace ts { return finishNode(node); } - /** - * Check if the current token can possibly be in an ES7 increment expression. - * - * Increment Expression: - * LeftHandSideExpression[?Yield] - * LeftHandSideExpression[?Yield][no LineTerminator here]++ - * LeftHandSideExpression[?Yield][no LineTerminator here]-- - * ++LeftHandSideExpression[?Yield] - * --LeftHandSideExpression[?Yield] - */ - function isIncrementExpression(): boolean{ - // TODO(yuisu): Comment why we have to do what are we doing here - switch (token) { - case SyntaxKind.PlusToken: - case SyntaxKind.MinusToken: - case SyntaxKind.TildeToken: - case SyntaxKind.ExclamationToken: - case SyntaxKind.DeleteKeyword: - case SyntaxKind.TypeOfKeyword: - case SyntaxKind.VoidKeyword: - case SyntaxKind.LessThanToken: - return false; - default: - return true; - } - } - /** * Parse ES7 unary expression and await expression * @@ -3241,9 +3214,9 @@ namespace ts { } /** - * Parse ES7 simple-unary expression or higher: + * Parse ES7 simple-unary expression or higher: * - * SimpleUnaryExpression: + * ES7 SimpleUnaryExpression: * 1) IncrementExpression[?yield] * 2) delete UnaryExpression[?yield] * 3) void UnaryExpression[?yield] @@ -3283,9 +3256,37 @@ namespace ts { } /** - * Parse ES7 IncrementExpression. The IncrementExpression is used instead of ES6's PostFixExpression. + * Check if the current token can possibly be an ES7 increment expression. + * + * ES7 IncrementExpression: + * LeftHandSideExpression[?Yield] + * LeftHandSideExpression[?Yield][no LineTerminator here]++ + * LeftHandSideExpression[?Yield][no LineTerminator here]-- + * ++LeftHandSideExpression[?Yield] + * --LeftHandSideExpression[?Yield] + */ + function isIncrementExpression(): boolean{ + // This function is called inside parseUnaryExpression to decide + // whether to call parseSimpleUnaryExpression or call parseIncrmentExpression directly + switch (token) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.DeleteKeyword: + case SyntaxKind.TypeOfKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.LessThanToken: + return false; + default: + return true; + } + } + + /** + * Parse ES7 IncrementExpression. IncrementExpression is used instead of ES6's PostFixExpression. * - * IncrementExpression[yield]: + * ES7 IncrementExpression[yield]: * 1) LeftHandSideExpression[?yield] * 2) LeftHandSideExpression[?yield] [[no LineTerminator here]]++ * 3) LeftHandSideExpression[?yield] [[no LineTerminator here]]-- diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e885aa2b7f415..2b8c2624819a2 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -711,11 +711,10 @@ namespace ts { export interface IncrementExpression extends UnaryExpression { _incrementExpressionBrand: any; } - //export type IncrementExpression = PrefixUnaryExpression | PostfixUnaryExpression | LeftHandSideExpression; export interface PrefixUnaryExpression extends IncrementExpression { operator: SyntaxKind; - operand: UnaryExpression | BinaryExpression; + operand: UnaryExpression; } export interface PostfixUnaryExpression extends IncrementExpression { @@ -740,19 +739,19 @@ namespace ts { } export interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression | BinaryExpression; + expression: UnaryExpression; } export interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression | BinaryExpression; + expression: UnaryExpression; } export interface VoidExpression extends UnaryExpression { - expression: UnaryExpression | BinaryExpression; + expression: UnaryExpression; } export interface AwaitExpression extends UnaryExpression { - expression: UnaryExpression | BinaryExpression; + expression: UnaryExpression; } export interface YieldExpression extends Expression { @@ -859,7 +858,7 @@ namespace ts { export interface TypeAssertion extends UnaryExpression { type: TypeNode; - expression: UnaryExpression | BinaryExpression; + expression: UnaryExpression; } export type AssertionExpression = TypeAssertion | AsExpression; From d96a00e4b8add0c09d30499280478d014aea68fd Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 6 Oct 2015 15:28:48 -0700 Subject: [PATCH 28/39] Parse typeAssertion expression as simpleUnaryExpression --- src/compiler/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index af46229d57f5e..c283ec0fc9505 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3600,7 +3600,7 @@ namespace ts { parseExpected(SyntaxKind.LessThanToken); node.type = parseType(); parseExpected(SyntaxKind.GreaterThanToken); - node.expression = parseUnaryExpressionOrHigher(); + node.expression = parseSimpleUnaryExpression(); return finishNode(node); } From 8be77b448f7589d309e8acc36a3408e82a1ab2d1 Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 6 Oct 2015 15:29:21 -0700 Subject: [PATCH 29/39] Update test to parse typeAssertion as simpleUnaryExpression --- .../reference/emitExponentiationOperator4.js | 34 ++++----- .../emitExponentiationOperator4.symbols | 19 ++--- .../emitExponentiationOperator4.types | 71 +++++++++++-------- .../emitExponentiationOperator4ES7.js | 34 ++++----- .../emitExponentiationOperator4ES7.symbols | 19 ++--- .../emitExponentiationOperator4ES7.types | 71 +++++++++++-------- ...onentiationOperatorSyntaxError2.errors.txt | 24 ++++++- .../exponentiationOperatorSyntaxError2.js | 12 +++- .../emitExponentiationOperator4.ts | 17 ++--- .../emitExponentiationOperator4ES7.ts | 17 ++--- .../exponentiationOperatorSyntaxError2.ts | 6 ++ 11 files changed, 201 insertions(+), 123 deletions(-) diff --git a/tests/baselines/reference/emitExponentiationOperator4.js b/tests/baselines/reference/emitExponentiationOperator4.js index 185616601bee7..7bed614b664ad 100644 --- a/tests/baselines/reference/emitExponentiationOperator4.js +++ b/tests/baselines/reference/emitExponentiationOperator4.js @@ -1,15 +1,16 @@ //// [emitExponentiationOperator4.ts] var temp: any; ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; +(temp) ** 3; +(--temp) ** 3; +(++temp) ** 3; +(temp--) ** 3; +(temp++) ** 3; -1 ** --temp ** 3; -1 ** ++temp ** 3; -1 ** temp-- ** 3; -1 ** temp++ ** 3; +1 ** (--temp) ** 3; +1 ** (++temp) ** 3; +1 ** (temp--) ** 3; +1 ** (temp++) ** 3; (void --temp) ** 3; (void temp--) ** 3; @@ -38,14 +39,15 @@ var temp: any; //// [emitExponentiationOperator4.js] var temp; -Math.pow(--temp, 3); -Math.pow(++temp, 3); -Math.pow(temp--, 3); -Math.pow(temp++, 3); -Math.pow(1, Math.pow(--temp, 3)); -Math.pow(1, Math.pow(++temp, 3)); -Math.pow(1, Math.pow(temp--, 3)); -Math.pow(1, Math.pow(temp++, 3)); +Math.pow(temp, 3); +Math.pow((--temp), 3); +Math.pow((++temp), 3); +Math.pow((temp--), 3); +Math.pow((temp++), 3); +Math.pow(1, Math.pow((--temp), 3)); +Math.pow(1, Math.pow((++temp), 3)); +Math.pow(1, Math.pow((temp--), 3)); +Math.pow(1, Math.pow((temp++), 3)); Math.pow((void --temp), 3); Math.pow((void temp--), 3); Math.pow((void 3), 4); diff --git a/tests/baselines/reference/emitExponentiationOperator4.symbols b/tests/baselines/reference/emitExponentiationOperator4.symbols index c57825f908a8d..45b73afbce8a6 100644 --- a/tests/baselines/reference/emitExponentiationOperator4.symbols +++ b/tests/baselines/reference/emitExponentiationOperator4.symbols @@ -2,28 +2,31 @@ var temp: any; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) ---temp ** 3; +(temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -++temp ** 3; +(--temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -temp-- ** 3; +(++temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -temp++ ** 3; +(temp--) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -1 ** --temp ** 3; +(temp++) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -1 ** ++temp ** 3; +1 ** (--temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -1 ** temp-- ** 3; +1 ** (++temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) -1 ** temp++ ** 3; +1 ** (temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) + +1 ** (temp++) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4.ts, 0, 3)) (void --temp) ** 3; diff --git a/tests/baselines/reference/emitExponentiationOperator4.types b/tests/baselines/reference/emitExponentiationOperator4.types index 2d5a7ea48f41c..36da1c32b4c3e 100644 --- a/tests/baselines/reference/emitExponentiationOperator4.types +++ b/tests/baselines/reference/emitExponentiationOperator4.types @@ -2,66 +2,81 @@ var temp: any; >temp : any ---temp ** 3; ->--temp ** 3 : number ->--temp ** 3 : number +(temp) ** 3; +>(temp) ** 3 : number +>(temp) : number +>temp : number +>temp : any +>3 : number + +(--temp) ** 3; +>(--temp) ** 3 : number +>(--temp) : number +>--temp : number >--temp : number >temp : any >3 : number -++temp ** 3; ->++temp ** 3 : number ->++temp ** 3 : number +(++temp) ** 3; +>(++temp) ** 3 : number +>(++temp) : number +>++temp : number >++temp : number >temp : any >3 : number -temp-- ** 3; ->temp-- ** 3 : number ->temp-- ** 3 : number +(temp--) ** 3; +>(temp--) ** 3 : number +>(temp--) : number +>temp-- : number >temp-- : number >temp : any >3 : number -temp++ ** 3; ->temp++ ** 3 : number ->temp++ ** 3 : number +(temp++) ** 3; +>(temp++) ** 3 : number +>(temp++) : number +>temp++ : number >temp++ : number >temp : any >3 : number -1 ** --temp ** 3; ->1 ** --temp ** 3 : number +1 ** (--temp) ** 3; +>1 ** (--temp) ** 3 : number >1 : number ->--temp ** 3 : number ->--temp ** 3 : number +>(--temp) ** 3 : number +>(--temp) : number +>--temp : number >--temp : number >temp : any >3 : number -1 ** ++temp ** 3; ->1 ** ++temp ** 3 : number +1 ** (++temp) ** 3; +>1 ** (++temp) ** 3 : number >1 : number ->++temp ** 3 : number ->++temp ** 3 : number +>(++temp) ** 3 : number +>(++temp) : number +>++temp : number >++temp : number >temp : any >3 : number -1 ** temp-- ** 3; ->1 ** temp-- ** 3 : number +1 ** (temp--) ** 3; +>1 ** (temp--) ** 3 : number >1 : number ->temp-- ** 3 : number ->temp-- ** 3 : number +>(temp--) ** 3 : number +>(temp--) : number +>temp-- : number >temp-- : number >temp : any >3 : number -1 ** temp++ ** 3; ->1 ** temp++ ** 3 : number +1 ** (temp++) ** 3; +>1 ** (temp++) ** 3 : number >1 : number ->temp++ ** 3 : number ->temp++ ** 3 : number +>(temp++) ** 3 : number +>(temp++) : number +>temp++ : number >temp++ : number >temp : any >3 : number diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.js b/tests/baselines/reference/emitExponentiationOperator4ES7.js index fb32144575d1c..2602fd2b8e626 100644 --- a/tests/baselines/reference/emitExponentiationOperator4ES7.js +++ b/tests/baselines/reference/emitExponentiationOperator4ES7.js @@ -1,15 +1,16 @@ //// [emitExponentiationOperator4ES7.ts] var temp: any; ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; +(temp) ** 3; +(--temp) ** 3; +(++temp) ** 3; +(temp--) ** 3; +(temp++) ** 3; -1 ** --temp ** 3; -1 ** ++temp ** 3; -1 ** temp-- ** 3; -1 ** temp++ ** 3; +1 ** (--temp) ** 3; +1 ** (++temp) ** 3; +1 ** (temp--) ** 3; +1 ** (temp++) ** 3; (void --temp) ** 3; (void temp--) ** 3; @@ -38,14 +39,15 @@ var temp: any; //// [emitExponentiationOperator4ES7.js] var temp; ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; -1 ** --temp ** 3; -1 ** ++temp ** 3; -1 ** temp-- ** 3; -1 ** temp++ ** 3; +temp ** 3; +(--temp) ** 3; +(++temp) ** 3; +(temp--) ** 3; +(temp++) ** 3; +1 ** (--temp) ** 3; +1 ** (++temp) ** 3; +1 ** (temp--) ** 3; +1 ** (temp++) ** 3; (void --temp) ** 3; (void temp--) ** 3; (void 3) ** 4; diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.symbols b/tests/baselines/reference/emitExponentiationOperator4ES7.symbols index 53701ed5aef75..d66e1379908ca 100644 --- a/tests/baselines/reference/emitExponentiationOperator4ES7.symbols +++ b/tests/baselines/reference/emitExponentiationOperator4ES7.symbols @@ -2,28 +2,31 @@ var temp: any; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) ---temp ** 3; +(temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -++temp ** 3; +(--temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -temp-- ** 3; +(++temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -temp++ ** 3; +(temp--) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -1 ** --temp ** 3; +(temp++) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -1 ** ++temp ** 3; +1 ** (--temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -1 ** temp-- ** 3; +1 ** (++temp) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) -1 ** temp++ ** 3; +1 ** (temp--) ** 3; +>temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) + +1 ** (temp++) ** 3; >temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) (void --temp) ** 3; diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.types b/tests/baselines/reference/emitExponentiationOperator4ES7.types index 78eacba9e39d9..5449c8989466a 100644 --- a/tests/baselines/reference/emitExponentiationOperator4ES7.types +++ b/tests/baselines/reference/emitExponentiationOperator4ES7.types @@ -2,66 +2,81 @@ var temp: any; >temp : any ---temp ** 3; ->--temp ** 3 : number ->--temp ** 3 : number +(temp) ** 3; +>(temp) ** 3 : number +>(temp) : number +>temp : number +>temp : any +>3 : number + +(--temp) ** 3; +>(--temp) ** 3 : number +>(--temp) : number +>--temp : number >--temp : number >temp : any >3 : number -++temp ** 3; ->++temp ** 3 : number ->++temp ** 3 : number +(++temp) ** 3; +>(++temp) ** 3 : number +>(++temp) : number +>++temp : number >++temp : number >temp : any >3 : number -temp-- ** 3; ->temp-- ** 3 : number ->temp-- ** 3 : number +(temp--) ** 3; +>(temp--) ** 3 : number +>(temp--) : number +>temp-- : number >temp-- : number >temp : any >3 : number -temp++ ** 3; ->temp++ ** 3 : number ->temp++ ** 3 : number +(temp++) ** 3; +>(temp++) ** 3 : number +>(temp++) : number +>temp++ : number >temp++ : number >temp : any >3 : number -1 ** --temp ** 3; ->1 ** --temp ** 3 : number +1 ** (--temp) ** 3; +>1 ** (--temp) ** 3 : number >1 : number ->--temp ** 3 : number ->--temp ** 3 : number +>(--temp) ** 3 : number +>(--temp) : number +>--temp : number >--temp : number >temp : any >3 : number -1 ** ++temp ** 3; ->1 ** ++temp ** 3 : number +1 ** (++temp) ** 3; +>1 ** (++temp) ** 3 : number >1 : number ->++temp ** 3 : number ->++temp ** 3 : number +>(++temp) ** 3 : number +>(++temp) : number +>++temp : number >++temp : number >temp : any >3 : number -1 ** temp-- ** 3; ->1 ** temp-- ** 3 : number +1 ** (temp--) ** 3; +>1 ** (temp--) ** 3 : number >1 : number ->temp-- ** 3 : number ->temp-- ** 3 : number +>(temp--) ** 3 : number +>(temp--) : number +>temp-- : number >temp-- : number >temp : any >3 : number -1 ** temp++ ** 3; ->1 ** temp++ ** 3 : number +1 ** (temp++) ** 3; +>1 ** (temp++) ** 3 : number >1 : number ->temp++ ** 3 : number ->temp++ ** 3 : number +>(temp++) ** 3 : number +>(temp++) : number +>temp++ : number >temp++ : number >temp : any >3 : number diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt index 67ff666729285..45d0854a07fde 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt @@ -74,9 +74,14 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts (76 errors) ==== +==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts (81 errors) ==== // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () var temp; @@ -291,4 +296,19 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ !!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - \ No newline at end of file + + temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ++temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + --temp ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + temp++ ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + temp-- ** 3; + ~~ +!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.js b/tests/baselines/reference/exponentiationOperatorSyntaxError2.js index 758160ec31240..9e07273522fda 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError2.js +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.js @@ -61,7 +61,12 @@ void temp-- ** 4; 1 ** !3 ** 4; 1 ** !temp++ ** 4; 1 ** !temp-- ** 4; - + +temp ** 3; +++temp ** 3; +--temp ** 3; +temp++ ** 3; +temp-- ** 3; //// [exponentiationOperatorSyntaxError2.js] // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () @@ -114,3 +119,8 @@ Math.pow(1, Math.pow(!temp--, 3)); Math.pow(1, Math.pow(!3, 4)); Math.pow(1, Math.pow(!temp++, 4)); Math.pow(1, Math.pow(!temp--, 4)); +Math.pow(temp, 3); +Math.pow(++temp, 3); +Math.pow(--temp, 3); +Math.pow(temp++, 3); +Math.pow(temp--, 3); diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts index 6788ab36f8651..0e16443d5473a 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4.ts @@ -1,15 +1,16 @@ // @target: es5 var temp: any; ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; +(temp) ** 3; +(--temp) ** 3; +(++temp) ** 3; +(temp--) ** 3; +(temp++) ** 3; -1 ** --temp ** 3; -1 ** ++temp ** 3; -1 ** temp-- ** 3; -1 ** temp++ ** 3; +1 ** (--temp) ** 3; +1 ** (++temp) ** 3; +1 ** (temp--) ** 3; +1 ** (temp++) ** 3; (void --temp) ** 3; (void temp--) ** 3; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts index d3b718a20542e..6da1f54b7013d 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts @@ -1,15 +1,16 @@ // @target: es7 var temp: any; ---temp ** 3; -++temp ** 3; -temp-- ** 3; -temp++ ** 3; +(temp) ** 3; +(--temp) ** 3; +(++temp) ** 3; +(temp--) ** 3; +(temp++) ** 3; -1 ** --temp ** 3; -1 ** ++temp ** 3; -1 ** temp-- ** 3; -1 ** temp++ ** 3; +1 ** (--temp) ** 3; +1 ** (++temp) ** 3; +1 ** (temp--) ** 3; +1 ** (temp++) ** 3; (void --temp) ** 3; (void temp--) ** 3; diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts index da7cf7f0d8580..e5118d18551b8 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts @@ -61,3 +61,9 @@ void temp-- ** 4; 1 ** !3 ** 4; 1 ** !temp++ ** 4; 1 ** !temp-- ** 4; + +temp ** 3; +++temp ** 3; +--temp ** 3; +temp++ ** 3; +temp-- ** 3; \ No newline at end of file From 37db03ae6af3862b000cc1bf31d0941af5d0e48d Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 7 Oct 2015 14:50:58 -0700 Subject: [PATCH 30/39] Address feedback on diagnostic message --- .../diagnosticInformationMap.generated.ts | 3 +- src/compiler/diagnosticMessages.json | 6 +- src/compiler/parser.ts | 56 +-- ...nTemplateStringWithSyntaxError1.errors.txt | 180 +++++----- ...nTemplateStringWithSyntaxError2.errors.txt | 180 +++++----- ...nTemplateStringWithSyntaxError3.errors.txt | 180 +++++----- ...onentiationOperatorSyntaxError1.errors.txt | 186 +++++----- ...onentiationOperatorSyntaxError2.errors.txt | 318 +++++++++--------- 8 files changed, 562 insertions(+), 547 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 5b12e5ac21551..54b31f2477a99 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -618,6 +618,7 @@ namespace ts { JSX_attribute_expected: { code: 17003, category: DiagnosticCategory.Error, key: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: DiagnosticCategory.Error, key: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor cannot contain a 'super' call when its class extends 'null'" }, - Left_hand_side_of_Asterisk_Asterisk_cannot_be_a_simple_unary_expression_Consider_parenthesize_the_expression: { code: 17006, category: DiagnosticCategory.Error, key: "Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression." }, + An_unary_expression_with_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "An unary expression with '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + Type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 34dd1ffa22771..e97de6ef68baf 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2467,7 +2467,11 @@ "category": "Error", "code": 17005 }, - "Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression.": { + "An unary expression with '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { + "category": "Error", + "code": 17006 + }, + "Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { "category": "Error", "code": 17006 } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index c283ec0fc9505..4046d4a7c3630 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3206,9 +3206,17 @@ namespace ts { incrementExpression; } + let unaryOperator = token; let simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === SyntaxKind.AsteriskAsteriskToken) { - parseErrorAtCurrentToken(Diagnostics.Left_hand_side_of_Asterisk_Asterisk_cannot_be_a_simple_unary_expression_Consider_parenthesize_the_expression) + let diagnostic: Diagnostic; + let start = skipTrivia(sourceText, simpleUnaryExpression.pos); + if (simpleUnaryExpression.kind === SyntaxKind.TypeAssertionExpression) { + parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.Type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); + } + else { + parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.An_unary_expression_with_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator)); + } } return simpleUnaryExpression; } @@ -3240,16 +3248,10 @@ namespace ts { case SyntaxKind.VoidKeyword: return parseVoidExpression(); case SyntaxKind.LessThanToken: - if (sourceFile.languageVariant !== LanguageVariant.JSX) { - // This is modified UnaryExpression grammar in TypeScript - // UnaryExpression (modified): - // < type > UnaryExpression - return parseTypeAssertion(); - } - if (lookAhead(nextTokenIsIdentifierOrKeyword)) { - return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); - } - // Fall through + // This is modified UnaryExpression grammar in TypeScript + // UnaryExpression (modified): + // < type > UnaryExpression + return parseTypeAssertion(); default: return parseIncrementExpression(); } @@ -3276,8 +3278,13 @@ namespace ts { case SyntaxKind.DeleteKeyword: case SyntaxKind.TypeOfKeyword: case SyntaxKind.VoidKeyword: + return false case SyntaxKind.LessThanToken: - return false; + // TODO (yuisu): comment + if (sourceFile.languageVariant !== LanguageVariant.JSX) { + return false; + } + // Fall through default: return true; } @@ -3302,20 +3309,23 @@ namespace ts { node.operand = parseLeftHandSideExpressionOrHigher(); return finishNode(node); } - else { - let expression = parseLeftHandSideExpressionOrHigher(); + else if (sourceFile.languageVariant === LanguageVariant.JSX && token === SyntaxKind.LessThanToken && lookAhead(nextTokenIsIdentifierOrKeyword)) { + // TODO (yuisu) : comment + return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); + } - Debug.assert(isLeftHandSideExpression(expression)); - if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { - let node = createNode(SyntaxKind.PostfixUnaryExpression, expression.pos); - node.operand = expression; - node.operator = token; - nextToken(); - return finishNode(node); - } + let expression = parseLeftHandSideExpressionOrHigher(); - return expression; + Debug.assert(isLeftHandSideExpression(expression)); + if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { + let node = createNode(SyntaxKind.PostfixUnaryExpression, expression.pos); + node.operand = expression; + node.operator = token; + nextToken(); + return finishNode(node); } + + return expression; } function parseLeftHandSideExpressionOrHigher(): LeftHandSideExpression { diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt index dee60064e8510..56ffea60a1856 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt @@ -1,48 +1,48 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(9,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(10,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(11,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(9,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(10,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(11,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,25): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,21): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,25): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,25): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,28): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,28): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,36): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,46): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,36): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,34): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,38): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,38): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,41): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,51): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,41): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,59): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,49): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts (45 errors) ==== @@ -56,110 +56,110 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTempl `${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. \ No newline at end of file + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt index b73c8b4493275..4cdc5ca3b8ff8 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt @@ -1,48 +1,48 @@ -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(8,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(9,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(10,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(8,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(9,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(10,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,10): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,10): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,24): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,31): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,35): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,35): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,14): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,27): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,29): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,29): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,10): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,31): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,35): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,31): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,10): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,34): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,44): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,34): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,24): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,14): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,42): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,52): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,44): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,48): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,48): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,42): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,40): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,42): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,42): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,10): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,44): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,48): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,44): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,10): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,47): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,57): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,47): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,24): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,14): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,55): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,65): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,55): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts (45 errors) ==== @@ -54,113 +54,113 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTempl // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // With templateHead `hello ${-t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-++t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1++ ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt index 9fdf5712851d8..1c79166c04a65 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt @@ -1,48 +1,48 @@ -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(8,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(9,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(10,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(8,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(9,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(10,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,25): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,21): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,25): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,29): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,25): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,28): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,28): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,36): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,46): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,38): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,36): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,34): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,38): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,42): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,38): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,41): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,51): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,41): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,59): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,49): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts (45 errors) ==== @@ -54,112 +54,112 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTempl // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // With TemplateTail `${-t1 ** t2 - t1} world`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1} world`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1} world`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 } world`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. \ No newline at end of file + ~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt index 774f733748d10..c824a8fe57ee5 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt @@ -1,135 +1,135 @@ -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(3,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(4,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(5,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(6,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(8,11): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(12,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(13,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(14,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(15,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(16,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(17,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(18,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(19,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(21,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(22,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(23,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(24,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(25,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(26,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(27,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(28,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(29,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(30,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(31,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(32,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(33,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(34,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(35,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(36,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(3,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(4,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(5,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(6,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,7): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(8,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(12,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(13,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(14,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(15,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(16,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(17,6): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(18,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(19,6): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(21,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(22,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(23,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(24,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(25,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(26,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(27,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(28,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(29,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(30,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(31,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(32,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(33,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(34,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(35,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(36,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts (31 errors) ==== // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () -1 ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +1 ** 2 - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -2 ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -2 ** -3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -1 ** -2 ** -3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -(1 ** 2) ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. var temp = 10; -++temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +--temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -temp++ ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -++temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** +--temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -temp++ ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** +temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp++; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp--; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** ++temp; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** --temp; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp++; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp--; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** ++temp; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** --temp; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp++ ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp-- ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** ++temp ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** --temp ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp++ ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp-- ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** ++temp ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** --temp ** 2; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt index 45d0854a07fde..a39b7c69bc4c8 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt @@ -1,84 +1,84 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,20): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(28,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(29,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(30,8): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(31,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(32,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(34,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(35,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(36,13): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(37,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(38,18): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(40,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(41,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(42,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(43,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(44,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(46,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(47,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(48,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(49,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(50,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(28,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(29,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(30,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(31,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(32,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(34,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(35,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(36,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(37,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(38,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(40,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(41,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(42,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(43,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(44,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(46,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(47,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(48,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(49,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(50,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,10): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,4): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,15): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,9): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,14): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,16): error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts (81 errors) ==== @@ -89,226 +89,226 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE delete --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. delete ++temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. delete temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. delete temp++ ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete ++temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete temp++ ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof 3 ** 4; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof temp++ ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof temp-- ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof 3 ** 4; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof temp++ ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof temp-- ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void --temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void 3 ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void temp++ ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void temp-- ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void --temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void 3 ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void temp++ ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void temp-- ** 4 ; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~ +!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~ --temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~3 ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~temp++ ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~temp-- ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~ --temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~3 ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~temp++ ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~temp-- ** 4; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ! --temp ** 3; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !temp-- ** 3; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !3 ** 4; ~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !temp++ ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !temp-- ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ! --temp ** 3; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !temp-- ** 3; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !3 ** 4; ~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !temp++ ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !temp-- ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~ +!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~ +!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ++temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~~ +!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. --temp ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~~ +!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp++ ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. + ~~~~~~~~~~~~~~ +!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp-- ** 3; - ~~ -!!! error TS17006: Left hand side of '**' cannot be a simple unary expression. Consider parenthesize the expression. \ No newline at end of file + ~~~~~~~~~~~~~~ +!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file From 3b8cdb684b41726c5638756b0cbb8ec725e47ddd Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 7 Oct 2015 15:26:09 -0700 Subject: [PATCH 31/39] Address comment to increment emitCount in separate line --- src/compiler/emitter.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 115979bd30b73..ce52119dbe125 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3329,7 +3329,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expr, /*shouldEmitCommaBeforeAssignment*/ emitCount++ > 0); + emitAssignment(identifier, expr, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitCount++; return identifier; } @@ -3429,7 +3430,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitArrayLiteralAssignment(target, value); } else { - emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount++ > 0); + emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitCount++; } } @@ -3498,7 +3500,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } else { - emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount++ > 0); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount> 0); + emitCount++; } } } From 75de6d45306750cb34b253177e57451b0846c22a Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 7 Oct 2015 18:44:20 -0700 Subject: [PATCH 32/39] Add comment --- src/compiler/parser.ts | 5 +++-- src/compiler/program.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 4046d4a7c3630..af3249ddca2c9 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3280,10 +3280,11 @@ namespace ts { case SyntaxKind.VoidKeyword: return false case SyntaxKind.LessThanToken: - // TODO (yuisu): comment + // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression if (sourceFile.languageVariant !== LanguageVariant.JSX) { return false; } + // We are in JSX context and the token is part of JSXElement. // Fall through default: return true; @@ -3310,7 +3311,7 @@ namespace ts { return finishNode(node); } else if (sourceFile.languageVariant === LanguageVariant.JSX && token === SyntaxKind.LessThanToken && lookAhead(nextTokenIsIdentifierOrKeyword)) { - // TODO (yuisu) : comment + // JSXElement is part of primaryExpression return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 3da3c354fb236..3043f6be70847 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -862,8 +862,8 @@ namespace ts { const importedFile = findModuleSourceFile(resolution.resolvedFileName, file.imports[i]); if (importedFile && resolution.isExternalLibraryImport) { if (!isExternalModule(importedFile)) { - let start = getTokenPosOfNode(file.imports[i], file) - fileProcessingDiagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); + let start = getTokenPosOfNode(file.imports[i], file) + fileProcessingDiagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); } else if (!fileExtensionIs(importedFile.fileName, ".d.ts")) { let start = getTokenPosOfNode(file.imports[i], file) From cd3f711a76e5f2cc23f300ea9db5a7f10dee67ac Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 8 Oct 2015 14:38:58 -0700 Subject: [PATCH 33/39] Address PR feedback --- .../diagnosticInformationMap.generated.ts | 4 +- src/compiler/diagnosticMessages.json | 4 +- src/compiler/emitter.ts | 26 +-- src/compiler/parser.ts | 4 +- ...nTemplateStringWithSyntaxError1.errors.txt | 120 +++++----- ...nTemplateStringWithSyntaxError2.errors.txt | 120 +++++----- ...nTemplateStringWithSyntaxError3.errors.txt | 120 +++++----- ...onentiationOperatorSyntaxError1.errors.txt | 124 +++++----- ...onentiationOperatorSyntaxError2.errors.txt | 212 +++++++++--------- 9 files changed, 367 insertions(+), 367 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 54b31f2477a99..7af1afb251aac 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -618,7 +618,7 @@ namespace ts { JSX_attribute_expected: { code: 17003, category: DiagnosticCategory.Error, key: "JSX attribute expected." }, Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: DiagnosticCategory.Error, key: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor cannot contain a 'super' call when its class extends 'null'" }, - An_unary_expression_with_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "An unary expression with '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, - Type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e97de6ef68baf..59a494629e4d2 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2467,11 +2467,11 @@ "category": "Error", "code": 17005 }, - "An unary expression with '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { + "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { "category": "Error", "code": 17006 }, - "Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { + "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { "category": "Error", "code": 17006 } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index ce52119dbe125..41b4552415917 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -836,8 +836,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } let node = nodes[start + i]; - let leadcomment = getLeadingCommentsToEmit(node); - let trailcomment = getTrailingCommentRanges(currentSourceFile.text, node.pos); + let leadingComments = getLeadingCommentsToEmit(node); + let trailingComments = getTrailingCommentRanges(currentSourceFile.text, node.pos); // This emitting is to make sure we emit following comment properly // ...(x, /*comment1*/ y)... // ^ => node.pos @@ -2522,7 +2522,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // a[0] **= a[0] **= 2 // _a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2))); // ^ -> required extra parenthesis controlled by shouldEmitParenthesis - // exponentiation compount in variable declaration + // exponentiation compound in variable declaration // var x = a[0] **= a[0] **= 2 // var x = (_a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2)))); // ^ -> required extra parenthesis controlled by shouldEmitParenthesis @@ -2537,9 +2537,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } synthesizedLHS = createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false); - let tempExpression = createAndRecordTempVariable(TempFlags.Auto); - emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); - synthesizedLHS.expression = tempExpression + let tempVariable = createAndRecordTempVariable(TempFlags.Auto); + emitAssignment(tempVariable, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); + synthesizedLHS.expression = tempVariable if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral && leftHandSideExpression.argumentExpression.kind !== SyntaxKind.StringLiteral) { @@ -2560,9 +2560,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } synthesizedLHS = createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false); - let tempExpression = createAndRecordTempVariable(TempFlags.Auto); - synthesizedLHS.expression = tempExpression - emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); + let tempVariable = createAndRecordTempVariable(TempFlags.Auto); + synthesizedLHS.expression = tempVariable + emitAssignment(tempVariable, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); (synthesizedLHS).dotToken = leftHandSideExpression.dotToken; (synthesizedLHS).name = leftHandSideExpression.name; write(", "); @@ -3259,9 +3259,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(", "); } - const isVariableDeclarationOrBindingElement = - name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); - let exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); if (exportChanged) { @@ -3270,6 +3267,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`", `); } + const isVariableDeclarationOrBindingElement = + name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); + if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } @@ -3500,7 +3500,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } else { - emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount> 0); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); emitCount++; } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index af3249ddca2c9..2e661b86f237d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3212,10 +3212,10 @@ namespace ts { let diagnostic: Diagnostic; let start = skipTrivia(sourceText, simpleUnaryExpression.pos); if (simpleUnaryExpression.kind === SyntaxKind.TypeAssertionExpression) { - parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.Type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); + parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { - parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.An_unary_expression_with_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator)); + parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator)); } } return simpleUnaryExpression; diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt index 56ffea60a1856..c20e4b1900886 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.errors.txt @@ -1,48 +1,48 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(9,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(10,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(11,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(8,8): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(9,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(10,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(11,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(12,4): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,21): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(13,4): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(15,21): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(16,23): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(17,23): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,4): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,25): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,25): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(18,25): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,4): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,28): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,28): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(19,28): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,8): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,36): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,36): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,34): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(20,36): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(22,34): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(23,36): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(24,36): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,4): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,38): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,38): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(25,38): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,4): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,41): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,41): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(26,41): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,8): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,49): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts(27,49): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError1.ts (45 errors) ==== @@ -57,109 +57,109 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTempl ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1}`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt index 4cdc5ca3b8ff8..015d1f6d6f002 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.errors.txt @@ -1,48 +1,48 @@ -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(8,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(9,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(10,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(8,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(9,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(10,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,10): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(11,10): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,10): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(12,10): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,14): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,27): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,29): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,29): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(13,14): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(15,27): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(16,29): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(17,29): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,10): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,10): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,31): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,31): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(18,31): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,10): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,10): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,34): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,34): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(19,34): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,14): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,14): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,42): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,42): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,40): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,42): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,10): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,42): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(20,42): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(22,40): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(23,42): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,10): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(24,42): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,10): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,10): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,44): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,44): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(25,44): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,10): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,10): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,47): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,47): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(26,47): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,14): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,14): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,55): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,55): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts(27,55): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError2.ts (45 errors) ==== @@ -55,112 +55,112 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTempl // With templateHead `hello ${-t1 ** t2 - t1}`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-++t1 ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1++ ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt index 1c79166c04a65..320d9a4d309d9 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.errors.txt @@ -1,48 +1,48 @@ -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(8,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(9,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(10,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(8,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(9,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(10,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(11,4): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(12,4): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,21): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,23): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(13,8): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(15,21): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(16,23): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(17,23): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,4): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,25): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,25): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(18,25): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,4): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,28): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,28): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(19,28): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,8): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,36): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,36): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,34): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,4): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,36): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(20,36): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(22,34): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(23,36): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,4): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(24,36): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,4): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,4): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,38): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,38): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(25,38): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,4): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,4): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,4): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,41): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,41): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(26,41): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,8): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,8): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,8): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,49): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts(27,49): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTemplateStringWithSyntaxError3.ts (45 errors) ==== @@ -55,111 +55,111 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorInTempl // With TemplateTail `${-t1 ** t2 - t1} world`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1} world`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1} world`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 } world`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt index c824a8fe57ee5..4b56e4f4258ee 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError1.errors.txt @@ -1,34 +1,34 @@ -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(3,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(4,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(5,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(6,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,7): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(8,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(12,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(13,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(14,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(15,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(16,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(17,6): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(18,6): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(19,6): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(21,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(22,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(23,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(24,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(25,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(26,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(27,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(28,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(29,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(30,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(31,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(32,1): error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(33,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(34,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(35,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(36,1): error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(3,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(4,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(5,6): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(6,6): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(7,7): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(8,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(12,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(13,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(14,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(15,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(16,6): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(17,6): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(18,6): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(19,6): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(21,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(22,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(23,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(24,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(25,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(26,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(27,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(28,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(29,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(30,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(31,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(32,1): error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(33,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(34,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(35,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts(36,1): error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError1.ts (31 errors) ==== @@ -36,100 +36,100 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () -1 ** 2; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +1 ** 2 ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -2 ** 3; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -2 ** -3; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -1 ** -2 ** -3; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -(1 ** 2) ** 3; ~~~~~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. var temp = 10; -++temp ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +--temp ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -temp++ ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +temp-- ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -++temp ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** +--temp ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** -temp++ ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** +temp-- ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp++; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp--; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** ++temp; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** --temp; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp++; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp--; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** ++temp; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** --temp; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp++ ** 2; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** temp-- ** 2; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** ++temp ** 2; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -3 ** --temp ** 2; ~~ -!!! error TS17006: An unary expression with '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '-' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp++ ** 2; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** temp-- ** 2; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** ++temp ** 2; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +3 ** --temp ** 2; ~~ -!!! error TS17006: An unary expression with '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '+' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt index a39b7c69bc4c8..2864da4a7f3aa 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt @@ -1,84 +1,84 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(5,1): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(6,1): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(7,1): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,1): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(8,1): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(11,6): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(12,6): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(13,6): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,6): error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(14,6): error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(16,1): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(17,1): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(18,1): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(19,1): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,1): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(20,1): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(22,6): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(23,6): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(24,6): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(25,6): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,6): error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(28,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(29,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(30,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(31,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(32,1): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(34,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(35,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(36,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(37,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(38,6): error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(40,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(41,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(42,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(43,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(44,1): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(46,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(47,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(48,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(49,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(50,6): error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(26,6): error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(28,1): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(29,1): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(30,1): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(31,1): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(32,1): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(34,6): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(35,6): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(36,6): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(37,6): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(38,6): error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(40,1): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(41,1): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(42,1): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(43,1): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(44,1): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(46,6): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(47,6): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(48,6): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(49,6): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(50,6): error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(52,1): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(53,1): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(54,1): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(55,1): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,1): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(56,1): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(58,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(59,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(60,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,1): error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts (81 errors) ==== @@ -90,225 +90,225 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. delete ++temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. delete temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. delete temp++ ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete ++temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** delete temp++ ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'delete' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof 3 ** 4; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof temp++ ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. typeof temp-- ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof --temp ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof temp-- ** 3; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof 3 ** 4; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof temp++ ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** typeof temp-- ** 4; ~~~~~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'typeof' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void --temp ** 3; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void temp-- ** 3; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void 3 ** 4; ~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void temp++ ** 4; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. void temp-- ** 4; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void --temp ** 3; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void temp-- ** 3; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void 3 ** 4; ~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void temp++ ** 4; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** void temp-- ** 4 ; ~~~~~~~~~~~ -!!! error TS17006: An unary expression with 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the 'void' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~ --temp ** 3; ~~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~temp-- ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~3 ** 4; ~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~temp++ ** 4; ~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ~temp-- ** 4; ~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~ --temp ** 3; ~~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~temp-- ** 3; ~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~3 ** 4; ~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~temp++ ** 4; ~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ~temp-- ** 4; ~~~~~~~ -!!! error TS17006: An unary expression with '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '~' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ! --temp ** 3; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !temp-- ** 3; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !3 ** 4; ~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !temp++ ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. !temp-- ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** ! --temp ** 3; ~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !temp-- ** 3; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !3 ** 4; ~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !temp++ ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. 1 ** !temp-- ** 4; ~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~ -!!! error TS17006: An unary expression with '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp ** 3; ~~~~~~~~~~~~ -!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ++temp ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. --temp ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp++ ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp-- ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file +!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file From af5dc3e3b3df2924e40e7ebdddd8fee8106f4e8b Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 8 Oct 2015 16:59:49 -0700 Subject: [PATCH 34/39] Address PR feedback. Always emit parentheses around emit capturing --- src/compiler/emitter.ts | 72 +++++++++---------- ...dExponentiationAssignmentLHSIsReference.js | 4 +- ...poundExponentiationAssignmentLHSIsValue.js | 6 +- ...onentiationAssignmentWithIndexingOnLHS1.js | 8 +-- ...onentiationAssignmentWithIndexingOnLHS2.js | 6 +- ...onentiationAssignmentWithIndexingOnLHS3.js | 6 +- ...onentiationAssignmentWithIndexingOnLHS4.js | 6 +- ...onAssignmentWithPropertyAccessingOnLHS1.js | 6 +- 8 files changed, 56 insertions(+), 58 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 41b4552415917..467b3a4d5367a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2509,37 +2509,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /** * Emit ES7 exponentiation operator downlevel using Math.pow - * @param node {BinaryExpression} a binary expression node containing exponentiationOperator (**, **=) + * @param node a binary expression node containing exponentiationOperator (**, **=) */ function emitExponentiationOperator(node: BinaryExpression) { let leftHandSideExpression = node.left; if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { let synthesizedLHS: ElementAccessExpression | PropertyAccessExpression; - - // This is used to decide whether to emit parenthesis around the expresison. - // Parenthesis is required for following cases: - // capture variable while emitting right-hand side operand. - // a[0] **= a[0] **= 2 - // _a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2))); - // ^ -> required extra parenthesis controlled by shouldEmitParenthesis - // exponentiation compound in variable declaration - // var x = a[0] **= a[0] **= 2 - // var x = (_a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2)))); - // ^ -> required extra parenthesis controlled by shouldEmitParenthesis - // Otherwise, false - let shouldEmitParenthesis = false; - + let shouldEmitParentheses = false; if (isElementAccessExpression(leftHandSideExpression)) { - shouldEmitParenthesis = node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BinaryExpression; - - if (shouldEmitParenthesis) { - write("("); - } + shouldEmitParentheses = true; + write("("); synthesizedLHS = createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false); - let tempVariable = createAndRecordTempVariable(TempFlags.Auto); - emitAssignment(tempVariable, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); - synthesizedLHS.expression = tempVariable + + let identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false); + synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral && leftHandSideExpression.argumentExpression.kind !== SyntaxKind.StringLiteral) { @@ -2553,16 +2537,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(", "); } else if (isPropertyAccessExpression(leftHandSideExpression)) { - shouldEmitParenthesis = node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BinaryExpression; + shouldEmitParentheses = true; + write("("); + synthesizedLHS = createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false); - if (shouldEmitParenthesis) { - write("("); - } + let identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false); + synthesizedLHS.expression = identifier; - synthesizedLHS = createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false); - let tempVariable = createAndRecordTempVariable(TempFlags.Auto); - synthesizedLHS.expression = tempVariable - emitAssignment(tempVariable, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false); (synthesizedLHS).dotToken = leftHandSideExpression.dotToken; (synthesizedLHS).name = leftHandSideExpression.name; write(", "); @@ -2575,7 +2556,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(", "); emit(node.right); write(")"); - if (shouldEmitParenthesis) { + if (shouldEmitParentheses) { write(")"); } } @@ -3254,6 +3235,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(";"); } + /** + * Emit an assignment to a given identifier, 'name', with a given expression, 'value'. + * @param name an identifier as a left-hand-side operand of the assignment + * @param value an expression as a right-hand-side operand of the assignment + * @param shouldEmitCommaBeforeAssignment a boolean indicating whether to prefix an assignment with comma + */ function emitAssignment(name: Identifier, value: Expression, shouldEmitCommaBeforeAssignment: boolean) { if (shouldEmitCommaBeforeAssignment) { write(", "); @@ -3285,6 +3272,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } + /** + * Create temporary variable, emit an assignment of the variable the given expression + * @param expression an expression to assign to the newly created temporary variable + * @param canDefineTempVariablesInPlace a boolean indicating whether you can define the temporary variable at an assignment location + * @param shouldEmitCommaBeforeAssignment a boolean indicating whether an assignment should prefix with comma + */ + function emitTempVariableAssignment(expression: Expression, canDefineTempVariablesInPlace: boolean, shouldEmitCommaBeforeAssignment: boolean): Identifier { + let identifier = createTempVariable(TempFlags.Auto); + if (!canDefineTempVariablesInPlace) { + recordTempDeclaration(identifier); + } + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + return identifier; + } + function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; @@ -3325,11 +3327,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return expr; } - let identifier = createTempVariable(TempFlags.Auto); - if (!canDefineTempVariablesInPlace) { - recordTempDeclaration(identifier); - } - emitAssignment(identifier, expr, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + let identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); emitCount++; return identifier; } diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js index cca4a7b55bf9f..f41962cf9e1db 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js @@ -36,8 +36,8 @@ function fn1(x2) { } // property accesses var x3; -_a = x3, _a.a = Math.pow(_a.a, value); -_b = x3, _b['a'] = Math.pow(_b['a'], value); +(_a = x3, _a.a = Math.pow(_a.a, value)); +(_b = x3, _b['a'] = Math.pow(_b['a'], value)); // parentheses, the contained expression is reference (x1) = Math.pow((x1), value); function fn2(x4) { diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index ed825904d7a93..f4e14e5424220 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -140,15 +140,15 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { _super.call(this); - _a = _super.prototype, _a. = Math.pow(_a., value); + (_a = _super.prototype, _a. = Math.pow(_a., value)); var _a; } Derived.prototype.foo = function () { - _a = _super.prototype, _a. = Math.pow(_a., value); + (_a = _super.prototype, _a. = Math.pow(_a., value)); var _a; }; Derived.sfoo = function () { - _a = _super, _a. = Math.pow(_a., value); + (_a = _super, _a. = Math.pow(_a., value)); var _a; }; return Derived; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js index fb2a7d5a88d7b..3b9db4c69980f 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js @@ -19,14 +19,14 @@ array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; //// [emitCompoundExponentiationAssignmentWithIndexingOnLHS1.js] var array0 = [1, 2, 3]; var i0 = 0; -_a = array0, _i = ++i0, _a[_i] = Math.pow(_a[_i], 2); +(_a = array0, _i = ++i0, _a[_i] = Math.pow(_a[_i], 2)); var array1 = [1, 2, 3]; var i1 = 0; -_b = array1, _c = ++i1, _b[_c] = Math.pow(_b[_c], (_d = array1, _e = ++i1, _d[_e] = Math.pow(_d[_e], 2))); +(_b = array1, _c = ++i1, _b[_c] = Math.pow(_b[_c], (_d = array1, _e = ++i1, _d[_e] = Math.pow(_d[_e], 2)))); var array2 = [1, 2, 3]; var i2 = 0; -_f = array2, _g = ++i2, _f[_g] = Math.pow(_f[_g], Math.pow(array2[++i2], 2)); +(_f = array2, _g = ++i2, _f[_g] = Math.pow(_f[_g], Math.pow(array2[++i2], 2))); var array3 = [2, 2, 3]; var j0 = 0, j1 = 1; -_h = array3, _j = j0++, _h[_j] = Math.pow(_h[_j], (_k = array3, _l = j1++, _k[_l] = Math.pow(_k[_l], (_m = array3, _o = j0++, _m[_o] = Math.pow(_m[_o], 1))))); +(_h = array3, _j = j0++, _h[_j] = Math.pow(_h[_j], (_k = array3, _l = j1++, _k[_l] = Math.pow(_k[_l], (_m = array3, _o = j0++, _m[_o] = Math.pow(_m[_o], 1)))))); var _a, _i, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js index e2392e4074bef..83e0b2473e8cf 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js @@ -17,10 +17,10 @@ function foo() { globalCounter += 1; return { 0: 2 }; } -_a = foo(), _a[0] = Math.pow(_a[0], foo()[0]); +(_a = foo(), _a[0] = Math.pow(_a[0], foo()[0])); var result_foo1 = (_b = foo(), _b[0] = Math.pow(_b[0], foo()[0])); -_c = foo(), _c[0] = Math.pow(_c[0], (_d = foo(), _d[0] = Math.pow(_d[0], 2))); +(_c = foo(), _c[0] = Math.pow(_c[0], (_d = foo(), _d[0] = Math.pow(_d[0], 2)))); var result_foo2 = (_e = foo(), _e[0] = Math.pow(_e[0], (_f = foo(), _f[0] = Math.pow(_f[0], 2)))); -_g = foo(), _g[0] = Math.pow(_g[0], Math.pow(foo()[0], 2)); +(_g = foo(), _g[0] = Math.pow(_g[0], Math.pow(foo()[0], 2))); var result_foo3 = (_h = foo(), _h[0] = Math.pow(_h[0], Math.pow(foo()[0], 2))); var _a, _b, _c, _d, _e, _f, _g, _h; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js index b4b8a8a1b1fe2..797ccccc33132 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js @@ -23,7 +23,7 @@ var object = { this._0 = x; }, }; -_a = object, _a[0] = Math.pow(_a[0], object[0]); -_b = object, _b[0] = Math.pow(_b[0], (_c = object, _c[0] = Math.pow(_c[0], 2))); -_d = object, _d[0] = Math.pow(_d[0], Math.pow(object[0], 2)); +(_a = object, _a[0] = Math.pow(_a[0], object[0])); +(_b = object, _b[0] = Math.pow(_b[0], (_c = object, _c[0] = Math.pow(_c[0], 2)))); +(_d = object, _d[0] = Math.pow(_d[0], Math.pow(object[0], 2))); var _a, _b, _c, _d; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js index 001f970b0d363..f61693f192cf4 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.js @@ -23,7 +23,7 @@ function incrementIdx(max) { return idx; } var array1 = [1, 2, 3, 4, 5]; -_a = array1, _i = incrementIdx(array1.length), _a[_i] = Math.pow(_a[_i], 3); -_b = array1, _c = incrementIdx(array1.length), _b[_c] = Math.pow(_b[_c], (_d = array1, _e = incrementIdx(array1.length), _d[_e] = Math.pow(_d[_e], 2))); -_f = array1, _g = incrementIdx(array1.length), _f[_g] = Math.pow(_f[_g], Math.pow(array1[incrementIdx(array1.length)], 2)); +(_a = array1, _i = incrementIdx(array1.length), _a[_i] = Math.pow(_a[_i], 3)); +(_b = array1, _c = incrementIdx(array1.length), _b[_c] = Math.pow(_b[_c], (_d = array1, _e = incrementIdx(array1.length), _d[_e] = Math.pow(_d[_e], 2)))); +(_f = array1, _g = incrementIdx(array1.length), _f[_g] = Math.pow(_f[_g], Math.pow(array1[incrementIdx(array1.length)], 2))); var _a, _i, _b, _c, _d, _e, _f, _g; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js index 5f51b432e20c4..99204e6362c6d 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.js @@ -18,10 +18,10 @@ function foo() { globalCounter += 1; return { prop: 2 }; } -_a = foo(), _a.prop = Math.pow(_a.prop, 2); +(_a = foo(), _a.prop = Math.pow(_a.prop, 2)); var result0 = (_b = foo(), _b.prop = Math.pow(_b.prop, 2)); -_c = foo(), _c.prop = Math.pow(_c.prop, (_d = foo(), _d.prop = Math.pow(_d.prop, 2))); +(_c = foo(), _c.prop = Math.pow(_c.prop, (_d = foo(), _d.prop = Math.pow(_d.prop, 2)))); var result1 = (_e = foo(), _e.prop = Math.pow(_e.prop, (_f = foo(), _f.prop = Math.pow(_f.prop, 2)))); -_g = foo(), _g.prop = Math.pow(_g.prop, Math.pow(foo().prop, 2)); +(_g = foo(), _g.prop = Math.pow(_g.prop, Math.pow(foo().prop, 2))); var result2 = (_h = foo(), _h.prop = Math.pow(_h.prop, Math.pow(foo().prop, 2))); var _a, _b, _c, _d, _e, _f, _g, _h; From 5e921c1d8dbb595bf7e7feac22999ce4517e2d6a Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 8 Oct 2015 17:12:22 -0700 Subject: [PATCH 35/39] Address PR feedback, remove scriptTarget ES7 --- src/compiler/commandLineParser.ts | 2 +- .../diagnosticInformationMap.generated.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- src/compiler/emitter.ts | 5 +- src/compiler/types.ts | 1 - src/harness/harness.ts | 11 +- .../emitCompoundExponentiationOperator1ES7.js | 43 --- ...CompoundExponentiationOperator1ES7.symbols | 83 ----- ...itCompoundExponentiationOperator1ES7.types | 171 --------- .../emitCompoundExponentiationOperator2ES7.js | 47 --- ...CompoundExponentiationOperator2ES7.symbols | 76 ---- ...itCompoundExponentiationOperator2ES7.types | 185 ---------- .../emitExponentiationOperator1ES7.js | 62 ---- .../emitExponentiationOperator1ES7.symbols | 34 -- .../emitExponentiationOperator1ES7.types | 207 ----------- .../emitExponentiationOperator2ES7.js | 104 ------ .../emitExponentiationOperator2ES7.symbols | 152 -------- .../emitExponentiationOperator2ES7.types | 344 ------------------ .../emitExponentiationOperator3ES7.js | 78 ---- .../emitExponentiationOperator3ES7.symbols | 107 ------ .../emitExponentiationOperator3ES7.types | 314 ---------------- .../emitExponentiationOperator4ES7.js | 70 ---- .../emitExponentiationOperator4ES7.symbols | 84 ----- .../emitExponentiationOperator4ES7.types | 260 ------------- ...onentiationOperatorSyntaxError2.errors.txt | 20 +- .../emitCompoundExponentiationOperator1ES7.ts | 22 -- .../emitCompoundExponentiationOperator2ES7.ts | 25 -- .../emitExponentiationOperator1ES7.ts | 33 -- .../emitExponentiationOperator2ES7.ts | 56 --- .../emitExponentiationOperator3ES7.ts | 40 -- .../emitExponentiationOperator4ES7.ts | 38 -- 31 files changed, 16 insertions(+), 2662 deletions(-) delete mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js delete mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols delete mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types delete mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js delete mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols delete mode 100644 tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types delete mode 100644 tests/baselines/reference/emitExponentiationOperator1ES7.js delete mode 100644 tests/baselines/reference/emitExponentiationOperator1ES7.symbols delete mode 100644 tests/baselines/reference/emitExponentiationOperator1ES7.types delete mode 100644 tests/baselines/reference/emitExponentiationOperator2ES7.js delete mode 100644 tests/baselines/reference/emitExponentiationOperator2ES7.symbols delete mode 100644 tests/baselines/reference/emitExponentiationOperator2ES7.types delete mode 100644 tests/baselines/reference/emitExponentiationOperator3ES7.js delete mode 100644 tests/baselines/reference/emitExponentiationOperator3ES7.symbols delete mode 100644 tests/baselines/reference/emitExponentiationOperator3ES7.types delete mode 100644 tests/baselines/reference/emitExponentiationOperator4ES7.js delete mode 100644 tests/baselines/reference/emitExponentiationOperator4ES7.symbols delete mode 100644 tests/baselines/reference/emitExponentiationOperator4ES7.types delete mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts delete mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts delete mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts delete mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts delete mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts delete mode 100644 tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index f63cb36f9ec94..1670251973ab1 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -204,7 +204,7 @@ namespace ts { { name: "target", shortName: "t", - type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6, "es7": ScriptTarget.ES7 }, + type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 }, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: Diagnostics.VERSION, error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 7af1afb251aac..103b29b20fbe6 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -619,6 +619,6 @@ namespace ts { Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: DiagnosticCategory.Error, key: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor cannot contain a 'super' call when its class extends 'null'" }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: DiagnosticCategory.Error, key: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 59a494629e4d2..5298d123299bb 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2473,6 +2473,6 @@ }, "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { "category": "Error", - "code": 17006 + "code": 17007 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 467b3a4d5367a..a4ff544a132db 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -836,8 +836,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } let node = nodes[start + i]; - let leadingComments = getLeadingCommentsToEmit(node); - let trailingComments = getTrailingCommentRanges(currentSourceFile.text, node.pos); // This emitting is to make sure we emit following comment properly // ...(x, /*comment1*/ y)... // ^ => node.pos @@ -2587,7 +2585,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`", `); } - if (languageVersion < ScriptTarget.ES7 && (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken || node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken)) { + if (node.operatorToken.kind === SyntaxKind.AsteriskAsteriskToken || node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { + // Downleveled emit exponentiation operator using Math.pow emitExponentiationOperator(node); } else { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2b8c2624819a2..67d93f9c50e81 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2107,7 +2107,6 @@ namespace ts { ES3 = 0, ES5 = 1, ES6 = 2, - ES7 = 3, Latest = ES6, } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f149ceeb26816..57eb848ac23ae 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -932,16 +932,7 @@ module Harness { } else { if (fn === defaultLibFileName) { - switch (languageVersion) { - case ts.ScriptTarget.ES6: - case ts.ScriptTarget.ES7: - // TODO : Update to use ES7 specific lib file - return defaultES6LibSourceFile; - case ts.ScriptTarget.ES3: - case ts.ScriptTarget.ES5: - default: - return defaultLibSourceFile; - } + return languageVersion === ts.ScriptTarget.ES6 ? defaultES6LibSourceFile : defaultLibSourceFile; } // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC return undefined; diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js deleted file mode 100644 index a1039555694cc..0000000000000 --- a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.js +++ /dev/null @@ -1,43 +0,0 @@ -//// [emitCompoundExponentiationOperator1ES7.ts] - -var comp: number; - -comp **= 1; -comp **= comp ** comp; -comp **= comp ** comp ** 2; -comp **= comp ** comp + 2; -comp **= comp ** comp - 2; -comp **= comp ** comp * 2; -comp **= comp ** comp / 2; -comp **= comp ** comp % 2; -comp **= (comp - 2) ** 5; -comp **= (comp + 2) ** 5; -comp **= (comp * 2) ** 5; -comp **= (comp / 2) ** 5; -comp **= (comp % 2) ** 5; -comp **= comp ** (5 + 2); -comp **= comp ** (5 - 2); -comp **= comp ** (5 * 2); -comp **= comp ** (5 / 2); -comp **= comp ** (5 % 2); - -//// [emitCompoundExponentiationOperator1ES7.js] -var comp; -comp **= 1; -comp **= comp ** comp; -comp **= comp ** comp ** 2; -comp **= comp ** comp + 2; -comp **= comp ** comp - 2; -comp **= comp ** comp * 2; -comp **= comp ** comp / 2; -comp **= comp ** comp % 2; -comp **= (comp - 2) ** 5; -comp **= (comp + 2) ** 5; -comp **= (comp * 2) ** 5; -comp **= (comp / 2) ** 5; -comp **= (comp % 2) ** 5; -comp **= comp ** (5 + 2); -comp **= comp ** (5 - 2); -comp **= comp ** (5 * 2); -comp **= comp ** (5 / 2); -comp **= comp ** (5 % 2); diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols deleted file mode 100644 index 07037222df828..0000000000000 --- a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.symbols +++ /dev/null @@ -1,83 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts === - -var comp: number; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= 1; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp ** 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp + 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp - 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp * 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp / 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** comp % 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= (comp - 2) ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= (comp + 2) ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= (comp * 2) ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= (comp / 2) ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= (comp % 2) ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** (5 + 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** (5 - 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** (5 * 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** (5 / 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - -comp **= comp ** (5 % 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator1ES7.ts, 1, 3)) - diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types b/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types deleted file mode 100644 index 6937e381a2262..0000000000000 --- a/tests/baselines/reference/emitCompoundExponentiationOperator1ES7.types +++ /dev/null @@ -1,171 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts === - -var comp: number; ->comp : number - -comp **= 1; ->comp **= 1 : number ->comp : number ->1 : number - -comp **= comp ** comp; ->comp **= comp ** comp : number ->comp : number ->comp ** comp : number ->comp : number ->comp : number - -comp **= comp ** comp ** 2; ->comp **= comp ** comp ** 2 : number ->comp : number ->comp ** comp ** 2 : number ->comp : number ->comp ** 2 : number ->comp : number ->2 : number - -comp **= comp ** comp + 2; ->comp **= comp ** comp + 2 : number ->comp : number ->comp ** comp + 2 : number ->comp ** comp : number ->comp : number ->comp : number ->2 : number - -comp **= comp ** comp - 2; ->comp **= comp ** comp - 2 : number ->comp : number ->comp ** comp - 2 : number ->comp ** comp : number ->comp : number ->comp : number ->2 : number - -comp **= comp ** comp * 2; ->comp **= comp ** comp * 2 : number ->comp : number ->comp ** comp * 2 : number ->comp ** comp : number ->comp : number ->comp : number ->2 : number - -comp **= comp ** comp / 2; ->comp **= comp ** comp / 2 : number ->comp : number ->comp ** comp / 2 : number ->comp ** comp : number ->comp : number ->comp : number ->2 : number - -comp **= comp ** comp % 2; ->comp **= comp ** comp % 2 : number ->comp : number ->comp ** comp % 2 : number ->comp ** comp : number ->comp : number ->comp : number ->2 : number - -comp **= (comp - 2) ** 5; ->comp **= (comp - 2) ** 5 : number ->comp : number ->(comp - 2) ** 5 : number ->(comp - 2) : number ->comp - 2 : number ->comp : number ->2 : number ->5 : number - -comp **= (comp + 2) ** 5; ->comp **= (comp + 2) ** 5 : number ->comp : number ->(comp + 2) ** 5 : number ->(comp + 2) : number ->comp + 2 : number ->comp : number ->2 : number ->5 : number - -comp **= (comp * 2) ** 5; ->comp **= (comp * 2) ** 5 : number ->comp : number ->(comp * 2) ** 5 : number ->(comp * 2) : number ->comp * 2 : number ->comp : number ->2 : number ->5 : number - -comp **= (comp / 2) ** 5; ->comp **= (comp / 2) ** 5 : number ->comp : number ->(comp / 2) ** 5 : number ->(comp / 2) : number ->comp / 2 : number ->comp : number ->2 : number ->5 : number - -comp **= (comp % 2) ** 5; ->comp **= (comp % 2) ** 5 : number ->comp : number ->(comp % 2) ** 5 : number ->(comp % 2) : number ->comp % 2 : number ->comp : number ->2 : number ->5 : number - -comp **= comp ** (5 + 2); ->comp **= comp ** (5 + 2) : number ->comp : number ->comp ** (5 + 2) : number ->comp : number ->(5 + 2) : number ->5 + 2 : number ->5 : number ->2 : number - -comp **= comp ** (5 - 2); ->comp **= comp ** (5 - 2) : number ->comp : number ->comp ** (5 - 2) : number ->comp : number ->(5 - 2) : number ->5 - 2 : number ->5 : number ->2 : number - -comp **= comp ** (5 * 2); ->comp **= comp ** (5 * 2) : number ->comp : number ->comp ** (5 * 2) : number ->comp : number ->(5 * 2) : number ->5 * 2 : number ->5 : number ->2 : number - -comp **= comp ** (5 / 2); ->comp **= comp ** (5 / 2) : number ->comp : number ->comp ** (5 / 2) : number ->comp : number ->(5 / 2) : number ->5 / 2 : number ->5 : number ->2 : number - -comp **= comp ** (5 % 2); ->comp **= comp ** (5 % 2) : number ->comp : number ->comp ** (5 % 2) : number ->comp : number ->(5 % 2) : number ->5 % 2 : number ->5 : number ->2 : number - diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js deleted file mode 100644 index ac504150becd3..0000000000000 --- a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.js +++ /dev/null @@ -1,47 +0,0 @@ -//// [emitCompoundExponentiationOperator2ES7.ts] - -var comp: number; - -comp **= 1; -comp **= comp **= 1; -comp **= comp **= 1 + 2; -comp **= comp **= 1 - 2; -comp **= comp **= 1 * 2; -comp **= comp **= 1 / 2; - -comp **= comp **= (1 + 2); -comp **= comp **= (1 - 2); -comp **= comp **= (1 * 2); -comp **= comp **= (1 / 2); - -comp **= comp **= 1 + 2 ** 3; -comp **= comp **= 1 - 2 ** 4; -comp **= comp **= 1 * 2 ** 5; -comp **= comp **= 1 / 2 ** 6; - -comp **= comp **= (1 + 2) ** 3; -comp **= comp **= (1 - 2) ** 4; -comp **= comp **= (1 * 2) ** 5; -comp **= comp **= (1 / 2) ** 6; - - -//// [emitCompoundExponentiationOperator2ES7.js] -var comp; -comp **= 1; -comp **= comp **= 1; -comp **= comp **= 1 + 2; -comp **= comp **= 1 - 2; -comp **= comp **= 1 * 2; -comp **= comp **= 1 / 2; -comp **= comp **= (1 + 2); -comp **= comp **= (1 - 2); -comp **= comp **= (1 * 2); -comp **= comp **= (1 / 2); -comp **= comp **= 1 + 2 ** 3; -comp **= comp **= 1 - 2 ** 4; -comp **= comp **= 1 * 2 ** 5; -comp **= comp **= 1 / 2 ** 6; -comp **= comp **= (1 + 2) ** 3; -comp **= comp **= (1 - 2) ** 4; -comp **= comp **= (1 * 2) ** 5; -comp **= comp **= (1 / 2) ** 6; diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols deleted file mode 100644 index b3e56cbdbaea0..0000000000000 --- a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.symbols +++ /dev/null @@ -1,76 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts === - -var comp: number; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= 1; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 + 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 - 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 * 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 / 2; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 + 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 - 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 * 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 / 2); ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 + 2 ** 3; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 - 2 ** 4; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 * 2 ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= 1 / 2 ** 6; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 + 2) ** 3; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 - 2) ** 4; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 * 2) ** 5; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - -comp **= comp **= (1 / 2) ** 6; ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) ->comp : Symbol(comp, Decl(emitCompoundExponentiationOperator2ES7.ts, 1, 3)) - diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types b/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types deleted file mode 100644 index 97a61ec4af4ca..0000000000000 --- a/tests/baselines/reference/emitCompoundExponentiationOperator2ES7.types +++ /dev/null @@ -1,185 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts === - -var comp: number; ->comp : number - -comp **= 1; ->comp **= 1 : number ->comp : number ->1 : number - -comp **= comp **= 1; ->comp **= comp **= 1 : number ->comp : number ->comp **= 1 : number ->comp : number ->1 : number - -comp **= comp **= 1 + 2; ->comp **= comp **= 1 + 2 : number ->comp : number ->comp **= 1 + 2 : number ->comp : number ->1 + 2 : number ->1 : number ->2 : number - -comp **= comp **= 1 - 2; ->comp **= comp **= 1 - 2 : number ->comp : number ->comp **= 1 - 2 : number ->comp : number ->1 - 2 : number ->1 : number ->2 : number - -comp **= comp **= 1 * 2; ->comp **= comp **= 1 * 2 : number ->comp : number ->comp **= 1 * 2 : number ->comp : number ->1 * 2 : number ->1 : number ->2 : number - -comp **= comp **= 1 / 2; ->comp **= comp **= 1 / 2 : number ->comp : number ->comp **= 1 / 2 : number ->comp : number ->1 / 2 : number ->1 : number ->2 : number - -comp **= comp **= (1 + 2); ->comp **= comp **= (1 + 2) : number ->comp : number ->comp **= (1 + 2) : number ->comp : number ->(1 + 2) : number ->1 + 2 : number ->1 : number ->2 : number - -comp **= comp **= (1 - 2); ->comp **= comp **= (1 - 2) : number ->comp : number ->comp **= (1 - 2) : number ->comp : number ->(1 - 2) : number ->1 - 2 : number ->1 : number ->2 : number - -comp **= comp **= (1 * 2); ->comp **= comp **= (1 * 2) : number ->comp : number ->comp **= (1 * 2) : number ->comp : number ->(1 * 2) : number ->1 * 2 : number ->1 : number ->2 : number - -comp **= comp **= (1 / 2); ->comp **= comp **= (1 / 2) : number ->comp : number ->comp **= (1 / 2) : number ->comp : number ->(1 / 2) : number ->1 / 2 : number ->1 : number ->2 : number - -comp **= comp **= 1 + 2 ** 3; ->comp **= comp **= 1 + 2 ** 3 : number ->comp : number ->comp **= 1 + 2 ** 3 : number ->comp : number ->1 + 2 ** 3 : number ->1 : number ->2 ** 3 : number ->2 : number ->3 : number - -comp **= comp **= 1 - 2 ** 4; ->comp **= comp **= 1 - 2 ** 4 : number ->comp : number ->comp **= 1 - 2 ** 4 : number ->comp : number ->1 - 2 ** 4 : number ->1 : number ->2 ** 4 : number ->2 : number ->4 : number - -comp **= comp **= 1 * 2 ** 5; ->comp **= comp **= 1 * 2 ** 5 : number ->comp : number ->comp **= 1 * 2 ** 5 : number ->comp : number ->1 * 2 ** 5 : number ->1 : number ->2 ** 5 : number ->2 : number ->5 : number - -comp **= comp **= 1 / 2 ** 6; ->comp **= comp **= 1 / 2 ** 6 : number ->comp : number ->comp **= 1 / 2 ** 6 : number ->comp : number ->1 / 2 ** 6 : number ->1 : number ->2 ** 6 : number ->2 : number ->6 : number - -comp **= comp **= (1 + 2) ** 3; ->comp **= comp **= (1 + 2) ** 3 : number ->comp : number ->comp **= (1 + 2) ** 3 : number ->comp : number ->(1 + 2) ** 3 : number ->(1 + 2) : number ->1 + 2 : number ->1 : number ->2 : number ->3 : number - -comp **= comp **= (1 - 2) ** 4; ->comp **= comp **= (1 - 2) ** 4 : number ->comp : number ->comp **= (1 - 2) ** 4 : number ->comp : number ->(1 - 2) ** 4 : number ->(1 - 2) : number ->1 - 2 : number ->1 : number ->2 : number ->4 : number - -comp **= comp **= (1 * 2) ** 5; ->comp **= comp **= (1 * 2) ** 5 : number ->comp : number ->comp **= (1 * 2) ** 5 : number ->comp : number ->(1 * 2) ** 5 : number ->(1 * 2) : number ->1 * 2 : number ->1 : number ->2 : number ->5 : number - -comp **= comp **= (1 / 2) ** 6; ->comp **= comp **= (1 / 2) ** 6 : number ->comp : number ->comp **= (1 / 2) ** 6 : number ->comp : number ->(1 / 2) ** 6 : number ->(1 / 2) : number ->1 / 2 : number ->1 : number ->2 : number ->6 : number - diff --git a/tests/baselines/reference/emitExponentiationOperator1ES7.js b/tests/baselines/reference/emitExponentiationOperator1ES7.js deleted file mode 100644 index f9e4924d4b520..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator1ES7.js +++ /dev/null @@ -1,62 +0,0 @@ -//// [emitExponentiationOperator1ES7.ts] - -1 ** -2; -1 ** 2; -(-1) ** 2 -1 ** 2 ** 3; -1 ** 2 ** -3; -1 ** -(2 ** 3); -(-(1 ** 2)) ** 3; -(-(1 ** 2)) ** -3; - -1 ** 2 + 3; -1 ** 2 - 3; -1 ** 2 * 3; -1 ** 2 / 3; -1 ** 2 % 3; - -1 ** -2 + 3; -1 ** -2 - 3; -1 ** -2 * 3; -1 ** -2 / 3; -1 ** -2 % 3; - -2 + 3 ** 3; -2 - 3 ** 3; -2 * 3 ** 3; -2 / 3 ** 3; -2 % 3 ** 3; - -(2 + 3) ** 4; -(2 - 3) ** 4; -(2 * 3) ** 4; -(2 / 3) ** 4; - -//// [emitExponentiationOperator1ES7.js] -1 ** -2; -1 ** 2; -(-1) ** 2; -1 ** 2 ** 3; -1 ** 2 ** -3; -1 ** -(2 ** 3); -(-(1 ** 2)) ** 3; -(-(1 ** 2)) ** -3; -1 ** 2 + 3; -1 ** 2 - 3; -1 ** 2 * 3; -1 ** 2 / 3; -1 ** 2 % 3; -1 ** -2 + 3; -1 ** -2 - 3; -1 ** -2 * 3; -1 ** -2 / 3; -1 ** -2 % 3; -2 + 3 ** 3; -2 - 3 ** 3; -2 * 3 ** 3; -2 / 3 ** 3; -2 % 3 ** 3; -(2 + 3) ** 4; -(2 - 3) ** 4; -(2 * 3) ** 4; -(2 / 3) ** 4; diff --git a/tests/baselines/reference/emitExponentiationOperator1ES7.symbols b/tests/baselines/reference/emitExponentiationOperator1ES7.symbols deleted file mode 100644 index c0cc50e70837d..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator1ES7.symbols +++ /dev/null @@ -1,34 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts === - -No type information for this code.1 ** -2; -No type information for this code.1 ** 2; -No type information for this code.(-1) ** 2 -No type information for this code.1 ** 2 ** 3; -No type information for this code.1 ** 2 ** -3; -No type information for this code.1 ** -(2 ** 3); -No type information for this code.(-(1 ** 2)) ** 3; -No type information for this code.(-(1 ** 2)) ** -3; -No type information for this code. -No type information for this code.1 ** 2 + 3; -No type information for this code.1 ** 2 - 3; -No type information for this code.1 ** 2 * 3; -No type information for this code.1 ** 2 / 3; -No type information for this code.1 ** 2 % 3; -No type information for this code. -No type information for this code.1 ** -2 + 3; -No type information for this code.1 ** -2 - 3; -No type information for this code.1 ** -2 * 3; -No type information for this code.1 ** -2 / 3; -No type information for this code.1 ** -2 % 3; -No type information for this code. -No type information for this code.2 + 3 ** 3; -No type information for this code.2 - 3 ** 3; -No type information for this code.2 * 3 ** 3; -No type information for this code.2 / 3 ** 3; -No type information for this code.2 % 3 ** 3; -No type information for this code. -No type information for this code.(2 + 3) ** 4; -No type information for this code.(2 - 3) ** 4; -No type information for this code.(2 * 3) ** 4; -No type information for this code.(2 / 3) ** 4; -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emitExponentiationOperator1ES7.types b/tests/baselines/reference/emitExponentiationOperator1ES7.types deleted file mode 100644 index 067d992c446d7..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator1ES7.types +++ /dev/null @@ -1,207 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts === - -1 ** -2; ->1 ** -2 : number ->1 : number ->-2 : number ->2 : number - -1 ** 2; ->1 ** 2 : number ->1 : number ->2 : number - -(-1) ** 2 ->(-1) ** 2 : number ->(-1) : number ->-1 : number ->1 : number ->2 : number - -1 ** 2 ** 3; ->1 ** 2 ** 3 : number ->1 : number ->2 ** 3 : number ->2 : number ->3 : number - -1 ** 2 ** -3; ->1 ** 2 ** -3 : number ->1 : number ->2 ** -3 : number ->2 : number ->-3 : number ->3 : number - -1 ** -(2 ** 3); ->1 ** -(2 ** 3) : number ->1 : number ->-(2 ** 3) : number ->(2 ** 3) : number ->2 ** 3 : number ->2 : number ->3 : number - -(-(1 ** 2)) ** 3; ->(-(1 ** 2)) ** 3 : number ->(-(1 ** 2)) : number ->-(1 ** 2) : number ->(1 ** 2) : number ->1 ** 2 : number ->1 : number ->2 : number ->3 : number - -(-(1 ** 2)) ** -3; ->(-(1 ** 2)) ** -3 : number ->(-(1 ** 2)) : number ->-(1 ** 2) : number ->(1 ** 2) : number ->1 ** 2 : number ->1 : number ->2 : number ->-3 : number ->3 : number - -1 ** 2 + 3; ->1 ** 2 + 3 : number ->1 ** 2 : number ->1 : number ->2 : number ->3 : number - -1 ** 2 - 3; ->1 ** 2 - 3 : number ->1 ** 2 : number ->1 : number ->2 : number ->3 : number - -1 ** 2 * 3; ->1 ** 2 * 3 : number ->1 ** 2 : number ->1 : number ->2 : number ->3 : number - -1 ** 2 / 3; ->1 ** 2 / 3 : number ->1 ** 2 : number ->1 : number ->2 : number ->3 : number - -1 ** 2 % 3; ->1 ** 2 % 3 : number ->1 ** 2 : number ->1 : number ->2 : number ->3 : number - -1 ** -2 + 3; ->1 ** -2 + 3 : number ->1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number - -1 ** -2 - 3; ->1 ** -2 - 3 : number ->1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number - -1 ** -2 * 3; ->1 ** -2 * 3 : number ->1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number - -1 ** -2 / 3; ->1 ** -2 / 3 : number ->1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number - -1 ** -2 % 3; ->1 ** -2 % 3 : number ->1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number - -2 + 3 ** 3; ->2 + 3 ** 3 : number ->2 : number ->3 ** 3 : number ->3 : number ->3 : number - -2 - 3 ** 3; ->2 - 3 ** 3 : number ->2 : number ->3 ** 3 : number ->3 : number ->3 : number - -2 * 3 ** 3; ->2 * 3 ** 3 : number ->2 : number ->3 ** 3 : number ->3 : number ->3 : number - -2 / 3 ** 3; ->2 / 3 ** 3 : number ->2 : number ->3 ** 3 : number ->3 : number ->3 : number - -2 % 3 ** 3; ->2 % 3 ** 3 : number ->2 : number ->3 ** 3 : number ->3 : number ->3 : number - -(2 + 3) ** 4; ->(2 + 3) ** 4 : number ->(2 + 3) : number ->2 + 3 : number ->2 : number ->3 : number ->4 : number - -(2 - 3) ** 4; ->(2 - 3) ** 4 : number ->(2 - 3) : number ->2 - 3 : number ->2 : number ->3 : number ->4 : number - -(2 * 3) ** 4; ->(2 * 3) ** 4 : number ->(2 * 3) : number ->2 * 3 : number ->2 : number ->3 : number ->4 : number - -(2 / 3) ** 4; ->(2 / 3) ** 4 : number ->(2 / 3) : number ->2 / 3 : number ->2 : number ->3 : number ->4 : number - diff --git a/tests/baselines/reference/emitExponentiationOperator2ES7.js b/tests/baselines/reference/emitExponentiationOperator2ES7.js deleted file mode 100644 index 89cef39ebf3d0..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator2ES7.js +++ /dev/null @@ -1,104 +0,0 @@ -//// [emitExponentiationOperator2ES7.ts] - -var temp = 10; - -++temp ** 3; ---temp ** 3; -temp++ ** 3; -temp-- ** 3; ---temp + temp ** 3; ---temp - temp ** 3; ---temp * temp ** 3; ---temp / temp ** 3; ---temp % temp ** 3; -temp-- ** 3; -temp++ ** 3; -temp-- ** -temp; -temp++ ** +temp; - -temp-- + temp ** 3; -temp-- - temp ** 3; -temp-- * temp ** 3; -temp-- / temp ** 3; -temp-- % temp ** 3; - ---temp + 2 ** 3; ---temp - 2 ** 3; ---temp * 2 ** 3; ---temp / 2 ** 3; ---temp % 2 ** 3; - -++temp + 2 ** 3; -++temp - 2 ** 3; -++temp * 2 ** 3; -++temp / 2 ** 3; - -3 ** ++temp; -3 ** --temp; -3 ** temp++; -3 ** temp--; - -3 ** ++temp ** 2; -3 ** --temp ** 2; -3 ** temp++ ** 2; -3 ** temp-- ** 2; - -3 ** ++temp + 2; -3 ** ++temp - 2; -3 ** ++temp * 2; -3 ** ++temp / 2; -3 ** ++temp % 2; - -3 ** --temp + 2; -3 ** --temp - 2; -3 ** --temp * 2; -3 ** --temp / 2; -3 ** --temp % 2; - -//// [emitExponentiationOperator2ES7.js] -var temp = 10; -++temp ** 3; ---temp ** 3; -temp++ ** 3; -temp-- ** 3; ---temp + temp ** 3; ---temp - temp ** 3; ---temp * temp ** 3; ---temp / temp ** 3; ---temp % temp ** 3; -temp-- ** 3; -temp++ ** 3; -temp-- ** -temp; -temp++ ** +temp; -temp-- + temp ** 3; -temp-- - temp ** 3; -temp-- * temp ** 3; -temp-- / temp ** 3; -temp-- % temp ** 3; ---temp + 2 ** 3; ---temp - 2 ** 3; ---temp * 2 ** 3; ---temp / 2 ** 3; ---temp % 2 ** 3; -++temp + 2 ** 3; -++temp - 2 ** 3; -++temp * 2 ** 3; -++temp / 2 ** 3; -3 ** ++temp; -3 ** --temp; -3 ** temp++; -3 ** temp--; -3 ** ++temp ** 2; -3 ** --temp ** 2; -3 ** temp++ ** 2; -3 ** temp-- ** 2; -3 ** ++temp + 2; -3 ** ++temp - 2; -3 ** ++temp * 2; -3 ** ++temp / 2; -3 ** ++temp % 2; -3 ** --temp + 2; -3 ** --temp - 2; -3 ** --temp * 2; -3 ** --temp / 2; -3 ** --temp % 2; diff --git a/tests/baselines/reference/emitExponentiationOperator2ES7.symbols b/tests/baselines/reference/emitExponentiationOperator2ES7.symbols deleted file mode 100644 index 0e0ce52a297ab..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator2ES7.symbols +++ /dev/null @@ -1,152 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts === - -var temp = 10; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -++temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp++ ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp + temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp - temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp * temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp / temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp % temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp++ ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- ** -temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp++ ** +temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- + temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- - temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- * temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- / temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -temp-- % temp ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp + 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp - 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp * 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp / 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - ---temp % 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -++temp + 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -++temp - 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -++temp * 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -++temp / 2 ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** temp++; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** temp--; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** temp++ ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** temp-- ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp + 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp - 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp * 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp / 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** ++temp % 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp + 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp - 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp * 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp / 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - -3 ** --temp % 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator2ES7.ts, 1, 3)) - diff --git a/tests/baselines/reference/emitExponentiationOperator2ES7.types b/tests/baselines/reference/emitExponentiationOperator2ES7.types deleted file mode 100644 index 73fe09c6d8753..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator2ES7.types +++ /dev/null @@ -1,344 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts === - -var temp = 10; ->temp : number ->10 : number - -++temp ** 3; ->++temp ** 3 : number ->++temp : number ->temp : number ->3 : number - ---temp ** 3; ->--temp ** 3 : number ->--temp : number ->temp : number ->3 : number - -temp++ ** 3; ->temp++ ** 3 : number ->temp++ : number ->temp : number ->3 : number - -temp-- ** 3; ->temp-- ** 3 : number ->temp-- : number ->temp : number ->3 : number - ---temp + temp ** 3; ->--temp + temp ** 3 : number ->--temp : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - ---temp - temp ** 3; ->--temp - temp ** 3 : number ->--temp : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - ---temp * temp ** 3; ->--temp * temp ** 3 : number ->--temp : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - ---temp / temp ** 3; ->--temp / temp ** 3 : number ->--temp : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - ---temp % temp ** 3; ->--temp % temp ** 3 : number ->--temp : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - -temp-- ** 3; ->temp-- ** 3 : number ->temp-- : number ->temp : number ->3 : number - -temp++ ** 3; ->temp++ ** 3 : number ->temp++ : number ->temp : number ->3 : number - -temp-- ** -temp; ->temp-- ** -temp : number ->temp-- : number ->temp : number ->-temp : number ->temp : number - -temp++ ** +temp; ->temp++ ** +temp : number ->temp++ : number ->temp : number ->+temp : number ->temp : number - -temp-- + temp ** 3; ->temp-- + temp ** 3 : number ->temp-- : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - -temp-- - temp ** 3; ->temp-- - temp ** 3 : number ->temp-- : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - -temp-- * temp ** 3; ->temp-- * temp ** 3 : number ->temp-- : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - -temp-- / temp ** 3; ->temp-- / temp ** 3 : number ->temp-- : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - -temp-- % temp ** 3; ->temp-- % temp ** 3 : number ->temp-- : number ->temp : number ->temp ** 3 : number ->temp : number ->3 : number - ---temp + 2 ** 3; ->--temp + 2 ** 3 : number ->--temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - ---temp - 2 ** 3; ->--temp - 2 ** 3 : number ->--temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - ---temp * 2 ** 3; ->--temp * 2 ** 3 : number ->--temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - ---temp / 2 ** 3; ->--temp / 2 ** 3 : number ->--temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - ---temp % 2 ** 3; ->--temp % 2 ** 3 : number ->--temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - -++temp + 2 ** 3; ->++temp + 2 ** 3 : number ->++temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - -++temp - 2 ** 3; ->++temp - 2 ** 3 : number ->++temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - -++temp * 2 ** 3; ->++temp * 2 ** 3 : number ->++temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - -++temp / 2 ** 3; ->++temp / 2 ** 3 : number ->++temp : number ->temp : number ->2 ** 3 : number ->2 : number ->3 : number - -3 ** ++temp; ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number - -3 ** --temp; ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number - -3 ** temp++; ->3 ** temp++ : number ->3 : number ->temp++ : number ->temp : number - -3 ** temp--; ->3 ** temp-- : number ->3 : number ->temp-- : number ->temp : number - -3 ** ++temp ** 2; ->3 ** ++temp ** 2 : number ->3 : number ->++temp ** 2 : number ->++temp : number ->temp : number ->2 : number - -3 ** --temp ** 2; ->3 ** --temp ** 2 : number ->3 : number ->--temp ** 2 : number ->--temp : number ->temp : number ->2 : number - -3 ** temp++ ** 2; ->3 ** temp++ ** 2 : number ->3 : number ->temp++ ** 2 : number ->temp++ : number ->temp : number ->2 : number - -3 ** temp-- ** 2; ->3 ** temp-- ** 2 : number ->3 : number ->temp-- ** 2 : number ->temp-- : number ->temp : number ->2 : number - -3 ** ++temp + 2; ->3 ** ++temp + 2 : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number ->2 : number - -3 ** ++temp - 2; ->3 ** ++temp - 2 : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number ->2 : number - -3 ** ++temp * 2; ->3 ** ++temp * 2 : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number ->2 : number - -3 ** ++temp / 2; ->3 ** ++temp / 2 : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number ->2 : number - -3 ** ++temp % 2; ->3 ** ++temp % 2 : number ->3 ** ++temp : number ->3 : number ->++temp : number ->temp : number ->2 : number - -3 ** --temp + 2; ->3 ** --temp + 2 : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number ->2 : number - -3 ** --temp - 2; ->3 ** --temp - 2 : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number ->2 : number - -3 ** --temp * 2; ->3 ** --temp * 2 : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number ->2 : number - -3 ** --temp / 2; ->3 ** --temp / 2 : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number ->2 : number - -3 ** --temp % 2; ->3 ** --temp % 2 : number ->3 ** --temp : number ->3 : number ->--temp : number ->temp : number ->2 : number - diff --git a/tests/baselines/reference/emitExponentiationOperator3ES7.js b/tests/baselines/reference/emitExponentiationOperator3ES7.js deleted file mode 100644 index 5d556c7f20efe..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator3ES7.js +++ /dev/null @@ -1,78 +0,0 @@ -//// [emitExponentiationOperator3ES7.ts] - -var temp = 10; - -(-++temp) ** 3; -(+--temp) ** 3; -(-temp++) ** 3; -(+temp--) ** 3; -(-(1 ** ++temp)) ** 3; -(-(1 ** --temp)) ** 3; -(-(1 ** temp++)) ** 3; -(-(1 ** temp--)) ** 3; - -(-3) ** temp++; -(-3) ** temp--; -(-3) ** ++temp; -(-3) ** --temp; -(+3) ** temp++; -(+3) ** temp--; -(+3) ** ++temp; -(+3) ** --temp; -(-3) ** temp++ ** 2; -(-3) ** temp-- ** 2; -(-3) ** ++temp ** 2; -(-3) ** --temp ** 2; -(+3) ** temp++ ** 2; -(+3) ** temp-- ** 2; -(+3) ** ++temp ** 2; -(+3) ** --temp ** 2; - -3 ** -temp++; -3 ** -temp--; -3 ** -++temp; -3 ** +--temp; -3 ** (-temp++) ** 2; -3 ** (-temp--) ** 2; -3 ** (+temp++) ** 2; -3 ** (+temp--) ** 2; -3 ** (-++temp) ** 2; -3 ** (+--temp) ** 2; - - -//// [emitExponentiationOperator3ES7.js] -var temp = 10; -(-++temp) ** 3; -(+--temp) ** 3; -(-temp++) ** 3; -(+temp--) ** 3; -(-(1 ** ++temp)) ** 3; -(-(1 ** --temp)) ** 3; -(-(1 ** temp++)) ** 3; -(-(1 ** temp--)) ** 3; -(-3) ** temp++; -(-3) ** temp--; -(-3) ** ++temp; -(-3) ** --temp; -(+3) ** temp++; -(+3) ** temp--; -(+3) ** ++temp; -(+3) ** --temp; -(-3) ** temp++ ** 2; -(-3) ** temp-- ** 2; -(-3) ** ++temp ** 2; -(-3) ** --temp ** 2; -(+3) ** temp++ ** 2; -(+3) ** temp-- ** 2; -(+3) ** ++temp ** 2; -(+3) ** --temp ** 2; -3 ** -temp++; -3 ** -temp--; -3 ** -++temp; -3 ** +--temp; -3 ** (-temp++) ** 2; -3 ** (-temp--) ** 2; -3 ** (+temp++) ** 2; -3 ** (+temp--) ** 2; -3 ** (-++temp) ** 2; -3 ** (+--temp) ** 2; diff --git a/tests/baselines/reference/emitExponentiationOperator3ES7.symbols b/tests/baselines/reference/emitExponentiationOperator3ES7.symbols deleted file mode 100644 index cd668fcf8b7b0..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator3ES7.symbols +++ /dev/null @@ -1,107 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts === - -var temp = 10; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-++temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+--temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-temp++) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-(1 ** ++temp)) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-(1 ** --temp)) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-(1 ** temp++)) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-(1 ** temp--)) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** temp++; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** temp--; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** ++temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** --temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** temp++; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** temp--; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** ++temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** --temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** temp++ ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** temp-- ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** ++temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(-3) ** --temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** temp++ ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** temp-- ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** ++temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -(+3) ** --temp ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** -temp++; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** -temp--; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** -++temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** +--temp; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** (-temp++) ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** (-temp--) ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** (+temp++) ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** (+temp--) ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** (-++temp) ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - -3 ** (+--temp) ** 2; ->temp : Symbol(temp, Decl(emitExponentiationOperator3ES7.ts, 1, 3)) - diff --git a/tests/baselines/reference/emitExponentiationOperator3ES7.types b/tests/baselines/reference/emitExponentiationOperator3ES7.types deleted file mode 100644 index 0585b282b0f9a..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator3ES7.types +++ /dev/null @@ -1,314 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts === - -var temp = 10; ->temp : number ->10 : number - -(-++temp) ** 3; ->(-++temp) ** 3 : number ->(-++temp) : number ->-++temp : number ->++temp : number ->temp : number ->3 : number - -(+--temp) ** 3; ->(+--temp) ** 3 : number ->(+--temp) : number ->+--temp : number ->--temp : number ->temp : number ->3 : number - -(-temp++) ** 3; ->(-temp++) ** 3 : number ->(-temp++) : number ->-temp++ : number ->temp++ : number ->temp : number ->3 : number - -(+temp--) ** 3; ->(+temp--) ** 3 : number ->(+temp--) : number ->+temp-- : number ->temp-- : number ->temp : number ->3 : number - -(-(1 ** ++temp)) ** 3; ->(-(1 ** ++temp)) ** 3 : number ->(-(1 ** ++temp)) : number ->-(1 ** ++temp) : number ->(1 ** ++temp) : number ->1 ** ++temp : number ->1 : number ->++temp : number ->temp : number ->3 : number - -(-(1 ** --temp)) ** 3; ->(-(1 ** --temp)) ** 3 : number ->(-(1 ** --temp)) : number ->-(1 ** --temp) : number ->(1 ** --temp) : number ->1 ** --temp : number ->1 : number ->--temp : number ->temp : number ->3 : number - -(-(1 ** temp++)) ** 3; ->(-(1 ** temp++)) ** 3 : number ->(-(1 ** temp++)) : number ->-(1 ** temp++) : number ->(1 ** temp++) : number ->1 ** temp++ : number ->1 : number ->temp++ : number ->temp : number ->3 : number - -(-(1 ** temp--)) ** 3; ->(-(1 ** temp--)) ** 3 : number ->(-(1 ** temp--)) : number ->-(1 ** temp--) : number ->(1 ** temp--) : number ->1 ** temp-- : number ->1 : number ->temp-- : number ->temp : number ->3 : number - -(-3) ** temp++; ->(-3) ** temp++ : number ->(-3) : number ->-3 : number ->3 : number ->temp++ : number ->temp : number - -(-3) ** temp--; ->(-3) ** temp-- : number ->(-3) : number ->-3 : number ->3 : number ->temp-- : number ->temp : number - -(-3) ** ++temp; ->(-3) ** ++temp : number ->(-3) : number ->-3 : number ->3 : number ->++temp : number ->temp : number - -(-3) ** --temp; ->(-3) ** --temp : number ->(-3) : number ->-3 : number ->3 : number ->--temp : number ->temp : number - -(+3) ** temp++; ->(+3) ** temp++ : number ->(+3) : number ->+3 : number ->3 : number ->temp++ : number ->temp : number - -(+3) ** temp--; ->(+3) ** temp-- : number ->(+3) : number ->+3 : number ->3 : number ->temp-- : number ->temp : number - -(+3) ** ++temp; ->(+3) ** ++temp : number ->(+3) : number ->+3 : number ->3 : number ->++temp : number ->temp : number - -(+3) ** --temp; ->(+3) ** --temp : number ->(+3) : number ->+3 : number ->3 : number ->--temp : number ->temp : number - -(-3) ** temp++ ** 2; ->(-3) ** temp++ ** 2 : number ->(-3) : number ->-3 : number ->3 : number ->temp++ ** 2 : number ->temp++ : number ->temp : number ->2 : number - -(-3) ** temp-- ** 2; ->(-3) ** temp-- ** 2 : number ->(-3) : number ->-3 : number ->3 : number ->temp-- ** 2 : number ->temp-- : number ->temp : number ->2 : number - -(-3) ** ++temp ** 2; ->(-3) ** ++temp ** 2 : number ->(-3) : number ->-3 : number ->3 : number ->++temp ** 2 : number ->++temp : number ->temp : number ->2 : number - -(-3) ** --temp ** 2; ->(-3) ** --temp ** 2 : number ->(-3) : number ->-3 : number ->3 : number ->--temp ** 2 : number ->--temp : number ->temp : number ->2 : number - -(+3) ** temp++ ** 2; ->(+3) ** temp++ ** 2 : number ->(+3) : number ->+3 : number ->3 : number ->temp++ ** 2 : number ->temp++ : number ->temp : number ->2 : number - -(+3) ** temp-- ** 2; ->(+3) ** temp-- ** 2 : number ->(+3) : number ->+3 : number ->3 : number ->temp-- ** 2 : number ->temp-- : number ->temp : number ->2 : number - -(+3) ** ++temp ** 2; ->(+3) ** ++temp ** 2 : number ->(+3) : number ->+3 : number ->3 : number ->++temp ** 2 : number ->++temp : number ->temp : number ->2 : number - -(+3) ** --temp ** 2; ->(+3) ** --temp ** 2 : number ->(+3) : number ->+3 : number ->3 : number ->--temp ** 2 : number ->--temp : number ->temp : number ->2 : number - -3 ** -temp++; ->3 ** -temp++ : number ->3 : number ->-temp++ : number ->temp++ : number ->temp : number - -3 ** -temp--; ->3 ** -temp-- : number ->3 : number ->-temp-- : number ->temp-- : number ->temp : number - -3 ** -++temp; ->3 ** -++temp : number ->3 : number ->-++temp : number ->++temp : number ->temp : number - -3 ** +--temp; ->3 ** +--temp : number ->3 : number ->+--temp : number ->--temp : number ->temp : number - -3 ** (-temp++) ** 2; ->3 ** (-temp++) ** 2 : number ->3 : number ->(-temp++) ** 2 : number ->(-temp++) : number ->-temp++ : number ->temp++ : number ->temp : number ->2 : number - -3 ** (-temp--) ** 2; ->3 ** (-temp--) ** 2 : number ->3 : number ->(-temp--) ** 2 : number ->(-temp--) : number ->-temp-- : number ->temp-- : number ->temp : number ->2 : number - -3 ** (+temp++) ** 2; ->3 ** (+temp++) ** 2 : number ->3 : number ->(+temp++) ** 2 : number ->(+temp++) : number ->+temp++ : number ->temp++ : number ->temp : number ->2 : number - -3 ** (+temp--) ** 2; ->3 ** (+temp--) ** 2 : number ->3 : number ->(+temp--) ** 2 : number ->(+temp--) : number ->+temp-- : number ->temp-- : number ->temp : number ->2 : number - -3 ** (-++temp) ** 2; ->3 ** (-++temp) ** 2 : number ->3 : number ->(-++temp) ** 2 : number ->(-++temp) : number ->-++temp : number ->++temp : number ->temp : number ->2 : number - -3 ** (+--temp) ** 2; ->3 ** (+--temp) ** 2 : number ->3 : number ->(+--temp) ** 2 : number ->(+--temp) : number ->+--temp : number ->--temp : number ->temp : number ->2 : number - diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.js b/tests/baselines/reference/emitExponentiationOperator4ES7.js deleted file mode 100644 index 2602fd2b8e626..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator4ES7.js +++ /dev/null @@ -1,70 +0,0 @@ -//// [emitExponentiationOperator4ES7.ts] -var temp: any; - -(temp) ** 3; -(--temp) ** 3; -(++temp) ** 3; -(temp--) ** 3; -(temp++) ** 3; - -1 ** (--temp) ** 3; -1 ** (++temp) ** 3; -1 ** (temp--) ** 3; -1 ** (temp++) ** 3; - -(void --temp) ** 3; -(void temp--) ** 3; -(void 3) ** 4; -(void temp++) ** 4; -(void temp--) ** 4; - - -1 ** (void --temp) ** 3; -1 ** (void temp--) ** 3; -1 ** (void 3) ** 4; -1 ** (void temp++) ** 4; -1 ** (void temp--) ** 4; - -(~ --temp) ** 3; -(~temp--) ** 3; -(~3) ** 4; -(~temp++) ** 4; -(~temp--) ** 4; - -1 ** (~ --temp) ** 3; -1 ** (~temp--) ** 3; -1 ** (~3) ** 4; -1 ** (~temp++) ** 4; -1 ** (~temp--) ** 4; - -//// [emitExponentiationOperator4ES7.js] -var temp; -temp ** 3; -(--temp) ** 3; -(++temp) ** 3; -(temp--) ** 3; -(temp++) ** 3; -1 ** (--temp) ** 3; -1 ** (++temp) ** 3; -1 ** (temp--) ** 3; -1 ** (temp++) ** 3; -(void --temp) ** 3; -(void temp--) ** 3; -(void 3) ** 4; -(void temp++) ** 4; -(void temp--) ** 4; -1 ** (void --temp) ** 3; -1 ** (void temp--) ** 3; -1 ** (void 3) ** 4; -1 ** (void temp++) ** 4; -1 ** (void temp--) ** 4; -(~--temp) ** 3; -(~temp--) ** 3; -(~3) ** 4; -(~temp++) ** 4; -(~temp--) ** 4; -1 ** (~--temp) ** 3; -1 ** (~temp--) ** 3; -1 ** (~3) ** 4; -1 ** (~temp++) ** 4; -1 ** (~temp--) ** 4; diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.symbols b/tests/baselines/reference/emitExponentiationOperator4ES7.symbols deleted file mode 100644 index d66e1379908ca..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator4ES7.symbols +++ /dev/null @@ -1,84 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts === -var temp: any; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(--temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(++temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(temp++) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (--temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (++temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (temp++) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(void --temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(void temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(void 3) ** 4; -(void temp++) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(void temp--) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - - -1 ** (void --temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (void temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (void 3) ** 4; -1 ** (void temp++) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (void temp--) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(~ --temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(~temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(~3) ** 4; -(~temp++) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -(~temp--) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (~ --temp) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (~temp--) ** 3; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (~3) ** 4; -1 ** (~temp++) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - -1 ** (~temp--) ** 4; ->temp : Symbol(temp, Decl(emitExponentiationOperator4ES7.ts, 0, 3)) - diff --git a/tests/baselines/reference/emitExponentiationOperator4ES7.types b/tests/baselines/reference/emitExponentiationOperator4ES7.types deleted file mode 100644 index 5449c8989466a..0000000000000 --- a/tests/baselines/reference/emitExponentiationOperator4ES7.types +++ /dev/null @@ -1,260 +0,0 @@ -=== tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts === -var temp: any; ->temp : any - -(temp) ** 3; ->(temp) ** 3 : number ->(temp) : number ->temp : number ->temp : any ->3 : number - -(--temp) ** 3; ->(--temp) ** 3 : number ->(--temp) : number ->--temp : number ->--temp : number ->temp : any ->3 : number - -(++temp) ** 3; ->(++temp) ** 3 : number ->(++temp) : number ->++temp : number ->++temp : number ->temp : any ->3 : number - -(temp--) ** 3; ->(temp--) ** 3 : number ->(temp--) : number ->temp-- : number ->temp-- : number ->temp : any ->3 : number - -(temp++) ** 3; ->(temp++) ** 3 : number ->(temp++) : number ->temp++ : number ->temp++ : number ->temp : any ->3 : number - -1 ** (--temp) ** 3; ->1 ** (--temp) ** 3 : number ->1 : number ->(--temp) ** 3 : number ->(--temp) : number ->--temp : number ->--temp : number ->temp : any ->3 : number - -1 ** (++temp) ** 3; ->1 ** (++temp) ** 3 : number ->1 : number ->(++temp) ** 3 : number ->(++temp) : number ->++temp : number ->++temp : number ->temp : any ->3 : number - -1 ** (temp--) ** 3; ->1 ** (temp--) ** 3 : number ->1 : number ->(temp--) ** 3 : number ->(temp--) : number ->temp-- : number ->temp-- : number ->temp : any ->3 : number - -1 ** (temp++) ** 3; ->1 ** (temp++) ** 3 : number ->1 : number ->(temp++) ** 3 : number ->(temp++) : number ->temp++ : number ->temp++ : number ->temp : any ->3 : number - -(void --temp) ** 3; ->(void --temp) ** 3 : number ->(void --temp) : undefined ->void --temp : undefined ->--temp : number ->temp : any ->3 : number - -(void temp--) ** 3; ->(void temp--) ** 3 : number ->(void temp--) : undefined ->void temp-- : undefined ->temp-- : number ->temp : any ->3 : number - -(void 3) ** 4; ->(void 3) ** 4 : number ->(void 3) : undefined ->void 3 : undefined ->3 : number ->4 : number - -(void temp++) ** 4; ->(void temp++) ** 4 : number ->(void temp++) : undefined ->void temp++ : undefined ->temp++ : number ->temp : any ->4 : number - -(void temp--) ** 4; ->(void temp--) ** 4 : number ->(void temp--) : undefined ->void temp-- : undefined ->temp-- : number ->temp : any ->4 : number - - -1 ** (void --temp) ** 3; ->1 ** (void --temp) ** 3 : number ->1 : number ->(void --temp) ** 3 : number ->(void --temp) : undefined ->void --temp : undefined ->--temp : number ->temp : any ->3 : number - -1 ** (void temp--) ** 3; ->1 ** (void temp--) ** 3 : number ->1 : number ->(void temp--) ** 3 : number ->(void temp--) : undefined ->void temp-- : undefined ->temp-- : number ->temp : any ->3 : number - -1 ** (void 3) ** 4; ->1 ** (void 3) ** 4 : number ->1 : number ->(void 3) ** 4 : number ->(void 3) : undefined ->void 3 : undefined ->3 : number ->4 : number - -1 ** (void temp++) ** 4; ->1 ** (void temp++) ** 4 : number ->1 : number ->(void temp++) ** 4 : number ->(void temp++) : undefined ->void temp++ : undefined ->temp++ : number ->temp : any ->4 : number - -1 ** (void temp--) ** 4; ->1 ** (void temp--) ** 4 : number ->1 : number ->(void temp--) ** 4 : number ->(void temp--) : undefined ->void temp-- : undefined ->temp-- : number ->temp : any ->4 : number - -(~ --temp) ** 3; ->(~ --temp) ** 3 : number ->(~ --temp) : number ->~ --temp : number ->--temp : number ->temp : any ->3 : number - -(~temp--) ** 3; ->(~temp--) ** 3 : number ->(~temp--) : number ->~temp-- : number ->temp-- : number ->temp : any ->3 : number - -(~3) ** 4; ->(~3) ** 4 : number ->(~3) : number ->~3 : number ->3 : number ->4 : number - -(~temp++) ** 4; ->(~temp++) ** 4 : number ->(~temp++) : number ->~temp++ : number ->temp++ : number ->temp : any ->4 : number - -(~temp--) ** 4; ->(~temp--) ** 4 : number ->(~temp--) : number ->~temp-- : number ->temp-- : number ->temp : any ->4 : number - -1 ** (~ --temp) ** 3; ->1 ** (~ --temp) ** 3 : number ->1 : number ->(~ --temp) ** 3 : number ->(~ --temp) : number ->~ --temp : number ->--temp : number ->temp : any ->3 : number - -1 ** (~temp--) ** 3; ->1 ** (~temp--) ** 3 : number ->1 : number ->(~temp--) ** 3 : number ->(~temp--) : number ->~temp-- : number ->temp-- : number ->temp : any ->3 : number - -1 ** (~3) ** 4; ->1 ** (~3) ** 4 : number ->1 : number ->(~3) ** 4 : number ->(~3) : number ->~3 : number ->3 : number ->4 : number - -1 ** (~temp++) ** 4; ->1 ** (~temp++) ** 4 : number ->1 : number ->(~temp++) ** 4 : number ->(~temp++) : number ->~temp++ : number ->temp++ : number ->temp : any ->4 : number - -1 ** (~temp--) ** 4; ->1 ** (~temp--) ** 4 : number ->1 : number ->(~temp--) ** 4 : number ->(~temp--) : number ->~temp-- : number ->temp-- : number ->temp : any ->4 : number - diff --git a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt index 2864da4a7f3aa..af17a7ddf7a32 100644 --- a/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt +++ b/tests/baselines/reference/exponentiationOperatorSyntaxError2.errors.txt @@ -74,11 +74,11 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(61,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(62,6): error TS17006: An unary expression with the '!' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. -tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,1): error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(64,1): error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(65,1): error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(66,1): error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(67,1): error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts(68,1): error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts (81 errors) ==== @@ -299,16 +299,16 @@ tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxE temp ** 3; ~~~~~~~~~~~~ -!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. ++temp ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. --temp ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp++ ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. +!!! error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. temp-- ** 3; ~~~~~~~~~~~~~~ -!!! error TS17006: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file +!!! error TS17007: A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses. \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts deleted file mode 100644 index ca2514b53f951..0000000000000 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator1ES7.ts +++ /dev/null @@ -1,22 +0,0 @@ -// @target: es7 - -var comp: number; - -comp **= 1; -comp **= comp ** comp; -comp **= comp ** comp ** 2; -comp **= comp ** comp + 2; -comp **= comp ** comp - 2; -comp **= comp ** comp * 2; -comp **= comp ** comp / 2; -comp **= comp ** comp % 2; -comp **= (comp - 2) ** 5; -comp **= (comp + 2) ** 5; -comp **= (comp * 2) ** 5; -comp **= (comp / 2) ** 5; -comp **= (comp % 2) ** 5; -comp **= comp ** (5 + 2); -comp **= comp ** (5 - 2); -comp **= comp ** (5 * 2); -comp **= comp ** (5 / 2); -comp **= comp ** (5 % 2); \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts deleted file mode 100644 index 4cc1a29a5f712..0000000000000 --- a/tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationOperator2ES7.ts +++ /dev/null @@ -1,25 +0,0 @@ -// @target:es7 - -var comp: number; - -comp **= 1; -comp **= comp **= 1; -comp **= comp **= 1 + 2; -comp **= comp **= 1 - 2; -comp **= comp **= 1 * 2; -comp **= comp **= 1 / 2; - -comp **= comp **= (1 + 2); -comp **= comp **= (1 - 2); -comp **= comp **= (1 * 2); -comp **= comp **= (1 / 2); - -comp **= comp **= 1 + 2 ** 3; -comp **= comp **= 1 - 2 ** 4; -comp **= comp **= 1 * 2 ** 5; -comp **= comp **= 1 / 2 ** 6; - -comp **= comp **= (1 + 2) ** 3; -comp **= comp **= (1 - 2) ** 4; -comp **= comp **= (1 * 2) ** 5; -comp **= comp **= (1 / 2) ** 6; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts deleted file mode 100644 index f99051f650099..0000000000000 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator1ES7.ts +++ /dev/null @@ -1,33 +0,0 @@ -// @target: es7 - -1 ** -2; -1 ** 2; -(-1) ** 2 -1 ** 2 ** 3; -1 ** 2 ** -3; -1 ** -(2 ** 3); -(-(1 ** 2)) ** 3; -(-(1 ** 2)) ** -3; - -1 ** 2 + 3; -1 ** 2 - 3; -1 ** 2 * 3; -1 ** 2 / 3; -1 ** 2 % 3; - -1 ** -2 + 3; -1 ** -2 - 3; -1 ** -2 * 3; -1 ** -2 / 3; -1 ** -2 % 3; - -2 + 3 ** 3; -2 - 3 ** 3; -2 * 3 ** 3; -2 / 3 ** 3; -2 % 3 ** 3; - -(2 + 3) ** 4; -(2 - 3) ** 4; -(2 * 3) ** 4; -(2 / 3) ** 4; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts deleted file mode 100644 index f5429d1ddd57a..0000000000000 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator2ES7.ts +++ /dev/null @@ -1,56 +0,0 @@ -// @target:es7 - -var temp = 10; - -++temp ** 3; ---temp ** 3; -temp++ ** 3; -temp-- ** 3; ---temp + temp ** 3; ---temp - temp ** 3; ---temp * temp ** 3; ---temp / temp ** 3; ---temp % temp ** 3; -temp-- ** 3; -temp++ ** 3; -temp-- ** -temp; -temp++ ** +temp; - -temp-- + temp ** 3; -temp-- - temp ** 3; -temp-- * temp ** 3; -temp-- / temp ** 3; -temp-- % temp ** 3; - ---temp + 2 ** 3; ---temp - 2 ** 3; ---temp * 2 ** 3; ---temp / 2 ** 3; ---temp % 2 ** 3; - -++temp + 2 ** 3; -++temp - 2 ** 3; -++temp * 2 ** 3; -++temp / 2 ** 3; - -3 ** ++temp; -3 ** --temp; -3 ** temp++; -3 ** temp--; - -3 ** ++temp ** 2; -3 ** --temp ** 2; -3 ** temp++ ** 2; -3 ** temp-- ** 2; - -3 ** ++temp + 2; -3 ** ++temp - 2; -3 ** ++temp * 2; -3 ** ++temp / 2; -3 ** ++temp % 2; - -3 ** --temp + 2; -3 ** --temp - 2; -3 ** --temp * 2; -3 ** --temp / 2; -3 ** --temp % 2; \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts deleted file mode 100644 index 8ebe25e9be174..0000000000000 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator3ES7.ts +++ /dev/null @@ -1,40 +0,0 @@ -// @target:es7 - -var temp = 10; - -(-++temp) ** 3; -(+--temp) ** 3; -(-temp++) ** 3; -(+temp--) ** 3; -(-(1 ** ++temp)) ** 3; -(-(1 ** --temp)) ** 3; -(-(1 ** temp++)) ** 3; -(-(1 ** temp--)) ** 3; - -(-3) ** temp++; -(-3) ** temp--; -(-3) ** ++temp; -(-3) ** --temp; -(+3) ** temp++; -(+3) ** temp--; -(+3) ** ++temp; -(+3) ** --temp; -(-3) ** temp++ ** 2; -(-3) ** temp-- ** 2; -(-3) ** ++temp ** 2; -(-3) ** --temp ** 2; -(+3) ** temp++ ** 2; -(+3) ** temp-- ** 2; -(+3) ** ++temp ** 2; -(+3) ** --temp ** 2; - -3 ** -temp++; -3 ** -temp--; -3 ** -++temp; -3 ** +--temp; -3 ** (-temp++) ** 2; -3 ** (-temp--) ** 2; -3 ** (+temp++) ** 2; -3 ** (+temp--) ** 2; -3 ** (-++temp) ** 2; -3 ** (+--temp) ** 2; diff --git a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts b/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts deleted file mode 100644 index 6da1f54b7013d..0000000000000 --- a/tests/cases/conformance/es7/exponentiationOperator/emitExponentiationOperator4ES7.ts +++ /dev/null @@ -1,38 +0,0 @@ -// @target: es7 -var temp: any; - -(temp) ** 3; -(--temp) ** 3; -(++temp) ** 3; -(temp--) ** 3; -(temp++) ** 3; - -1 ** (--temp) ** 3; -1 ** (++temp) ** 3; -1 ** (temp--) ** 3; -1 ** (temp++) ** 3; - -(void --temp) ** 3; -(void temp--) ** 3; -(void 3) ** 4; -(void temp++) ** 4; -(void temp--) ** 4; - - -1 ** (void --temp) ** 3; -1 ** (void temp--) ** 3; -1 ** (void 3) ** 4; -1 ** (void temp++) ** 4; -1 ** (void temp--) ** 4; - -(~ --temp) ** 3; -(~temp--) ** 3; -(~3) ** 4; -(~temp++) ** 4; -(~temp--) ** 4; - -1 ** (~ --temp) ** 3; -1 ** (~temp--) ** 3; -1 ** (~3) ** 4; -1 ** (~temp++) ** 4; -1 ** (~temp--) ** 4; \ No newline at end of file From 1fc11aa18f4e8103b344492cba06b18e296b0401 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 8 Oct 2015 23:25:05 -0700 Subject: [PATCH 36/39] Address PR feedback, add comment --- src/compiler/emitter.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index a4ff544a132db..2ebfe367d3c84 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2591,6 +2591,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else { emit(node.left); + // Add indentation before emit the operator if the operator is on different line + // For example: + // 3 + // + 2; + // emitted as + // 3 + // + 2; let indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== SyntaxKind.CommaToken ? " " : undefined); write(tokenToString(node.operatorToken.kind)); let indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); From 2918f9d7a24391353c1864ce3e965de98630e928 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 12 Oct 2015 10:55:10 -0700 Subject: [PATCH 37/39] Update baseline after merge conflict --- ...iationAssignmentWithIndexingOnLHS4.symbols | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols index 5213a451d39bf..19a9805a0c2f5 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.symbols @@ -12,12 +12,12 @@ function incrementIdx(max: number) { let idx = Math.floor(Math.random() * max); >idx : Symbol(idx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 4, 7)) ->Math.floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) ->floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) ->Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) ->random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math.floor : Symbol(Math.floor, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>floor : Symbol(Math.floor, Decl(lib.d.ts, --, --)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.d.ts, --, --)) >max : Symbol(max, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 2, 22)) return idx; @@ -30,31 +30,31 @@ var array1 = [1, 2, 3, 4, 5]; array1[incrementIdx(array1.length)] **= 3; >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) >incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) ->array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) ->length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, --, --)) array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) >incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) ->array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) ->length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) >incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) ->array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) ->length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, --, --)) array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) >incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) ->array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) ->length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) >incrementIdx : Symbol(incrementIdx, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 1, 22)) ->array1.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>array1.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) >array1 : Symbol(array1, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts, 8, 3)) ->length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, --, --)) From e405ccebec5e6f355e609caf12e470719e572e1e Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 12 Oct 2015 11:48:38 -0700 Subject: [PATCH 38/39] fix linter failure --- src/compiler/emitter.ts | 2 +- src/compiler/parser.ts | 6 +++--- src/compiler/types.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 47662c26b4299..51bc49297bec9 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3564,7 +3564,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); return identifier; - } + } function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index b33f3faaed9bc..7ea8f0aa7aa66 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3215,7 +3215,7 @@ namespace ts { parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) : incrementExpression; } - + let unaryOperator = token; let simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === SyntaxKind.AsteriskAsteriskToken) { @@ -3277,7 +3277,7 @@ namespace ts { * ++LeftHandSideExpression[?Yield] * --LeftHandSideExpression[?Yield] */ - function isIncrementExpression(): boolean{ + function isIncrementExpression(): boolean { // This function is called inside parseUnaryExpression to decide // whether to call parseSimpleUnaryExpression or call parseIncrmentExpression directly switch (token) { @@ -3288,7 +3288,7 @@ namespace ts { case SyntaxKind.DeleteKeyword: case SyntaxKind.TypeOfKeyword: case SyntaxKind.VoidKeyword: - return false + return false; case SyntaxKind.LessThanToken: // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression if (sourceFile.languageVariant !== LanguageVariant.JSX) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3a30ce0438381..5ca7ef6e90934 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -708,7 +708,7 @@ namespace ts { export interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } - + export interface IncrementExpression extends UnaryExpression { _incrementExpressionBrand: any; } From 90258794a6cfd42b4da7f8f4abbc2c381c285e05 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 12 Oct 2015 14:32:48 -0700 Subject: [PATCH 39/39] Address PR feedback --- src/compiler/emitter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 51bc49297bec9..f822fe9385d26 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2793,7 +2793,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi synthesizedLHS = createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false); - let identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false); + let identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral &&