Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corejs rework pat2 #1735

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions js/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,17 @@ func TestNewBundle(t *testing.T) {
}
})
t.Run("CompatibilityMode", func(t *testing.T) {
compatibilityTestSrc := `
module.exports.default = function() {};
if ([[1,2],[3,4]].flatten()[4] == 4) {
throw Error("Array.flatten doesn't work")
}
`
t.Run("Extended/ok/CoreJS", func(t *testing.T) {
rtOpts := lib.RuntimeOptions{
CompatibilityMode: null.StringFrom(lib.CompatibilityModeExtended.String()),
}
_, err := getSimpleBundle(t, "/script.js",
`module.exports.default = function() {}; new Promise(function(resolve, reject){});`, rtOpts)
_, err := getSimpleBundle(t, "/script.js", compatibilityTestSrc, rtOpts)

assert.NoError(t, err)
})
Expand Down Expand Up @@ -156,8 +161,8 @@ func TestNewBundle(t *testing.T) {
// some ES2015 objects polyfilled by core.js are not supported
{
"CoreJS", "base",
`module.exports.default = function() {}; new Promise(function(resolve, reject){});`,
"ReferenceError: Promise is not defined at file:///script.js:1:45(5)",
compatibilityTestSrc,
"TypeError: Object has no member 'flatten' at file:///script.js:3:28(14)",
},
}

Expand Down
5 changes: 0 additions & 5 deletions js/lib/core-js/_an-instance.js

This file was deleted.

44 changes: 0 additions & 44 deletions js/lib/core-js/_array-methods.js

This file was deleted.

144 changes: 0 additions & 144 deletions js/lib/core-js/_collection-strong.js

This file was deleted.

9 changes: 0 additions & 9 deletions js/lib/core-js/_collection-to-json.js

This file was deleted.

85 changes: 0 additions & 85 deletions js/lib/core-js/_collection-weak.js

This file was deleted.

Loading