Address PR and add new with exponentiation

This commit is contained in:
Yui T 2015-10-05 19:07:02 -07:00
parent bd7cc1e7ef
commit fbe559eef0
2 changed files with 27 additions and 0 deletions

View File

@ -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.

View File

@ -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)));