OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 arguments_array->set(j, *arg); | 440 arguments_array->set(j, *arg); |
441 } | 441 } |
442 i::Handle<i::JSArray> arguments_jsarray = | 442 i::Handle<i::JSArray> arguments_jsarray = |
443 i::Factory::NewJSArrayWithElements(arguments_array); | 443 i::Factory::NewJSArrayWithElements(arguments_array); |
444 global_template->Set(String::New("arguments"), | 444 global_template->Set(String::New("arguments"), |
445 Utils::ToLocal(arguments_jsarray)); | 445 Utils::ToLocal(arguments_jsarray)); |
446 | 446 |
447 #ifdef ENABLE_DEBUGGER_SUPPORT | 447 #ifdef ENABLE_DEBUGGER_SUPPORT |
448 // Install the debugger object in the utility scope | 448 // Install the debugger object in the utility scope |
449 i::Debug::Load(); | 449 i::Debug::Load(); |
450 i::JSObject* debug = i::Debug::debug_context()->global(); | 450 i::Handle<i::JSObject> debug |
| 451 = i::Handle<i::JSObject>(i::Debug::debug_context()->global()); |
451 utility_context_->Global()->Set(String::New("$debug"), | 452 utility_context_->Global()->Set(String::New("$debug"), |
452 Utils::ToLocal(&debug)); | 453 Utils::ToLocal(debug)); |
453 #endif | 454 #endif |
454 | 455 |
455 // Run the d8 shell utility script in the utility context | 456 // Run the d8 shell utility script in the utility context |
456 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); | 457 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); |
457 i::Vector<const char> shell_source | 458 i::Vector<const char> shell_source |
458 = i::NativesCollection<i::D8>::GetScriptSource(source_index); | 459 = i::NativesCollection<i::D8>::GetScriptSource(source_index); |
459 i::Vector<const char> shell_source_name | 460 i::Vector<const char> shell_source_name |
460 = i::NativesCollection<i::D8>::GetScriptName(source_index); | 461 = i::NativesCollection<i::D8>::GetScriptName(source_index); |
461 Handle<String> source = String::New(shell_source.start(), | 462 Handle<String> source = String::New(shell_source.start(), |
462 shell_source.length()); | 463 shell_source.length()); |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 return 0; | 771 return 0; |
771 } | 772 } |
772 | 773 |
773 | 774 |
774 } // namespace v8 | 775 } // namespace v8 |
775 | 776 |
776 | 777 |
777 int main(int argc, char* argv[]) { | 778 int main(int argc, char* argv[]) { |
778 return v8::Shell::Main(argc, argv); | 779 return v8::Shell::Main(argc, argv); |
779 } | 780 } |
OLD | NEW |