Skip to content

Commit

Permalink
chore: updated intl patch to add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabadesso committed Nov 7, 2024
1 parent bb4f43a commit e9a0644
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions patches/intl+1.2.5.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/intl/lib/core.js b/node_modules/intl/lib/core.js
index 9334cfc..4525a08 100644
index 9334cfc..552a228 100644
--- a/node_modules/intl/lib/core.js
+++ b/node_modules/intl/lib/core.js
@@ -540,7 +540,7 @@ function createRegExpRestore() {
Expand All @@ -11,11 +11,24 @@ index 9334cfc..4525a08 100644
multiline: RegExp.multiline,
input: RegExp.input
},
@@ -4291,6 +4291,7 @@ defineProperty(Intl, '__applyLocaleSensitivePrototypes', {
@@ -4291,6 +4291,12 @@ defineProperty(Intl, '__applyLocaleSensitivePrototypes', {
writable: true,
configurable: true,
value: function value() {
+ return null;
+ return null;
+ /*
+ XXX: These are mutating Number and Date prototypes which is blocked by SES, causing the app to crash.
+ Since we're not using toLocaleString anywhere in our code, I'm just returning `null` here.
+ */
+ /*
defineProperty(Number.prototype, 'toLocaleString', { writable: true, configurable: true, value: ls.Number.toLocaleString });
// Need this here for IE 8, to avoid the _DontEnum_ bug
defineProperty(Date.prototype, 'toLocaleString', { writable: true, configurable: true, value: ls.Date.toLocaleString });
@@ -4298,6 +4304,7 @@ defineProperty(Intl, '__applyLocaleSensitivePrototypes', {
for (var k in ls.Date) {
if (hop.call(ls.Date, k)) defineProperty(Date.prototype, k, { writable: true, configurable: true, value: ls.Date[k] });
}
+ */
}
});

1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ export function splitInGroups(list, groupSize) {
return groups;
}

/*
* Verifies if all critical built-in object prototypes are frozen, indicating a secure
* ECMAScript (SES) environment. This check ensures that the execution context remains
* immutable by preventing modifications to built-in prototypes, a common target for
Expand Down

0 comments on commit e9a0644

Please sign in to comment.