| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 Handle<String> name = String::New(shell_source_name.start(), | 444 Handle<String> name = String::New(shell_source_name.start(), |
| 445 shell_source_name.length()); | 445 shell_source_name.length()); |
| 446 Handle<Script> script = Script::Compile(source, name); | 446 Handle<Script> script = Script::Compile(source, name); |
| 447 script->Run(); | 447 script->Run(); |
| 448 | 448 |
| 449 // Mark the d8 shell script as native to avoid it showing up as normal source | 449 // Mark the d8 shell script as native to avoid it showing up as normal source |
| 450 // in the debugger. | 450 // in the debugger. |
| 451 i::Handle<i::JSFunction> script_fun = Utils::OpenHandle(*script); | 451 i::Handle<i::JSFunction> script_fun = Utils::OpenHandle(*script); |
| 452 i::Handle<i::Script> script_object = | 452 i::Handle<i::Script> script_object = |
| 453 i::Handle<i::Script>(i::Script::cast(script_fun->shared()->script())); | 453 i::Handle<i::Script>(i::Script::cast(script_fun->shared()->script())); |
| 454 script_object->set_type(i::Smi::FromInt(i::SCRIPT_TYPE_NATIVE)); | 454 script_object->set_type(i::Smi::FromInt(i::Script::TYPE_NATIVE)); |
| 455 | 455 |
| 456 // Create the evaluation context | 456 // Create the evaluation context |
| 457 evaluation_context_ = Context::New(NULL, global_template); | 457 evaluation_context_ = Context::New(NULL, global_template); |
| 458 evaluation_context_->SetSecurityToken(Undefined()); | 458 evaluation_context_->SetSecurityToken(Undefined()); |
| 459 | 459 |
| 460 #ifdef ENABLE_DEBUGGER_SUPPORT | 460 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 461 // Set the security token of the debug context to allow access. | 461 // Set the security token of the debug context to allow access. |
| 462 i::Debug::debug_context()->set_security_token(i::Heap::undefined_value()); | 462 i::Debug::debug_context()->set_security_token(i::Heap::undefined_value()); |
| 463 #endif | 463 #endif |
| 464 } | 464 } |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 return 0; | 744 return 0; |
| 745 } | 745 } |
| 746 | 746 |
| 747 | 747 |
| 748 } // namespace v8 | 748 } // namespace v8 |
| 749 | 749 |
| 750 | 750 |
| 751 int main(int argc, char* argv[]) { | 751 int main(int argc, char* argv[]) { |
| 752 return v8::Shell::Main(argc, argv); | 752 return v8::Shell::Main(argc, argv); |
| 753 } | 753 } |
| OLD | NEW |