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:
And now host code that throws native errors stops functioning.
Some way to enable this would be nice.
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.