Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
52 additions
and
18 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
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
9 changes: 9 additions & 0 deletions
9
...ges/babel-plugin-transform-classes/test/fixtures/extend-builtins/overwritten-null/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,9 @@ | ||
var env = { | ||
Array: null, | ||
}; | ||
|
||
// Wee need to use "with" to avoid leaking the modified Array to other tests. | ||
with (env) { | ||
class List extends Array {} | ||
assert.equal(List.prototype.__proto__, null); | ||
} |
3 changes: 3 additions & 0 deletions
3
...abel-plugin-transform-classes/test/fixtures/extend-builtins/overwritten-null/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": ["transform-classes", "transform-block-scoping"] | ||
} |
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
17 changes: 11 additions & 6 deletions
17
packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/super-called/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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
var called = false; | ||
|
||
this.Array = function _Array() { | ||
called = true; | ||
} | ||
var env = { | ||
Array: function Array() { | ||
called = true; | ||
} | ||
}; | ||
|
||
class List extends Array {}; | ||
new List(); | ||
// Wee need to use "with" to avoid leaking the modified Array to other tests. | ||
with (env) { | ||
class List extends Array {}; | ||
new List(); | ||
|
||
assert.equal(called, true); | ||
assert.equal(called, true); | ||
} |
2 changes: 1 addition & 1 deletion
2
...es/babel-plugin-transform-classes/test/fixtures/extend-builtins/super-called/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"plugins": ["transform-classes"] | ||
"plugins": ["transform-classes","transform-block-scoping"] | ||
} |
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