Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:added check for forXstatement pattern (#11703)
- Loading branch information
Showing
3 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...proposal-class-properties/test/fixtures/private/1-helpermemberexpressionfunction/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class D { | ||
#arr; | ||
f() { | ||
for (const el of this.#arr); | ||
} | ||
} | ||
|
||
class C { | ||
#p; | ||
m() { | ||
for (this.#p of []); | ||
} | ||
} | ||
|
||
class E { | ||
#arr; | ||
f() { | ||
for (this.#arr of [1, 2]); | ||
} | ||
} | ||
|
||
class F { | ||
#ar; | ||
g() { | ||
for (this.#ar in [1,2,3]); | ||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
...roposal-class-properties/test/fixtures/private/1-helpermemberexpressionfunction/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
var _arr = new WeakMap(); | ||
|
||
var D = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function D() { | ||
babelHelpers.classCallCheck(this, D); | ||
|
||
_arr.set(this, { | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
|
||
babelHelpers.createClass(D, [{ | ||
key: "f", | ||
value: function f() { | ||
for (var el of babelHelpers.classPrivateFieldGet(this, _arr)) { | ||
; | ||
} | ||
} | ||
}]); | ||
return D; | ||
}(); | ||
|
||
var _p = new WeakMap(); | ||
|
||
var C = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
|
||
_p.set(this, { | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
|
||
babelHelpers.createClass(C, [{ | ||
key: "m", | ||
value: function m() { | ||
for (babelHelpers.classPrivateFieldDestructureSet(this, _p).value of []) { | ||
; | ||
} | ||
} | ||
}]); | ||
return C; | ||
}(); | ||
|
||
var _arr2 = new WeakMap(); | ||
|
||
var E = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function E() { | ||
babelHelpers.classCallCheck(this, E); | ||
|
||
_arr2.set(this, { | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
|
||
babelHelpers.createClass(E, [{ | ||
key: "f", | ||
value: function f() { | ||
for (babelHelpers.classPrivateFieldDestructureSet(this, _arr2).value of [1, 2]) { | ||
; | ||
} | ||
} | ||
}]); | ||
return E; | ||
}(); | ||
|
||
var _ar = new WeakMap(); | ||
|
||
var F = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function F() { | ||
babelHelpers.classCallCheck(this, F); | ||
|
||
_ar.set(this, { | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
|
||
babelHelpers.createClass(F, [{ | ||
key: "g", | ||
value: function g() { | ||
for (babelHelpers.classPrivateFieldDestructureSet(this, _ar).value in [1, 2, 3]) { | ||
; | ||
} | ||
} | ||
}]); | ||
return F; | ||
}(); |