tc39 / proposal-dynamic-code-brand-checks

TC39 proposal that enables flexible brand checks before dynamic code loading
MIT License
32 stars 5 forks source link

Revert removal of codeString from HostEnsureCanCompileStrings #17

Closed lukewarlow closed 6 months ago

lukewarlow commented 6 months ago

The reason for removal was based on a misunderstanding of the status quo (See https://github.com/tc39/ecma262/pull/3294#issuecomment-2061582798).

I think this is okay to add back to the proposal document before we officially tell Tc39 in June?

lukewarlow commented 6 months ago

@nicolo-ribaudo or @koto could you merge this please?

nicolo-ribaudo commented 5 months ago

Summary of the update

In the 2024-04 TC39 meeting we decided to not expose the built string to the host, under the assumption that that string was spec-internal only. Our recommendation was that instead the host should re-concatenate the string pieces to build its own representation of the string.

It turns out however that the concatenated string was already exposed to users, through new Function(...).toString() which (differently from most Function.prototype.toString behaviors, is not implementation-defined). This PR thus re-exposed the concatenated string to the host to be used as-is.