| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 global_template->Set(String::New("load"), FunctionTemplate::New(Load)); | 230 global_template->Set(String::New("load"), FunctionTemplate::New(Load)); |
| 231 global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); | 231 global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); |
| 232 global_template->Set(String::New("version"), FunctionTemplate::New(Version)); | 232 global_template->Set(String::New("version"), FunctionTemplate::New(Version)); |
| 233 | 233 |
| 234 utility_context_ = Context::New(NULL, global_template); | 234 utility_context_ = Context::New(NULL, global_template); |
| 235 utility_context_->SetSecurityToken(Undefined()); | 235 utility_context_->SetSecurityToken(Undefined()); |
| 236 Context::Scope utility_scope(utility_context_); | 236 Context::Scope utility_scope(utility_context_); |
| 237 | 237 |
| 238 // Install the debugger object in the utility scope | 238 // Install the debugger object in the utility scope |
| 239 i::Debug::Load(); | 239 i::Debug::Load(); |
| 240 i::JSObject* raw_debug = i::Debug::debug_context()->global(); | 240 i::Debug::debug_context()->set_security_token(i::Heap::undefined_value()); |
| 241 i::JSGlobalObject* debug = i::JSGlobalObject::cast(raw_debug); | 241 i::JSObject* debug = i::Debug::debug_context()->global(); |
| 242 debug->set_security_token(i::Heap::undefined_value()); | |
| 243 utility_context_->Global()->Set(String::New("$debug"), | 242 utility_context_->Global()->Set(String::New("$debug"), |
| 244 Utils::ToLocal(&raw_debug)); | 243 Utils::ToLocal(&debug)); |
| 245 | 244 |
| 246 // Run the d8 shell utility script in the utility context | 245 // Run the d8 shell utility script in the utility context |
| 247 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); | 246 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); |
| 248 i::Vector<const char> shell_source | 247 i::Vector<const char> shell_source |
| 249 = i::NativesCollection<i::D8>::GetScriptSource(source_index); | 248 = i::NativesCollection<i::D8>::GetScriptSource(source_index); |
| 250 i::Vector<const char> shell_source_name | 249 i::Vector<const char> shell_source_name |
| 251 = i::NativesCollection<i::D8>::GetScriptName(source_index); | 250 = i::NativesCollection<i::D8>::GetScriptName(source_index); |
| 252 Handle<String> source = String::New(shell_source.start(), | 251 Handle<String> source = String::New(shell_source.start(), |
| 253 shell_source.length()); | 252 shell_source.length()); |
| 254 Handle<String> name = String::New(shell_source_name.start(), | 253 Handle<String> name = String::New(shell_source_name.start(), |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 return 0; | 339 return 0; |
| 341 } | 340 } |
| 342 | 341 |
| 343 | 342 |
| 344 } // namespace v8 | 343 } // namespace v8 |
| 345 | 344 |
| 346 | 345 |
| 347 int main(int argc, char* argv[]) { | 346 int main(int argc, char* argv[]) { |
| 348 return v8::Shell::Main(argc, argv); | 347 return v8::Shell::Main(argc, argv); |
| 349 } | 348 } |
| OLD | NEW |