Test cases to verify the privacy error reporting is done on correct node

This commit is contained in:
Sheetal Nandi 2015-02-12 13:26:59 -08:00
parent 649cd3bce1
commit b88efa1b80
3 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,11 @@
tests/cases/compiler/declarationEmitDestructuringPrivacyError.ts(4,20): error TS4025: Exported variable 'y' has or is using private name 'c'.
==== tests/cases/compiler/declarationEmitDestructuringPrivacyError.ts (1 errors) ====
module m {
class c {
}
export var [x, y, z] = [10, new c(), 30];
~
!!! error TS4025: Exported variable 'y' has or is using private name 'c'.
}

View file

@ -0,0 +1,18 @@
//// [declarationEmitDestructuringPrivacyError.ts]
module m {
class c {
}
export var [x, y, z] = [10, new c(), 30];
}
//// [declarationEmitDestructuringPrivacyError.js]
var m;
(function (m) {
var c = (function () {
function c() {
}
return c;
})();
_a = [10, new c(), 30], m.x = _a[0], m.y = _a[1], m.z = _a[2];
var _a;
})(m || (m = {}));

View file

@ -0,0 +1,6 @@
// @declaration: true
module m {
class c {
}
export var [x, y, z] = [10, new c(), 30];
}