-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Drop some amount of corejs also the file in git tree #1772
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
sha="a3616d74c0b9b9409d580337e04c32da6e3877e4" # v2.5.1 | ||
mkdir -p ./corejs-repo | ||
cd ./corejs-repo | ||
git init | ||
git remote add origin https://github.com/zloirock/core-js.git | ||
git fetch origin --depth=1 "${sha}" | ||
git reset --hard "${sha}" | ||
cp ../k6-shim.js shim.js | ||
cp ../corejs-build.sh corejs-build.sh | ||
docker run --user "$UID:$GID" --rm -ti -v $(pwd):/opt/g --entrypoint /opt/g/corejs-build.sh --workdir /opt/g node | ||
mstoykov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cp custom.min.js ../shim.min.js | ||
cd - | ||
rm -rf corejs-repo | ||
mkdir core-js | ||
mv shim.min.js core-js/shim.min.js | ||
rice embed-go | ||
rm -rf core-js |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,5 @@ | ||||||
#!/bin/sh | ||||||
|
||||||
npm i . | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is failing for me when I run
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm ... that seems to be because I don't specify a version for node and it works with mine (14.x something) while it doesn't work with 15.4.0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 14.x is still the LTS, so as long as it works with that, I wouldn't bother. Usually, |
||||||
modules="$(cat shim.js | grep ^require | sed "s|require('\./modules/||g" | sed "s/');//g" | tr "\n" ",")" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm not mistaken, you could simplify this to:
Suggested change
Also see useless use of
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not going to this for now, as if we remove more from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, though I don't see a reason why not to simplify this anyway. |
||||||
npm run grunt "build:${modules}" "--library=off" "--path=custom" "uglify" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
//require('./modules/es6.symbol'); // in goja or promises | ||
//require('./modules/es6.object.create'); | ||
//require('./modules/es6.object.define-property'); | ||
//require('./modules/es6.object.define-properties'); | ||
//require('./modules/es6.object.get-own-property-descriptor'); | ||
//require('./modules/es6.object.get-prototype-of'); | ||
//require('./modules/es6.object.keys'); | ||
//require('./modules/es6.object.get-own-property-names'); | ||
//require('./modules/es6.object.freeze'); | ||
//require('./modules/es6.object.seal'); | ||
//require('./modules/es6.object.prevent-extensions'); | ||
//require('./modules/es6.object.is-frozen'); | ||
//require('./modules/es6.object.is-sealed'); | ||
//require('./modules/es6.object.is-extensible'); | ||
//require('./modules/es6.object.assign'); | ||
//require('./modules/es6.object.is'); | ||
//require('./modules/es6.object.set-prototype-of'); | ||
//require('./modules/es6.object.to-string'); | ||
//require('./modules/es6.function.bind'); | ||
//require('./modules/es6.function.name'); | ||
//require('./modules/es6.function.has-instance'); | ||
//require('./modules/es6.parse-int'); | ||
//require('./modules/es6.parse-float'); | ||
//require('./modules/es6.number.constructor'); | ||
//require('./modules/es6.number.to-fixed'); | ||
//require('./modules/es6.number.to-precision'); | ||
//require('./modules/es6.number.epsilon'); | ||
//require('./modules/es6.number.is-finite'); | ||
//require('./modules/es6.number.is-integer'); | ||
//require('./modules/es6.number.is-nan'); | ||
//require('./modules/es6.number.is-safe-integer'); | ||
//require('./modules/es6.number.max-safe-integer'); | ||
//require('./modules/es6.number.min-safe-integer'); | ||
//require('./modules/es6.number.parse-float'); | ||
//require('./modules/es6.number.parse-int'); | ||
//require('./modules/es6.math.acosh'); | ||
//require('./modules/es6.math.asinh'); | ||
//require('./modules/es6.math.atanh'); | ||
//require('./modules/es6.math.cbrt'); | ||
//require('./modules/es6.math.clz32'); | ||
//require('./modules/es6.math.cosh'); | ||
//require('./modules/es6.math.expm1'); | ||
//require('./modules/es6.math.fround'); | ||
//require('./modules/es6.math.hypot'); | ||
//require('./modules/es6.math.imul'); | ||
//require('./modules/es6.math.log10'); | ||
//require('./modules/es6.math.log1p'); | ||
//require('./modules/es6.math.log2'); | ||
//require('./modules/es6.math.sign'); | ||
//require('./modules/es6.math.sinh'); | ||
//require('./modules/es6.math.tanh'); | ||
//require('./modules/es6.math.trunc'); | ||
//require('./modules/es6.string.from-code-point'); | ||
//require('./modules/es6.string.raw'); | ||
//require('./modules/es6.string.trim'); | ||
//require('./modules/es6.string.iterator'); | ||
//require('./modules/es6.string.code-point-at'); | ||
//require('./modules/es6.string.ends-with'); | ||
//require('./modules/es6.string.includes'); | ||
//require('./modules/es6.string.repeat'); | ||
//require('./modules/es6.string.starts-with'); | ||
//require('./modules/es6.string.anchor'); | ||
//require('./modules/es6.string.big'); | ||
//require('./modules/es6.string.blink'); | ||
//require('./modules/es6.string.bold'); | ||
//require('./modules/es6.string.fixed'); | ||
//require('./modules/es6.string.fontcolor'); | ||
//require('./modules/es6.string.fontsize'); | ||
//require('./modules/es6.string.italics'); | ||
//require('./modules/es6.string.link'); | ||
//require('./modules/es6.string.small'); | ||
//require('./modules/es6.string.strike'); | ||
//require('./modules/es6.string.sub'); | ||
//require('./modules/es6.string.sup'); | ||
//require('./modules/es6.date.now'); | ||
//require('./modules/es6.date.to-json'); | ||
//require('./modules/es6.date.to-iso-string'); | ||
//require('./modules/es6.date.to-string'); | ||
//require('./modules/es6.date.to-primitive'); | ||
//require('./modules/es6.array.is-array'); | ||
//require('./modules/es6.array.from'); | ||
//require('./modules/es6.array.of'); | ||
//require('./modules/es6.array.join'); | ||
//require('./modules/es6.array.slice'); | ||
//require('./modules/es6.array.sort'); | ||
//require('./modules/es6.array.for-each'); | ||
//require('./modules/es6.array.map'); | ||
//require('./modules/es6.array.filter'); | ||
//require('./modules/es6.array.some'); | ||
//require('./modules/es6.array.every'); | ||
//require('./modules/es6.array.reduce'); | ||
//require('./modules/es6.array.reduce-right'); | ||
//require('./modules/es6.array.index-of'); | ||
//require('./modules/es6.array.last-index-of'); | ||
//require('./modules/es6.array.copy-within'); | ||
//require('./modules/es6.array.fill'); | ||
//require('./modules/es6.array.find'); | ||
//require('./modules/es6.array.find-index'); | ||
//require('./modules/es6.array.species'); | ||
//require('./modules/es6.array.iterator'); | ||
//require('./modules/es6.regexp.constructor'); | ||
//require('./modules/es6.regexp.to-string'); | ||
//require('./modules/es6.regexp.flags'); | ||
//require('./modules/es6.regexp.match'); | ||
//require('./modules/es6.regexp.replace'); | ||
//require('./modules/es6.regexp.search'); | ||
//require('./modules/es6.regexp.split'); | ||
//require('./modules/es6.promise'); | ||
//require('./modules/es6.map'); | ||
//require('./modules/es6.set'); | ||
//require('./modules/es6.weak-map'); | ||
//require('./modules/es6.weak-set'); | ||
//require('./modules/es6.typed.array-buffer'); | ||
//require('./modules/es6.typed.data-view'); | ||
//require('./modules/es6.typed.int8-array'); | ||
//require('./modules/es6.typed.uint8-array'); | ||
//require('./modules/es6.typed.uint8-clamped-array'); | ||
//require('./modules/es6.typed.int16-array'); | ||
//require('./modules/es6.typed.uint16-array'); | ||
//require('./modules/es6.typed.int32-array'); | ||
//require('./modules/es6.typed.uint32-array'); | ||
//require('./modules/es6.typed.float32-array'); | ||
//require('./modules/es6.typed.float64-array'); | ||
//require('./modules/es6.reflect.apply'); | ||
//require('./modules/es6.reflect.construct'); | ||
//require('./modules/es6.reflect.define-property'); | ||
//require('./modules/es6.reflect.delete-property'); | ||
//require('./modules/es6.reflect.enumerate'); | ||
//require('./modules/es6.reflect.get'); | ||
//require('./modules/es6.reflect.get-own-property-descriptor'); | ||
//require('./modules/es6.reflect.get-prototype-of'); | ||
//require('./modules/es6.reflect.has'); | ||
//require('./modules/es6.reflect.is-extensible'); | ||
//require('./modules/es6.reflect.own-keys'); | ||
//require('./modules/es6.reflect.prevent-extensions'); | ||
//require('./modules/es6.reflect.set'); | ||
//require('./modules/es6.reflect.set-prototype-of'); | ||
//require('./modules/es7.array.includes'); // in goja | ||
require('./modules/es7.array.flat-map'); | ||
// this is now called flat, so maybe drop it https://github.com/tc39/proposal-flatMap | ||
require('./modules/es7.array.flatten'); | ||
simskij marked this conversation as resolved.
Show resolved
Hide resolved
|
||
//require('./modules/es7.string.at'); // it is in es2020 but is with completely different semantics | ||
//require('./modules/es7.string.pad-start'); // in goja | ||
//require('./modules/es7.string.pad-end'); // in goja | ||
require('./modules/es7.string.trim-left'); | ||
require('./modules/es7.string.trim-right'); | ||
require('./modules/es7.string.match-all'); | ||
//require('./modules/es7.symbol.async-iterator'); // async | ||
//require('./modules/es7.symbol.observable'); | ||
require('./modules/es7.object.get-own-property-descriptors'); | ||
require('./modules/es7.object.values'); | ||
require('./modules/es7.object.entries'); | ||
require('./modules/es7.object.define-getter'); | ||
require('./modules/es7.object.define-setter'); | ||
require('./modules/es7.object.lookup-getter'); | ||
require('./modules/es7.object.lookup-setter'); | ||
// require('./modules/es7.map.to-json'); // not actually in the standard | ||
//require('./modules/es7.set.to-json'); | ||
//require('./modules/es7.map.of'); | ||
//require('./modules/es7.set.of'); | ||
//require('./modules/es7.weak-map.of'); | ||
//require('./modules/es7.weak-set.of'); | ||
//require('./modules/es7.map.from'); | ||
//require('./modules/es7.set.from'); | ||
//require('./modules/es7.weak-map.from'); | ||
//require('./modules/es7.weak-set.from'); | ||
//require('es7.global'); // is now globalThis, goja has globasl | ||
//require('es7.system.global'); // dropped .. I think | ||
//require('es7.error.is-error'); // dropped | ||
//require('./modules/es7.math.clamp'); // not actually in the standard | ||
//require('./modules/es7.math.deg-per-rad'); | ||
//require('./modules/es7.math.degrees'); | ||
//require('./modules/es7.math.fscale'); | ||
//require('./modules/es7.math.iaddh'); | ||
//require('./modules/es7.math.isubh'); | ||
//require('./modules/es7.math.imulh'); | ||
//require('./modules/es7.math.rad-per-deg'); | ||
//require('./modules/es7.math.radians'); | ||
//require('./modules/es7.math.scale'); | ||
//require('./modules/es7.math.umulh'); | ||
//require('./modules/es7.math.signbit'); | ||
//require('./modules/es7.promise.finally'); // promises | ||
//require('./modules/es7.promise.try'); | ||
require('./modules/es7.reflect.define-metadata'); | ||
require('./modules/es7.reflect.delete-metadata'); | ||
require('./modules/es7.reflect.get-metadata'); | ||
require('./modules/es7.reflect.get-metadata-keys'); | ||
require('./modules/es7.reflect.get-own-metadata'); | ||
require('./modules/es7.reflect.get-own-metadata-keys'); | ||
require('./modules/es7.reflect.has-metadata'); | ||
require('./modules/es7.reflect.has-own-metadata'); | ||
require('./modules/es7.reflect.metadata'); | ||
//require('./modules/es7.asap'); // promises | ||
//require('./modules/es7.observable'); | ||
//require('./modules/web.timers'); // web stuff | ||
//require('./modules/web.immediate'); | ||
//require('./modules/web.dom.iterable'); | ||
// module.exports = require('./modules/_core'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ | |
* | ||
*/ | ||
|
||
//go:generate rice embed-go | ||
|
||
package lib | ||
|
||
import ( | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would never fail, no? It would always be undefined, even if
flatten()
works, unless you meant[3] === 4
. Ah, nevermind, the index doesn't actually matter. :)But this would be better checked with
if (typeof Array.prototype.flatten !== 'function') ...
.Also maybe we should use a different object to test this, since
flatten
was renamed toflat
in corejs v3, and it would avoid us having to update this when we update to v3.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have both of these. First check if it's actually a function, and fast fail if it's no, then whether the behavior is at least somewhat along the lines of what one could expect.
Array.prototype.flat
is the actual name according to the specification. We should probably use that name as well.