OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 ASSERT(!context.IsEmpty()); | 975 ASSERT(!context.IsEmpty()); |
976 Context::Scope scope(context); | 976 Context::Scope scope(context); |
977 | 977 |
978 #ifndef V8_SHARED | 978 #ifndef V8_SHARED |
979 i::Factory* factory = reinterpret_cast<i::Isolate*>(isolate)->factory(); | 979 i::Factory* factory = reinterpret_cast<i::Isolate*>(isolate)->factory(); |
980 i::JSArguments js_args = i::FLAG_js_arguments; | 980 i::JSArguments js_args = i::FLAG_js_arguments; |
981 i::Handle<i::FixedArray> arguments_array = | 981 i::Handle<i::FixedArray> arguments_array = |
982 factory->NewFixedArray(js_args.argc); | 982 factory->NewFixedArray(js_args.argc); |
983 for (int j = 0; j < js_args.argc; j++) { | 983 for (int j = 0; j < js_args.argc; j++) { |
984 i::Handle<i::String> arg = | 984 i::Handle<i::String> arg = |
985 factory->NewStringFromUtf8(i::CStrVector(js_args[j])); | 985 factory->NewStringFromUtf8(i::CStrVector(js_args[j])).ToHandleChecked(); |
986 arguments_array->set(j, *arg); | 986 arguments_array->set(j, *arg); |
987 } | 987 } |
988 i::Handle<i::JSArray> arguments_jsarray = | 988 i::Handle<i::JSArray> arguments_jsarray = |
989 factory->NewJSArrayWithElements(arguments_array); | 989 factory->NewJSArrayWithElements(arguments_array); |
990 context->Global()->Set(String::NewFromUtf8(isolate, "arguments"), | 990 context->Global()->Set(String::NewFromUtf8(isolate, "arguments"), |
991 Utils::ToLocal(arguments_jsarray)); | 991 Utils::ToLocal(arguments_jsarray)); |
992 #endif // V8_SHARED | 992 #endif // V8_SHARED |
993 return handle_scope.Escape(context); | 993 return handle_scope.Escape(context); |
994 } | 994 } |
995 | 995 |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 } | 1773 } |
1774 | 1774 |
1775 } // namespace v8 | 1775 } // namespace v8 |
1776 | 1776 |
1777 | 1777 |
1778 #ifndef GOOGLE3 | 1778 #ifndef GOOGLE3 |
1779 int main(int argc, char* argv[]) { | 1779 int main(int argc, char* argv[]) { |
1780 return v8::Shell::Main(argc, argv); | 1780 return v8::Shell::Main(argc, argv); |
1781 } | 1781 } |
1782 #endif | 1782 #endif |
OLD | NEW |