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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 Handle<ObjectTemplate> global_template = ObjectTemplate::New(); | 416 Handle<ObjectTemplate> global_template = ObjectTemplate::New(); |
417 global_template->Set(String::New("print"), FunctionTemplate::New(Print)); | 417 global_template->Set(String::New("print"), FunctionTemplate::New(Print)); |
418 global_template->Set(String::New("write"), FunctionTemplate::New(Write)); | 418 global_template->Set(String::New("write"), FunctionTemplate::New(Write)); |
419 global_template->Set(String::New("read"), FunctionTemplate::New(Read)); | 419 global_template->Set(String::New("read"), FunctionTemplate::New(Read)); |
420 global_template->Set(String::New("readline"), | 420 global_template->Set(String::New("readline"), |
421 FunctionTemplate::New(ReadLine)); | 421 FunctionTemplate::New(ReadLine)); |
422 global_template->Set(String::New("load"), FunctionTemplate::New(Load)); | 422 global_template->Set(String::New("load"), FunctionTemplate::New(Load)); |
423 global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); | 423 global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); |
424 global_template->Set(String::New("version"), FunctionTemplate::New(Version)); | 424 global_template->Set(String::New("version"), FunctionTemplate::New(Version)); |
425 | 425 |
| 426 #ifdef LIVE_OBJECT_LIST |
| 427 global_template->Set(String::New("lol_is_enabled"), Boolean::New(true)); |
| 428 #else |
| 429 global_template->Set(String::New("lol_is_enabled"), Boolean::New(false)); |
| 430 #endif |
| 431 |
426 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); | 432 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); |
427 AddOSMethods(os_templ); | 433 AddOSMethods(os_templ); |
428 global_template->Set(String::New("os"), os_templ); | 434 global_template->Set(String::New("os"), os_templ); |
429 | 435 |
430 utility_context_ = Context::New(NULL, global_template); | 436 utility_context_ = Context::New(NULL, global_template); |
431 utility_context_->SetSecurityToken(Undefined()); | 437 utility_context_->SetSecurityToken(Undefined()); |
432 Context::Scope utility_scope(utility_context_); | 438 Context::Scope utility_scope(utility_context_); |
433 | 439 |
434 i::JSArguments js_args = i::FLAG_js_arguments; | 440 i::JSArguments js_args = i::FLAG_js_arguments; |
435 i::Handle<i::FixedArray> arguments_array = | 441 i::Handle<i::FixedArray> arguments_array = |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 return 0; | 781 return 0; |
776 } | 782 } |
777 | 783 |
778 | 784 |
779 } // namespace v8 | 785 } // namespace v8 |
780 | 786 |
781 | 787 |
782 int main(int argc, char* argv[]) { | 788 int main(int argc, char* argv[]) { |
783 return v8::Shell::Main(argc, argv); | 789 return v8::Shell::Main(argc, argv); |
784 } | 790 } |
OLD | NEW |