You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not currently possible to define a builtin in hosted code if this builtin must be called from host code. Part of the problem is that changes to the value in hosted code should not be reflected in the host reference.
This is currently not possible:
NativeError = function() {}
NativeError.prototype = new Error();
and then have the host code do something like:
object.construct(native_error.NativeError, {});
because the value references will be different between the host and hosted.
Additionally some evil Javascripter could do:
NativeError = null;
And now host code that throws native errors stops functioning.
Some way to enable this would be nice.
The text was updated successfully, but these errors were encountered:
One possible solution is to evaluate the hosted language builtin impls with a special set of exported functionality not available to running code.
__set(NativeError, function() {});
NativeError.prototype = new Error();
Where double underscore methods like __set are special internal operations. In this case, __set would change the actual underlying value reference of the environment instead of just changing the environment reference.
It is not currently possible to define a builtin in hosted code if this builtin must be called from host code. Part of the problem is that changes to the value in hosted code should not be reflected in the host reference.
This is currently not possible:
and then have the host code do something like:
because the value references will be different between the host and hosted.
Additionally some evil Javascripter could do:
And now host code that throws native errors stops functioning.
Some way to enable this would be nice.
The text was updated successfully, but these errors were encountered: