Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "src/builtins.h" |
| 6 | 6 |
| 7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2096 HandleScope scope(isolate); | 2096 HandleScope scope(isolate); |
| 2097 Handle<Object> object = args.atOrUndefined(isolate, 1); | 2097 Handle<Object> object = args.atOrUndefined(isolate, 1); |
| 2098 if (object->IsJSReceiver()) { | 2098 if (object->IsJSReceiver()) { |
| 2099 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), | 2099 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), |
| 2100 SEALED, Object::THROW_ON_ERROR), | 2100 SEALED, Object::THROW_ON_ERROR), |
| 2101 isolate->heap()->exception()); | 2101 isolate->heap()->exception()); |
| 2102 } | 2102 } |
| 2103 return *object; | 2103 return *object; |
| 2104 } | 2104 } |
| 2105 | 2105 |
| 2106 // ES6 section 18.2.6.2 decodeURI (encodedURI) | |
| 2107 BUILTIN(GlobalDecodeURI) { | |
| 2108 HandleScope scope(isolate); | |
| 2109 Handle<String> encodedURI; | |
|
Benedikt Meurer
2016/05/21 19:27:59
Nit: Please rename to encoded_uri.
Franzi
2016/05/22 12:34:08
Done.
| |
| 2110 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | |
| 2111 isolate, encodedURI, | |
| 2112 Object::ToString(isolate, args.atOrUndefined(isolate, 1))); | |
| 2113 return Uri::DecodeUri(isolate, encodedURI); | |
| 2114 } | |
| 2115 | |
| 2116 // ES6 section 18.2.6.3 decodeURIComponent (encodedURIComponent) | |
| 2117 BUILTIN(GlobalDecodeURIComponent) { | |
| 2118 HandleScope scope(isolate); | |
| 2119 Handle<String> encodedURIComponent; | |
|
Benedikt Meurer
2016/05/21 19:27:59
Nit: Please rename to encoded_uri_component.
Franzi
2016/05/22 12:34:08
Done. Changed it in encodeURIComponent as well.
| |
| 2120 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | |
| 2121 isolate, encodedURIComponent, | |
| 2122 Object::ToString(isolate, args.atOrUndefined(isolate, 1))); | |
| 2123 return Uri::DecodeUriComponent(isolate, encodedURIComponent); | |
| 2124 } | |
| 2125 | |
| 2106 // ES6 section 18.2.6.4 encodeURI (uri) | 2126 // ES6 section 18.2.6.4 encodeURI (uri) |
| 2107 BUILTIN(GlobalEncodeURI) { | 2127 BUILTIN(GlobalEncodeURI) { |
| 2108 HandleScope scope(isolate); | 2128 HandleScope scope(isolate); |
| 2109 Handle<String> uri; | 2129 Handle<String> uri; |
| 2110 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2130 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2111 isolate, uri, Object::ToString(isolate, args.atOrUndefined(isolate, 1))); | 2131 isolate, uri, Object::ToString(isolate, args.atOrUndefined(isolate, 1))); |
| 2112 | |
| 2113 return Uri::EncodeUri(isolate, uri); | 2132 return Uri::EncodeUri(isolate, uri); |
| 2114 } | 2133 } |
| 2115 | 2134 |
| 2116 // ES6 section 18.2.6.5 encodeURIComponenet (uriComponent) | 2135 // ES6 section 18.2.6.5 encodeURIComponenet (uriComponent) |
| 2117 BUILTIN(GlobalEncodeURIComponent) { | 2136 BUILTIN(GlobalEncodeURIComponent) { |
| 2118 HandleScope scope(isolate); | 2137 HandleScope scope(isolate); |
| 2119 Handle<String> uriComponent; | 2138 Handle<String> uriComponent; |
| 2120 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2139 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2121 isolate, uriComponent, | 2140 isolate, uriComponent, |
| 2122 Object::ToString(isolate, args.atOrUndefined(isolate, 1))); | 2141 Object::ToString(isolate, args.atOrUndefined(isolate, 1))); |
| 2123 | |
| 2124 return Uri::EncodeUriComponent(isolate, uriComponent); | 2142 return Uri::EncodeUriComponent(isolate, uriComponent); |
| 2125 } | 2143 } |
| 2126 | 2144 |
| 2127 namespace { | 2145 namespace { |
| 2128 | 2146 |
| 2129 bool CodeGenerationFromStringsAllowed(Isolate* isolate, | 2147 bool CodeGenerationFromStringsAllowed(Isolate* isolate, |
| 2130 Handle<Context> context) { | 2148 Handle<Context> context) { |
| 2131 DCHECK(context->allow_code_gen_from_strings()->IsFalse()); | 2149 DCHECK(context->allow_code_gen_from_strings()->IsFalse()); |
| 2132 // Check with callback if set. | 2150 // Check with callback if set. |
| 2133 AllowCodeGenerationFromStringsCallback callback = | 2151 AllowCodeGenerationFromStringsCallback callback = |
| (...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5516 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) | 5534 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) |
| 5517 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 5535 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 5518 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 5536 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 5519 #undef DEFINE_BUILTIN_ACCESSOR_C | 5537 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 5520 #undef DEFINE_BUILTIN_ACCESSOR_A | 5538 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 5521 #undef DEFINE_BUILTIN_ACCESSOR_T | 5539 #undef DEFINE_BUILTIN_ACCESSOR_T |
| 5522 #undef DEFINE_BUILTIN_ACCESSOR_H | 5540 #undef DEFINE_BUILTIN_ACCESSOR_H |
| 5523 | 5541 |
| 5524 } // namespace internal | 5542 } // namespace internal |
| 5525 } // namespace v8 | 5543 } // namespace v8 |
| OLD | NEW |