From fbe559eef02748babc1914179158e12ed274aa35 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 5 Oct 2015 19:07:02 -0700 Subject: [PATCH] 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 00000000000..ae694a321b4 --- /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 00000000000..6fb7e62c450 --- /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)));