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

Side by Side Diff: src/js/uri.js

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 unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 // This file contains support for URI manipulations written in 5 // This file contains support for URI manipulations written in
6 // JavaScript. 6 // JavaScript.
7 7
8 (function(global, utils) { 8 (function(global, utils) {
9 9
10 "use strict"; 10 "use strict";
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 }; 212 };
213 return Decode(uri, reservedPredicate); 213 return Decode(uri, reservedPredicate);
214 } 214 }
215 215
216 // ECMA-262 - 15.1.3.2. 216 // ECMA-262 - 15.1.3.2.
217 function URIDecodeComponent(component) { 217 function URIDecodeComponent(component) {
218 var reservedPredicate = function(cc) { return false; }; 218 var reservedPredicate = function(cc) { return false; };
219 return Decode(component, reservedPredicate); 219 return Decode(component, reservedPredicate);
220 } 220 }
221 221
222 // ECMA-262 - 15.1.3.3.
223 function URIEncode(uri) {
224 uri = TO_STRING(uri);
225 return %URIEncode(uri, true);
226 }
227
228 // ECMA-262 - 15.1.3.4
229 function URIEncodeComponent(component) {
230 component = TO_STRING(component);
231 return %URIEncode(component, false);
232 }
233
234 // ------------------------------------------------------------------- 222 // -------------------------------------------------------------------
235 // Install exported functions. 223 // Install exported functions.
236 224
237 // Set up non-enumerable URI functions on the global object and set 225 // Set up non-enumerable URI functions on the global object and set
238 // their names. 226 // their names.
239 utils.InstallFunctions(global, DONT_ENUM, [ 227 utils.InstallFunctions(global, DONT_ENUM, [
240 "escape", URIEscapeJS, 228 "escape", URIEscapeJS,
241 "unescape", URIUnescapeJS, 229 "unescape", URIUnescapeJS,
242 "decodeURI", URIDecode, 230 "decodeURI", URIDecode,
243 "decodeURIComponent", URIDecodeComponent, 231 "decodeURIComponent", URIDecodeComponent
244 "encodeURI", URIEncode,
245 "encodeURIComponent", URIEncodeComponent
246 ]); 232 ]);
247 233
248 }) 234 })
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698