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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 debug->Load(); | 559 debug->Load(); |
560 i::Handle<i::JSObject> js_debug | 560 i::Handle<i::JSObject> js_debug |
561 = i::Handle<i::JSObject>(debug->debug_context()->global()); | 561 = i::Handle<i::JSObject>(debug->debug_context()->global()); |
562 utility_context_->Global()->Set(String::New("$debug"), | 562 utility_context_->Global()->Set(String::New("$debug"), |
563 Utils::ToLocal(js_debug)); | 563 Utils::ToLocal(js_debug)); |
564 #endif | 564 #endif |
565 | 565 |
566 // Run the d8 shell utility script in the utility context | 566 // Run the d8 shell utility script in the utility context |
567 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); | 567 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); |
568 i::Vector<const char> shell_source | 568 i::Vector<const char> shell_source |
569 = i::NativesCollection<i::D8>::GetScriptSource(source_index); | 569 = i::NativesCollection<i::D8>::GetRawScriptSource(source_index); |
570 i::Vector<const char> shell_source_name | 570 i::Vector<const char> shell_source_name |
571 = i::NativesCollection<i::D8>::GetScriptName(source_index); | 571 = i::NativesCollection<i::D8>::GetScriptName(source_index); |
572 Handle<String> source = String::New(shell_source.start(), | 572 Handle<String> source = String::New(shell_source.start(), |
573 shell_source.length()); | 573 shell_source.length()); |
574 Handle<String> name = String::New(shell_source_name.start(), | 574 Handle<String> name = String::New(shell_source_name.start(), |
575 shell_source_name.length()); | 575 shell_source_name.length()); |
576 Handle<Script> script = Script::Compile(source, name); | 576 Handle<Script> script = Script::Compile(source, name); |
577 script->Run(); | 577 script->Run(); |
578 | 578 |
579 // Mark the d8 shell script as native to avoid it showing up as normal source | 579 // Mark the d8 shell script as native to avoid it showing up as normal source |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 | 888 |
889 | 889 |
890 } // namespace v8 | 890 } // namespace v8 |
891 | 891 |
892 | 892 |
893 #ifndef GOOGLE3 | 893 #ifndef GOOGLE3 |
894 int main(int argc, char* argv[]) { | 894 int main(int argc, char* argv[]) { |
895 return v8::Shell::Main(argc, argv); | 895 return v8::Shell::Main(argc, argv); |
896 } | 896 } |
897 #endif | 897 #endif |
OLD | NEW |