| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index eebec748af8ab117a91b0a2cd48442df753d88bc..31d8c63ea82f2dceafb284e5726a0079788fe604 100644
|
| --- a/src/bootstrapper.cc
|
| +++ b/src/bootstrapper.cc
|
| @@ -741,6 +741,19 @@ void Genesis::CreateRoots(v8::Handle<v8::ObjectTemplate> global_template,
|
| global_context()->set_regexp_function(*regexp_fun);
|
| }
|
|
|
| + { // -- J S O N
|
| + Handle<String> name = Factory::NewStringFromAscii(CStrVector("JSON"));
|
| + Handle<JSFunction> cons = Factory::NewFunction(
|
| + name,
|
| + Factory::the_hole_value());
|
| + cons->SetInstancePrototype(global_context()->initial_object_prototype());
|
| + cons->SetInstanceClassName(*name);
|
| + Handle<JSObject> json_object = Factory::NewJSObject(cons, TENURED);
|
| + ASSERT(json_object->IsJSObject());
|
| + SetProperty(global, name, json_object, DONT_ENUM);
|
| + global_context()->set_json_object(*json_object);
|
| + }
|
| +
|
| { // --- arguments_boilerplate_
|
| // Make sure we can recognize argument objects at runtime.
|
| // This is done by introducing an anonymous function with
|
| @@ -1068,6 +1081,10 @@ bool Genesis::InstallNatives() {
|
| Natives::GetIndex("regexp"),
|
| Top::global_context(),
|
| Handle<Context>(Top::context()->runtime_context()));
|
| + SetupLazy(Handle<JSObject>(global_context()->json_object()),
|
| + Natives::GetIndex("json"),
|
| + Top::global_context(),
|
| + Handle<Context>(Top::context()->runtime_context()));
|
|
|
| } else if (strlen(FLAG_natives_file) != 0) {
|
| // Otherwise install natives from natives file if file exists and
|
|
|