Skip to content

Conversation

evoactivity
Copy link
Contributor

The URL class has several static methods that can be useful to access from a template.

An example use case is

<img src={{URL.createObjectURL file}} />

The only test I found for allowed globals is this

describe('implements RFC#1070: default globals', function () {

Looking at that I'm not sure how something like JSON.stringify is tested since it seems to just ensure if it's in the list it will be allowed, so I don't have any tests to go along with this keeping inline with how they are currently tested.

The URL spec is here https://url.spec.whatwg.org/#url
But two extra static methods are from the file api https://w3c.github.io/FileAPI/#dfn-createObjectURL

@NullVoxPopuli
Copy link
Contributor

The URL class has several static methods that can be useful to access from a template.

I feel like we should add this to the criteria. like -- we cant new a URL -- but using as a namespace makes sense -- like JSON

@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label Aug 24, 2025
@NullVoxPopuli
Copy link
Contributor

added here, too NullVoxPopuli/limber#1970

@NullVoxPopuli NullVoxPopuli merged commit bcceef9 into emberjs:main Aug 24, 2025
10 checks passed
@github-actions github-actions bot mentioned this pull request Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants