There's a couple examples of this in bootstrapper.cc if you search for constructor_string, e.g.: https://cs.chromium.org/chromium/src/v8/src/bootstrapper.cc?q=bootstr+package:%5Echromium$&l=1125
On Thu, Mar 23, 2017 at 4:11 AM, <[email protected]> wrote: > Hi again, > > Currently working on migrating Object.prototype.constructor. I have > implemented [[Call] and [[Construct]] cases in BUILTIN. > > I install it like this: > > Handle<JSFunction> object_function = > InstallFunction(global, factory->Object_string(), JS_OBJECT_TYPE, > JSObject::kHeaderSize, isolate->initial_object_ > prototype(), > Builtins::kObjectConstructor, DONT_ENUM); > object_function->shared()->DontAdaptArguments(); > object_function->shared()->SetConstructStub( > *isolate->builtins()->ObjectConstructor_ConstructStub()); > object_function->shared()->set_length(1); > InstallWithIntrinsicDefaultProto(isolate, object_function, > Context::OBJECT_FUNCTION_INDEX); > > > Object([value]) and new Object() are working fine, but "constructor" is > missing from Object.prototype because I removed > %AddNamedProperty(GlobalObject.prototype, > "constructor", GlobalObject, DONT_ENUM); from v8natives.js. How to > install it in bootstrapper.cc? > > - Rong Jie > > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
