Skip to content

Commit b88efa1

Browse files
committed
Test cases to verify the privacy error reporting is done on correct node
1 parent 649cd3b commit b88efa1

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tests/cases/compiler/declarationEmitDestructuringPrivacyError.ts(4,20): error TS4025: Exported variable 'y' has or is using private name 'c'.
2+
3+
4+
==== tests/cases/compiler/declarationEmitDestructuringPrivacyError.ts (1 errors) ====
5+
module m {
6+
class c {
7+
}
8+
export var [x, y, z] = [10, new c(), 30];
9+
~
10+
!!! error TS4025: Exported variable 'y' has or is using private name 'c'.
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [declarationEmitDestructuringPrivacyError.ts]
2+
module m {
3+
class c {
4+
}
5+
export var [x, y, z] = [10, new c(), 30];
6+
}
7+
8+
//// [declarationEmitDestructuringPrivacyError.js]
9+
var m;
10+
(function (m) {
11+
var c = (function () {
12+
function c() {
13+
}
14+
return c;
15+
})();
16+
_a = [10, new c(), 30], m.x = _a[0], m.y = _a[1], m.z = _a[2];
17+
var _a;
18+
})(m || (m = {}));
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @declaration: true
2+
module m {
3+
class c {
4+
}
5+
export var [x, y, z] = [10, new c(), 30];
6+
}

0 commit comments

Comments
 (0)