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

Fix JSON.stringify polyfill name #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
"es.object.create",
"es.object.freeze",
]),
stringify: define(
"json/stringify",
["es.json.stringify", "es.date.to-json"],
stringify: define("json/stringify", [
"es.json.stringify",
"es.date.to-json",
"es.symbol",
),
]),
},

Math: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var _Array$from = require("core-js-pure/features/array/from.js");
var _Array$isArray = require("core-js-pure/features/array/is-array.js");
var _Array$of = require("core-js-pure/features/array/of.js");
var _Date$now = require("core-js-pure/features/date/now.js");
var _JSON$stringify = require("core-js-pure/features/json/stringify.js");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not be removed with those options.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's removed because it seems to default to version 3.0. I noticed this while testing the package.

Copy link
Member

@zloirock zloirock Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry is available in 3.0.

IIRC it could be removed because of the order of modules in the array of dependencies - here the first is es.json.stringify that wasn't in 3.0 - however, it does not mean that core-js-pure/features/json/stringify is not required.

Copy link
Author

@mohd-akram mohd-akram Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It checks getModulesByVersion (something like that, which references a JSON file with that metadata) in core-js-compat and es.json.stringify is not mentioned under 3.0. I think that's why.

For pure I believe it only checks the first entry in the array since a pure import will fetch its own dependencies.

Copy link
Member

@zloirock zloirock Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because JSON.stringify polyfill was only in es.symbol and it was exported in core-js-pure/features/json/stringify. Which is what we're talking about above.

var _Math$DEG_PER_RAD = require("core-js-pure/features/math/deg-per-rad.js");
var _Math$RAD_PER_DEG = require("core-js-pure/features/math/rad-per-deg.js");
var _Math$acosh = require("core-js-pure/features/math/acosh.js");
Expand Down Expand Up @@ -110,7 +109,7 @@ _Array$from;
_Array$isArray;
_Array$of;
_Date$now;
_JSON$stringify;
JSON.stringify;
_Math$DEG_PER_RAD;
_Math$RAD_PER_DEG;
_Math$acosh;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var _Array$from = require("core-js-pure/stable/array/from.js");
var _Array$isArray = require("core-js-pure/stable/array/is-array.js");
var _Array$of = require("core-js-pure/stable/array/of.js");
var _Date$now = require("core-js-pure/stable/date/now.js");
var _JSON$stringify = require("core-js-pure/stable/json/stringify.js");
var _Math$acosh = require("core-js-pure/stable/math/acosh.js");
var _Math$asinh = require("core-js-pure/stable/math/asinh.js");
var _Math$atanh = require("core-js-pure/stable/math/atanh.js");
Expand Down Expand Up @@ -91,7 +90,7 @@ _Array$from;
_Array$isArray;
_Array$of;
_Date$now;
_JSON$stringify;
JSON.stringify;
Math.DEG_PER_RAD;
Math.RAD_PER_DEG;
_Math$acosh;
Expand Down