OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 | 7 |
| 8 #include "src/compiler.h" |
8 #include "src/uri.h" | 9 #include "src/uri.h" |
9 | 10 |
10 namespace v8 { | 11 namespace v8 { |
11 namespace internal { | 12 namespace internal { |
12 | 13 |
13 // ES6 section 18.2.6.2 decodeURI (encodedURI) | 14 // ES6 section 18.2.6.2 decodeURI (encodedURI) |
14 BUILTIN(GlobalDecodeURI) { | 15 BUILTIN(GlobalDecodeURI) { |
15 HandleScope scope(isolate); | 16 HandleScope scope(isolate); |
16 Handle<String> encoded_uri; | 17 Handle<String> encoded_uri; |
17 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 18 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 80 |
80 // ES6 section 18.2.1 eval (x) | 81 // ES6 section 18.2.1 eval (x) |
81 BUILTIN(GlobalEval) { | 82 BUILTIN(GlobalEval) { |
82 HandleScope scope(isolate); | 83 HandleScope scope(isolate); |
83 Handle<Object> x = args.atOrUndefined(isolate, 1); | 84 Handle<Object> x = args.atOrUndefined(isolate, 1); |
84 Handle<JSFunction> target = args.target<JSFunction>(); | 85 Handle<JSFunction> target = args.target<JSFunction>(); |
85 Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); | 86 Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); |
86 if (!x->IsString()) return *x; | 87 if (!x->IsString()) return *x; |
87 Handle<JSFunction> function; | 88 Handle<JSFunction> function; |
88 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 89 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
89 isolate, function, | 90 isolate, function, Compiler::GetFunctionFromString( |
90 Builtins::CompileString(handle(target->native_context(), isolate), | 91 handle(target->native_context(), isolate), |
91 Handle<String>::cast(x), NO_PARSE_RESTRICTION)); | 92 Handle<String>::cast(x), NO_PARSE_RESTRICTION)); |
92 RETURN_RESULT_OR_FAILURE( | 93 RETURN_RESULT_OR_FAILURE( |
93 isolate, | 94 isolate, |
94 Execution::Call(isolate, function, target_global_proxy, 0, nullptr)); | 95 Execution::Call(isolate, function, target_global_proxy, 0, nullptr)); |
95 } | 96 } |
96 | 97 |
97 } // namespace internal | 98 } // namespace internal |
98 } // namespace v8 | 99 } // namespace v8 |
OLD | NEW |