From a00e90c1700dfd78222bce7d5033bca224c0dfc2 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:03:02 -0700 Subject: [PATCH] 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 | 146 +++++------------- .../emitExponentiationOperator3ES7.ts | 146 +++++------------- .../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, 458 insertions(+), 387 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 2648b0d6809..6a6fdc662c1 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 668d6f0a92b..3f4acd74e01 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 bb8530b204f..c4ca205404b 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 61b057146fc..ca2514b53f9 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 9f8fa8f4d94..2e6c84b6d43 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 9007a1e33cb..f99051f6500 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 317688bf913..146eab550d2 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 ded8e7ce631..f5429d1ddd5 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 f8c05f47e6b..597f253d1b8 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; +// @target:es5 -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; \ No newline at end of file +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 466cab93a51..8ebe25e9be1 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; +// @target:es7 -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; \ No newline at end of file +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 00000000000..6788ab36f86 --- /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 00000000000..d3b718a2054 --- /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 00000000000..104033ab579 --- /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 00000000000..611860cc5ef --- /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 80fe91ee462..744e4ed2698 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 70cdad5b98f..90a8b9b26f7 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 3c3349879c3..0d5f2129861 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 7268768f417..7f122d505e7 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 8affe231586..73fc2fcd3a9 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 9c54478708e..724039acfb2 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 00000000000..d61d3c07450 --- /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 00000000000..c7ee30a95b8 --- /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 00000000000..18ba31f8965 --- /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 00000000000..a70948c23e2 --- /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 00000000000..da7cf7f0d85 --- /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 00000000000..77d7c8b668a --- /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