Skip to content

No way to define builtins used in host code in hosted code #126

@mattbierner

Description

@mattbierner

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions