Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix unshiftContainer and insertBefore
- Loading branch information
Showing
6 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
packages/babel-plugin-proposal-class-properties/test/fixtures/regression/8882/exec.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,23 @@ | ||
const classes = []; | ||
for (let i = 0; i <= 10; ++i) { | ||
classes.push( | ||
class A { | ||
[i] = `computed field ${i}`; | ||
static foo = `static field ${i}`; | ||
#bar = `private field ${i}`; | ||
getBar() { | ||
return this.#bar; | ||
} | ||
} | ||
); | ||
} | ||
|
||
// for(let i=0; i<= 10; ++i) { | ||
// const clazz = classes[i]; | ||
// expect(clazz.foo).toBe('static field ' + i); | ||
|
||
// const instance = new clazz(); | ||
// expect(Object.getOwnPropertyNames(instance)).toEqual([String(i)]) | ||
// expect(instance[i]).toBe('computed field ' + i); | ||
// expect(instance.getBar()).toBe('private field ' + i); | ||
// } |
13 changes: 13 additions & 0 deletions
13
packages/babel-plugin-proposal-class-properties/test/fixtures/regression/8882/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,13 @@ | ||
const classes = []; | ||
for (let i = 0; i <= 10; ++i) { | ||
classes.push( | ||
class A { | ||
[i] = `computed field ${i}`; | ||
static foo = `static field ${i}`; | ||
#bar = `private field ${i}`; | ||
getBar() { | ||
return this.#bar; | ||
} | ||
} | ||
); | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-proposal-class-properties/test/fixtures/regression/8882/options.json
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,3 @@ | ||
{ | ||
"plugins": ["external-helpers", "proposal-class-properties"] | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/babel-plugin-proposal-class-properties/test/fixtures/regression/8882/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,21 @@ | ||
const classes = []; | ||
|
||
for (let i = 0; i <= 10; ++i) { | ||
var _class, _i, _temp, _bar; | ||
|
||
classes.push((_temp = (_i = i, _class = class A { | ||
constructor() { | ||
babelHelpers.defineProperty(this, _i, `computed field ${i}`); | ||
|
||
_bar.set(this, { | ||
writable: true, | ||
value: `private field ${i}` | ||
}); | ||
} | ||
|
||
getBar() { | ||
return babelHelpers.classPrivateFieldGet(this, _bar); | ||
} | ||
|
||
}), _bar = new WeakMap(), babelHelpers.defineProperty(_class, "foo", `static field ${i}`), _temp)); | ||
} |
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
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