From c7ec61d7b06c40bc038674e9530ebcf4979e17e7 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 12:03:57 -0500 Subject: [PATCH 01/32] Default globals for strict mode --- text/0000-default-globals-for-strict-mode.md | 95 ++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 text/0000-default-globals-for-strict-mode.md diff --git a/text/0000-default-globals-for-strict-mode.md b/text/0000-default-globals-for-strict-mode.md new file mode 100644 index 0000000000..0466d45fa8 --- /dev/null +++ b/text/0000-default-globals-for-strict-mode.md @@ -0,0 +1,95 @@ +--- +stage: accepted +start-date: 2025-01-18T00:00:00.000Z +release-date: # In format YYYY-MM-DDT00:00:00.000Z +release-versions: +teams: # delete teams that aren't relevant + - cli + - framework + - learning +prs: + accepted: # Fill this in with the URL for the Proposal RFC PR +project-link: +suite: +--- + + + +# Default globals for strict mode + +## Summary + +This RFC aims to introduce platform-native globals as allowed defaults in strict-mode components, allowing for more intuitive usage, and less "know how the compiler works" + +## Motivation + +Early on there was a bug in the build tools of strict-mode components that allowed _any_ global to be used components. This was dangerous, as strict-mode allows use of all in-scoped variables to be used in all valid syntax positions in the template, and while this is what folks would expect for languages with a scope-system, it means that if someone defined `window.div`, all `
`s in components would use that implementation instead. This was fixed, but during that time, we realized that it's _very_ convenient to use platform-native globals as utilities, such as `Array`, `Boolean`, `String`, `Infinity`, `JSON`, and many more. + +While we don't want to support _everything_ on `globalThis`, we can aim support a good list of utilities fitting some criteria. Committing to this list means that we promise to never create a keyword with the same name + casing as the platform-native API, likewise, having an allow-list of which platform-native APIs to support guides our decisions around what keywords to implement in templates, as the platform-native globals would take precedence over / be used instead of any same-named keywords. + +## Detailed design + + +> This is the bulk of the RFC. + +> Explain the design in enough detail for somebody +familiar with the framework to understand, and for somebody familiar with the +implementation to implement. This should get into specifics and corner-cases, +and include examples of how the feature is used. Any new terminology should be +defined here. + +> Please keep in mind any implications within the Ember ecosystem, such as: +> - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed +> - Features that are replaced or made obsolete by this feature and should eventually be deprecated +> - Ember Inspector and debuggability +> - Server-side Rendering +> - Ember Engines +> - The Addon Ecosystem +> - IDE Support +> - Blueprints that should be added or modified + +## How we teach this + +> What names and terminology work best for these concepts and why? How is this +idea best presented? As a continuation of existing Ember patterns, or as a +wholly new one? + +> Would the acceptance of this proposal mean the Ember guides must be +re-organized or altered? Does it change how Ember is taught to new users +at any level? + +> How should this feature be introduced and taught to existing Ember +users? + +> Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc. + +## Drawbacks + +> Why should we *not* do this? Please consider the impact on teaching Ember, +on the integration of this feature with other existing and planned features, +on the impact of the API churn on existing apps, etc. + +> There are tradeoffs to choosing any path, please attempt to identify them here. + +## Alternatives + +> What other designs have been considered? What is the impact of not doing this? + +> This section could also include prior art, that is, how other frameworks in the same domain have solved this problem. + +## Unresolved questions + +> Optional, but suggested for first drafts. What parts of the design are still +TBD? From 277cdbe7b69ba99ce7f9a3e69ec30a91cc6b6ea6 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 12:05:32 -0500 Subject: [PATCH 02/32] Update meta --- ...r-strict-mode.md => 1070-default-globals-for-strict-mode.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename text/{0000-default-globals-for-strict-mode.md => 1070-default-globals-for-strict-mode.md} (98%) diff --git a/text/0000-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md similarity index 98% rename from text/0000-default-globals-for-strict-mode.md rename to text/1070-default-globals-for-strict-mode.md index 0466d45fa8..60cc8856d9 100644 --- a/text/0000-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -8,7 +8,7 @@ teams: # delete teams that aren't relevant - framework - learning prs: - accepted: # Fill this in with the URL for the Proposal RFC PR + accepted: https://github.com/emberjs/rfcs/pull/1070 project-link: suite: --- From d33b0b1f21e293f6845ab28c97c87341faf82718 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 12:20:50 -0500 Subject: [PATCH 03/32] Updates --- text/1070-default-globals-for-strict-mode.md | 105 +++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 60cc8856d9..a4c2efcde6 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -39,8 +39,113 @@ Early on there was a bug in the build tools of strict-mode components that allow While we don't want to support _everything_ on `globalThis`, we can aim support a good list of utilities fitting some criteria. Committing to this list means that we promise to never create a keyword with the same name + casing as the platform-native API, likewise, having an allow-list of which platform-native APIs to support guides our decisions around what keywords to implement in templates, as the platform-native globals would take precedence over / be used instead of any same-named keywords. +Without this RFC, all platform-native globals must be accessed via globalThis: + +```gjs + +``` +or +```gjs +const { JSON } = globalThis; + + +``` + +After this RFC is implemented, the following would work: +```gjs + +``` + ## Detailed design +Allowing defaults means: when using `JSON` (for example) in a component, the compiled-to-plain-JS output results in the reference to JSON being added to the "scope bag", for example: : + +```js +// Post-RFC 931 +import { template } from '@ember/template-compiler'; + +const data = {}; + +export default template('{{JSON.stringify data}}', { scope: () => ({ JSON, data }) }); +``` + +
pre-RFC#931 + +```js +// Pre-RFC 931 +import { precompileTemplate } from "@ember/template-compilation"; +import { setComponentTemplate } from "@ember/component"; +import templateOnly from "@ember/component/template-only"; + +const data = {}; + +export default setComponentTemplate( + precompileTemplate('{{JSON.stringify data}}', { + strictMode: true, + scope: () => ({ JSON, data }) } + ), templateOnly() +); +``` + +
+ +Criteria for a platform-native global to be accepted as default: + +Any of +- begins with an uppercase letter +- guaranteed to never be added to glimmer as a keyword (e.g.: `globalThis`) + +And +- must not need `new` to invoke +- must be one one of these lists: + - https://tc39.es/ecma262/#sec-global-object + - https://tc39.es/ecma262/#sec-function-properties-of-the-global-object + - https://html.spec.whatwg.org/multipage/nav-history-apis.html#window + + +Given the above criteria, the following should be added to default-available strict-mode scope: + +### namespaces + +- `globalThis` +- `JSON` +- `Math` +- `Atomics` +- `Reflect` + +### functions / utilities + +- `isNaN` +- `isFinite` +- `parseInt` +- `parseFloat` +- `decodeURI` +- `decodeURIComponent` +- `encodeURI` +- `encodeURIComponent` + +### new-less constructors (still functions / utilities) + +- `Number` +- `Object` +- `Array` +- `String` +- `BigInt` +- `Date` + +### Values + +- `Infinity` + + + + > This is the bulk of the RFC. From e80bd6716ad599c05589507b00bfb96d802dd8af Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:02:14 -0500 Subject: [PATCH 04/32] Updates --- text/1070-default-globals-for-strict-mode.md | 64 ++++++++++++++------ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index a4c2efcde6..b47de0bbe3 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -113,38 +113,62 @@ Given the above criteria, the following should be added to default-available str ### namespaces -- `globalThis` -- `JSON` -- `Math` -- `Atomics` -- `Reflect` +- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) +- [`Atomics`](https://tc39.es/ecma262/#sec-atomics) +- [`JSON`](https://tc39.es/ecma262/#sec-json) +- [`Math`](https://tc39.es/ecma262/#sec-math) +- [`Reflect`](https://tc39.es/ecma262/#sec-reflect) ### functions / utilities -- `isNaN` -- `isFinite` -- `parseInt` -- `parseFloat` -- `decodeURI` -- `decodeURIComponent` -- `encodeURI` -- `encodeURIComponent` +- [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number) +- [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number) +- [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix) +- [`parseFloat`](https://tc39.es/ecma262/#sec-parsefloat-string) +- [`decodeURI`](https://tc39.es/ecma262/#sec-decodeuri-encodeduri) +- [`decodeURIComponent`](https://tc39.es/ecma262/#sec-decodeuricomponent-encodeduricomponent) +- [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri) +- [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent) ### new-less constructors (still functions / utilities) -- `Number` -- `Object` -- `Array` -- `String` -- `BigInt` -- `Date` +- [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array) +- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint) +- [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean) +- [`Date`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-date) +- [`Number`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-number) +- [`Object`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-object) +- [`String`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-string) ### Values -- `Infinity` +- [`Infinity`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-infinity) +- [`NaN`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan) +### Matching criteria, but not included + +Existing keywords don't need to be included in the global scope allow-list + +- [`undefined`](https://tc39.es/ecma262/#sec-undefined) + +These do not exist in all supported environments: + +- [`Encode`](https://tc39.es/ecma262/#sec-encode) +- [`Decode`](https://tc39.es/ecma262/#sec-decode) +- [`ParseHexOctet`](https://tc39.es/ecma262/#sec-parsehexoctet) + +These are not common and / or may be actively dangerous to make easier to use: + +- `eval` +- `PerformEval` +- `Function` + +Uncommon entries from the "Constructor Properties" list: https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object +- `${...}Error`, e.g.: `AggregateError` +- `${...}Int${...}Array`, e.g.: `BigUint64Array`, +- anything that requires `new`, e.g.: `DataView`, `Map` > This is the bulk of the RFC. From f1370c4751aeafdd1d14fbe854a6b7da13ae314f Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:27:03 -0500 Subject: [PATCH 05/32] Updates --- text/1070-default-globals-for-strict-mode.md | 119 +++++++++++++------ 1 file changed, 80 insertions(+), 39 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index b47de0bbe3..f79187a44f 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -33,6 +33,8 @@ suite: Leave as is This RFC aims to introduce platform-native globals as allowed defaults in strict-mode components, allowing for more intuitive usage, and less "know how the compiler works" +This is an ergonomics-focused RFC. The proposed changes today can be polyfilled via `globalThis['...']` accesses. + ## Motivation Early on there was a bug in the build tools of strict-mode components that allowed _any_ global to be used components. This was dangerous, as strict-mode allows use of all in-scoped variables to be used in all valid syntax positions in the template, and while this is what folks would expect for languages with a scope-system, it means that if someone defined `window.div`, all `
`s in components would use that implementation instead. This was fixed, but during that time, we realized that it's _very_ convenient to use platform-native globals as utilities, such as `Array`, `Boolean`, `String`, `Infinity`, `JSON`, and many more. @@ -111,16 +113,77 @@ And Given the above criteria, the following should be added to default-available strict-mode scope: -### namespaces +### namespaces / objects + +TC39: - [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) + + Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs): + ```gjs + + ``` + - [`Atomics`](https://tc39.es/ecma262/#sec-atomics) + + [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs): + ```gjs + const buffer = new ArrayBuffer(16); + const uint8 = new Uint8Array(buffer); + uint8[0] = 7; + + // 7 (0111) XOR 2 (0010) = 5 (0101)
+ Atomics.xor(uint8, 0, 2) + + + ``` + + - [`JSON`](https://tc39.es/ecma262/#sec-json) + + [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs): + ```gjs + + ``` + - [`Math`](https://tc39.es/ecma262/#sec-math) + + [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs): + ```gjs + + ``` + - [`Reflect`](https://tc39.es/ecma262/#sec-reflect) + [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs): + ```gjs + const data = { greeting: 'hello there' }; + + + ``` + +WHATWG: + +- [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location) +- [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history) +- [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator) +- [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window) +- [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2) + ### functions / utilities +TC39: + - [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number) - [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number) - [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix) @@ -130,8 +193,14 @@ Given the above criteria, the following should be added to default-available str - [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri) - [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent) +WHATWG: + +- [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage) + ### new-less constructors (still functions / utilities) +TC39: + - [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array) - [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint) - [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean) @@ -142,12 +211,14 @@ Given the above criteria, the following should be added to default-available str ### Values +TC39: + - [`Infinity`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-infinity) - [`NaN`](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan) -### Matching criteria, but not included +### Potentially matching criteria, but not included Existing keywords don't need to be included in the global scope allow-list @@ -170,55 +241,25 @@ Uncommon entries from the "Constructor Properties" list: https://tc39.es/ecma262 - `${...}Int${...}Array`, e.g.: `BigUint64Array`, - anything that requires `new`, e.g.: `DataView`, `Map` +APIs from WHATWG that are highly likely to collide with user-land code or are already ambiguous (and thus would be confusing to use): -> This is the bulk of the RFC. - -> Explain the design in enough detail for somebody -familiar with the framework to understand, and for somebody familiar with the -implementation to implement. This should get into specifics and corner-cases, -and include examples of how the feature is used. Any new terminology should be -defined here. +- `stop()`, `close()`, `status()`, `focus()`, `blur()`, `open()`, `parent`, `confirm()`, `self`, etc -> Please keep in mind any implications within the Ember ecosystem, such as: -> - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed -> - Features that are replaced or made obsolete by this feature and should eventually be deprecated -> - Ember Inspector and debuggability -> - Server-side Rendering -> - Ember Engines -> - The Addon Ecosystem -> - IDE Support -> - Blueprints that should be added or modified ## How we teach this -> What names and terminology work best for these concepts and why? How is this -idea best presented? As a continuation of existing Ember patterns, or as a -wholly new one? - -> Would the acceptance of this proposal mean the Ember guides must be -re-organized or altered? Does it change how Ember is taught to new users -at any level? +Developers should primarily reference exising documentation on the web for the above-mentioned APIs, such as on MDN. -> How should this feature be introduced and taught to existing Ember -users? - -> Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc. +If we don't already, we should have an extensive guide on Polish Syntax, potentially similar to [https://cheatsheet.glimmer.nullvoxpopuli.com/docs/templates](https://cheatsheet.glimmer.nullvoxpopuli.com/docs/templates) ## Drawbacks -> Why should we *not* do this? Please consider the impact on teaching Ember, -on the integration of this feature with other existing and planned features, -on the impact of the API churn on existing apps, etc. - -> There are tradeoffs to choosing any path, please attempt to identify them here. +Takes a small amount of work to implement. ## Alternatives -> What other designs have been considered? What is the impact of not doing this? - -> This section could also include prior art, that is, how other frameworks in the same domain have solved this problem. +Do nothing, but this is worse, as folks intuitively expect these a lot of the above-mentioned APIs to "just work", without needing weird scope-tricks to convince our Scope-tracking tools in the build tools that certain APIs are in scope.. ## Unresolved questions -> Optional, but suggested for first drafts. What parts of the design are still -TBD? +none From 3352ab04e81bbe1a319688a28fd64e1b5003723c Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:27:50 -0500 Subject: [PATCH 06/32] The colons look weird --- text/1070-default-globals-for-strict-mode.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index f79187a44f..90ceb674cc 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -119,7 +119,7 @@ TC39: - [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) - Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs): + Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs) ```gjs ``` -
+ .. pull-quote:: + [!NOTE] + This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) -> [!NOTE] -> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) - - -
- [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint) From 66864797982474d54b54264b4581eb79a0c9f451 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:19:17 -0500 Subject: [PATCH 19/32] Updates --- text/1070-default-globals-for-strict-mode.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 753bd76e99..44a51bfe27 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -373,6 +373,7 @@ TC39: .. pull-quote:: + [!NOTE] This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) From 85c472a838cb7954940cc18578521213bc1a4a0d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:19:31 -0500 Subject: [PATCH 20/32] Updates --- text/1070-default-globals-for-strict-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 44a51bfe27..34a54aa3b4 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -374,8 +374,8 @@ TC39: .. pull-quote:: - [!NOTE] - This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) + > [!NOTE] + > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) From 030feb4635b9ea810b535d1f04601ca0b873488d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:20:32 -0500 Subject: [PATCH 21/32] Updates --- text/1070-default-globals-for-strict-mode.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 34a54aa3b4..2f1db1d31f 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -371,11 +371,8 @@ TC39: ``` - - .. pull-quote:: - - > [!NOTE] - > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) +> > [!NOTE] +> > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) From 6318ef246d830717ecef1997f63b603035d827c6 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:20:45 -0500 Subject: [PATCH 22/32] Updates --- text/1070-default-globals-for-strict-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 2f1db1d31f..6173acf7bd 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -371,8 +371,8 @@ TC39: ``` -> > [!NOTE] -> > This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) +> [!NOTE] +> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) From 4def2186ce26c60eb511d91d0227470d34f5771d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:25:07 -0500 Subject: [PATCH 23/32] Updates --- text/1070-default-globals-for-strict-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 6173acf7bd..52c8f2f48f 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -361,6 +361,7 @@ TC39: - [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array) + See note about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note] [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs) ```gjs @@ -371,8 +372,7 @@ TC39: ``` -> [!NOTE] -> This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) + [^reactive-array-note]: This is the same behavior as `(array)` in loose mode, and `import { array } from '@ember/helper';`, however, while the creation of the array is reactive (e.g.: if we had said `(Array @foo @bar)`, changes to `@foo` and `@bar` would cause the creation of a new array instance), the proposed _built-in_ `(array)` _keyword_ behavior _may_ have reactive items, as proposed by [RFC#1068](https://github.com/emberjs/rfcs/pull/1068) From 917b997ff06186afa0bc419e12cb0508c65029bd Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:25:35 -0500 Subject: [PATCH 24/32] Updates --- text/1070-default-globals-for-strict-mode.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 52c8f2f48f..5e7a46dcef 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -362,6 +362,7 @@ TC39: See note about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note] + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs) ```gjs From 397e18b5e2090c6be0fe174f4504f131b1ee379c Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:25:49 -0500 Subject: [PATCH 25/32] Updates --- text/1070-default-globals-for-strict-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 5e7a46dcef..ff23de38ec 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -361,7 +361,7 @@ TC39: - [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array) - See note about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note] + See note[^reactive-array-note] about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note] [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs) From 31aedfdc0004e3f2eb531dd74ffafb3529154fef Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 18:33:11 -0500 Subject: [PATCH 26/32] Updates --- text/1070-default-globals-for-strict-mode.md | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index ff23de38ec..1d90adf32b 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -378,12 +378,65 @@ TC39: - [`BigInt`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-bigint) + + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgCFKcBJAOxFQCIAGADwEYAZsJGiRnAL4TkwAPTho8JMiA&format=gjs) + ```gjs + + ``` + - [`Boolean`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-boolean) + + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYgJYBmqAFAOYwD2ARnDACoAWeAzgHQBCFFMYcAdqgBEggJQBfMWgzoQAJwCuYKemxgYzMBOUYCtDduwB6QluCHw0eEmRA&format=gjs) + ```gjs + + ``` + - [`Date`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-date) + + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgBEExUBGAdgGY2AmAFg4AMAgKwBOPgF8JyYAHpw0eEmRA&format=gjs) + ```gjs + + ``` + - [`Number`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-number) + + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgDkBXCQsAJ1QCIAmbzgX37JgAenDR4SZEA&format=gjs) + ```gjs + + ``` + - [`Object`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-object) + + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAsBaASwDtUAKAcxgHsAjOGAFSLIGcA6AeSYArMARCo4AXgCMqJhIBMASnFdUAHwDWYAJ6oAbqwCuYNQF9TaDOmxbt5gFxZMBmMfOXrmAPT5i5Cu7AXuDQ8EjIQA&format=gjs) + ```gjs + + ``` + - [`String`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-string) + [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wcxgewCM4YAVACwEsBnAOgGUQAnSgOx1QCZOBfH5YAHpw0eEmRA&format=gjs) + ```gjs + + ``` + ### Values TC39: From 055687a065c52b6111f9d8d930754d773bfca987 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 18:37:26 -0500 Subject: [PATCH 27/32] Updates --- text/1070-default-globals-for-strict-mode.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 1d90adf32b..5a4eb52f37 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -125,15 +125,18 @@ Given the above criteria, the following should be added to default-available str TC39: -- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) +- [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) - Already available. +
Example - Already available. [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs) + [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs) ```gjs ``` +
+ - [`Atomics`](https://tc39.es/ecma262/#sec-atomics) [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs) From cfefd279e8a185f5f7b17f646704b656ab056b15 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Jan 2025 18:42:15 -0500 Subject: [PATCH 28/32] ya --- text/1070-default-globals-for-strict-mode.md | 164 ++++++++++++++++--- 1 file changed, 141 insertions(+), 23 deletions(-) diff --git a/text/1070-default-globals-for-strict-mode.md b/text/1070-default-globals-for-strict-mode.md index 5a4eb52f37..72d965ea83 100644 --- a/text/1070-default-globals-for-strict-mode.md +++ b/text/1070-default-globals-for-strict-mode.md @@ -126,6 +126,7 @@ Given the above criteria, the following should be added to default-available str TC39: - [`globalThis`](https://tc39.es/ecma262/#sec-globalthis) - Already available. +
Example [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs) @@ -139,7 +140,9 @@ TC39: - [`Atomics`](https://tc39.es/ecma262/#sec-atomics) - [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBARgVwGZIKYCcYF4ZlQdxgEF10BDATwCFk10AKARgDYBKAbgChRJYEBLMFAAc2XARgBVQSJLkK9RCgwdOAocIDaABgC6YgOxdOAehMwDMetsa3WMABoB5AEowATFe03t9nAFYvRhtWAB44dAA%2BTiIoEABbfmAIADoADxAGdREAGhhtPPdWTk5QqFR4gAcAGzJy6JgYAG8mgHNqkDgyaoAVAAt%2BVNiEpNSOsgATGGzhAF9Z0pNyqtr6oA&format=gjs) ```gjs const buffer = new ArrayBuffer(16); const uint8 = new Uint8Array(buffer); @@ -153,28 +156,40 @@ TC39: ``` +
+ - [`JSON`](https://tc39.es/ecma262/#sec-json) - [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOggQipgF8BuAKH4AeKPgC2AB3pJ8APn4xMGbEwBGCegBUaxCADoAUgGUA8gDk90XKWzEAZgE94SBN27CA9KMnTRsoA&format=gjs) ```gjs ``` +
+ - [`Math`](https://tc39.es/ecma262/#sec-math) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgFklzaoEAPNABjQCY0AWAL6DQAekixEKIA&format=gjs) ```gjs ``` +
+ - [`Reflect`](https://tc39.es/ecma262/#sec-reflect) - [Example](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=MYewdgzgLgBAJgQygmBeGBvGBzATgU3ygEsxsAuGAcgAt8AbekGKOgqmAXwG4AoXgDxR8AWwAO9JPgB8vGJgzYmAIwT0AKjWIQAdACV8AM3r5gUHdiLwkKKnkIkyVTp0EB6YeMnDpQA&format=gjs) ```gjs const data = { greeting: 'hello there' }; @@ -183,19 +198,27 @@ TC39: ``` +
+ WHATWG: - [`location`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgIGMlL8A7W8gJwgDM0BffqAD0kWIhRA&format=gjs) ```gjs ``` +
+ - [`history`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history) +
Example + Example[^glimmer-call-bug] ```gjs import { on } from '@ember/modifier'; @@ -206,9 +229,13 @@ WHATWG: ``` [^glimmer-call-bug]: demo/example omitted because the glimmer-vm, at the time of the writing of this RFC has not fixed a bug that where this-binding is lost on method calls. +
+ - [`navigator`](https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgDsEA3SnJfAJ1oFdqIOAgjgj0wAXzGgA9JFiIUQA&format=gjs) ```gjs ``` +
+ - [`window`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window) Most APIs are also available on `window` - [`document`](https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-2) +
Example + Example[^glimmer-call-bug] ```gjs ``` +
+ - [`localStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-localstorage-attribute) +
Example + Example[^glimmer-call-bug] ```gjs ``` +
+ - [`sessionStorage`](https://html.spec.whatwg.org/multipage/webstorage.html#the-sessionstorage-attribute) +
Example + Example[^glimmer-call-bug] ```gjs ``` +
+ ### functions / utilities @@ -270,7 +311,9 @@ TC39: - [`isNaN`](https://tc39.es/ecma262/#sec-isnan-number) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsByCHaADAJQBfQegxoWaLh1HYIcZhGGiMEgrQUBPGZgD0hJSB2RYiFEA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsByCHaADAJQBfQegxoWaLh1HYIcZhGGiMEgrQUBPGZgD0hJSB2RYiFEA&format=gjs) ```gjs ``` +
+ - [`isFinite`](https://tc39.es/ecma262/#sec-isfinite-number) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsBieAdnpGuWq1GLVgEluBHnwCeASgC%2BC9BjQs0XXpBXYIcZhCUqM6grQMydmAPSEjIa5FiIUQA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wYgJYBmaAFAOZwD2ARgnACoAWeAzgHQsBieAdnpGuWq1GLVgEluBHnwCeASgC%2BC9BjQs0XXpBXYIcZhCUqM6grQMydmAPSEjIa5FiIUQA&format=gjs) ```gjs ``` +
+ - [`parseInt`](https://tc39.es/ecma262/#sec-parseint-string-radix) +
Example - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIBJAOzDQCZaBmAL4DQAekixEKIA&format=gjs) + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIBJAOzDQCZaBmAL4DQAekixEKIA&format=gjs) ```gjs ``` +
+ - [`parseFloat`](https://tc39.es/ecma262/#sec-parsefloat-string) +
Example - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIAxApNAJloGYBffqAD0kWIhRA&format=gjs) + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOhgQCdqIAxApNAJloGYBffqAD0kWIhRA&format=gjs) ```gjs ``` +
+ - [`decodeURI`](https://tc39.es/ecma262/#sec-decodeuri-encodeduri) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJNAIgFIArACEAHkIAivAL7S0oAPSRYiFEA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJNAIgFIArACEAHkIAivAL7S0oAPSRYiFEA&format=gjs) ```gjs ``` +
+ - [`decodeURIComponent`](https://tc39.es/ecma262/#sec-decodeuricomponent-encodeduricomponent) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJAYX1nwA7CILBoARAFIArACEAHjIAi4gL6q0oAPSRYiFEA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOgBMIBjfRgVQCUBJAYX1nwA7CILBoARAFIArACEAHjIAi4gL6q0oAPSRYiFEA&format=gjs) ```gjs ``` +
+ - [`encodeURI`](https://tc39.es/ecma262/#sec-encodeuri-uri) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASTQCIA2gA8AuvwC%2BEtKAD0kWIhRA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASTQCIA2gA8AuvwC%2BEtKAD0kWIhRA&format=gjs) ```gjs ``` +
+ - [`encodeURIComponent`](https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent) - [Example](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASQGF8sfA0Zg0AIgDaADwC64gL4K0oAPSRYiFEA&format=gjs) +
Example + + [Link](https://limber.glimdown.com/edit?c=FAHgLgpgtgDgNgQ0gPmAAjQb0wczgewCME4AVACwEsBnAOggDsBjfAEwgFUAlASQGF8sfA0Zg0AIgDaADwC64gL4K0oAPSRYiFEA&format=gjs) ```gjs ``` +
+ WHATWG: - [`atob`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa) + +
Example + +
+ - [`btoa`](https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob) + +
Example + +
+ - [`postMessage`](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage) + +
Example + +
+ - [`structuredClone`](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone) +
Example + +
+ + ### new-less constructors (still functions / utilities) TC39: - [`Array`](https://tc39.es/ecma262/#sec-constructor-properties-of-the-global-object-array) +
Example See note[^reactive-array-note] about `(array)`, `@ember/helper`, and [RFC#1000](https://github.com/emberjs/rfcs/pull/1000)[^reactive-array-note] - [Example](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs) + [Link](https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAATtQb0wYjHAYwAtUAKAcxgHsAjOGAFSIEsBnAOgEEAnbuAT1QBGVACZUAZgCUqOK1QAfZuAgKAvmrQZt2ZZA1b02APT5iB4MZWwEYFEA&format=gjs) ```gjs