OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
8 #define V8_SHARED | 8 #define V8_SHARED |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 Script::Compile(utility_context, source, &origin).ToLocalChecked(); | 1039 Script::Compile(utility_context, source, &origin).ToLocalChecked(); |
1040 script->Run(utility_context).ToLocalChecked(); | 1040 script->Run(utility_context).ToLocalChecked(); |
1041 // Mark the d8 shell script as native to avoid it showing up as normal source | 1041 // Mark the d8 shell script as native to avoid it showing up as normal source |
1042 // in the debugger. | 1042 // in the debugger. |
1043 i::Handle<i::Object> compiled_script = Utils::OpenHandle(*script); | 1043 i::Handle<i::Object> compiled_script = Utils::OpenHandle(*script); |
1044 i::Handle<i::Script> script_object = compiled_script->IsJSFunction() | 1044 i::Handle<i::Script> script_object = compiled_script->IsJSFunction() |
1045 ? i::Handle<i::Script>(i::Script::cast( | 1045 ? i::Handle<i::Script>(i::Script::cast( |
1046 i::JSFunction::cast(*compiled_script)->shared()->script())) | 1046 i::JSFunction::cast(*compiled_script)->shared()->script())) |
1047 : i::Handle<i::Script>(i::Script::cast( | 1047 : i::Handle<i::Script>(i::Script::cast( |
1048 i::SharedFunctionInfo::cast(*compiled_script)->script())); | 1048 i::SharedFunctionInfo::cast(*compiled_script)->script())); |
1049 script_object->set_type(i::Smi::FromInt(i::Script::TYPE_NATIVE)); | 1049 script_object->set_type(i::Script::TYPE_NATIVE); |
1050 } | 1050 } |
1051 #endif // !V8_SHARED | 1051 #endif // !V8_SHARED |
1052 | 1052 |
1053 | 1053 |
1054 Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) { | 1054 Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) { |
1055 Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate); | 1055 Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate); |
1056 global_template->Set( | 1056 global_template->Set( |
1057 String::NewFromUtf8(isolate, "print", NewStringType::kNormal) | 1057 String::NewFromUtf8(isolate, "print", NewStringType::kNormal) |
1058 .ToLocalChecked(), | 1058 .ToLocalChecked(), |
1059 FunctionTemplate::New(isolate, Print)); | 1059 FunctionTemplate::New(isolate, Print)); |
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 } | 2476 } |
2477 | 2477 |
2478 } // namespace v8 | 2478 } // namespace v8 |
2479 | 2479 |
2480 | 2480 |
2481 #ifndef GOOGLE3 | 2481 #ifndef GOOGLE3 |
2482 int main(int argc, char* argv[]) { | 2482 int main(int argc, char* argv[]) { |
2483 return v8::Shell::Main(argc, argv); | 2483 return v8::Shell::Main(argc, argv); |
2484 } | 2484 } |
2485 #endif | 2485 #endif |
OLD | NEW |