Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Unified Diff: src/builtins.cc

Issue 1983593002: [builtins] Move EncodeURI from runtime to builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.h ('k') | src/js/uri.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 77d4b3a87ce68835eddc4bdc0a21eb90481ab5f8..5ff55d9e9d76764f3875bdbbf3d17db3feddeec0 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -23,6 +23,7 @@
#include "src/property-descriptor.h"
#include "src/prototype.h"
#include "src/string-builder.h"
+#include "src/uri.h"
#include "src/vm-state-inl.h"
namespace v8 {
@@ -2106,6 +2107,26 @@ BUILTIN(ObjectSeal) {
return *object;
}
+// ES6 section 18.2.6.4 encodeURI (uri)
+BUILTIN(GlobalEncodeURI) {
+ HandleScope scope(isolate);
+ Handle<String> uri;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, uri, Object::ToString(isolate, args.atOrUndefined(isolate, 1)));
+
+ return Uri::EncodeUri(isolate, uri);
+}
+
+// ES6 section 18.2.6.5 encodeURIComponenet (uriComponent)
+BUILTIN(GlobalEncodeURIComponent) {
+ HandleScope scope(isolate);
+ Handle<String> uriComponent;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, uriComponent,
+ Object::ToString(isolate, args.atOrUndefined(isolate, 1)));
+
+ return Uri::EncodeUriComponent(isolate, uriComponent);
+}
namespace {
« no previous file with comments | « src/builtins.h ('k') | src/js/uri.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698