Test cases to verify the privacy error reporting is done on correct node
This commit is contained in:
parent
649cd3bce1
commit
b88efa1b80
|
@ -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'.
|
||||
}
|
|
@ -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 = {}));
|
|
@ -0,0 +1,6 @@
|
|||
// @declaration: true
|
||||
module m {
|
||||
class c {
|
||||
}
|
||||
export var [x, y, z] = [10, new c(), 30];
|
||||
}
|
Loading…
Reference in a new issue