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

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

Issue 1996333002: [json] handle access checks in BasicJsonStringifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@jsonstringifier
Patch Set: 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/contexts.h ('k') | src/json-stringifier.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return null; 273 return null;
274 } 274 }
275 return o.toISOString(); 275 return o.toISOString();
276 } 276 }
277 277
278 // Set up non-enumerable functions of the Date prototype object. 278 // Set up non-enumerable functions of the Date prototype object.
279 utils.InstallFunctions(GlobalDate.prototype, DONT_ENUM, [ 279 utils.InstallFunctions(GlobalDate.prototype, DONT_ENUM, [
280 "toJSON", DateToJSON 280 "toJSON", DateToJSON
281 ]); 281 ]);
282 282
283 // -------------------------------------------------------------------
284 // JSON Builtins
285
286 function JsonSerializeAdapter(key, object, indent, gap) {
287 var holder = {};
288 holder[key] = object;
289 // No need to pass the actual holder since there is no replacer function.
290 var current_indent = "";
291 for (var i = 0; i < indent; i++) current_indent += gap;
292 return JSONSerialize(
293 key, holder, UNDEFINED, new Stack(), current_indent, gap);
294 }
295
296 %InstallToContext(["json_serialize_adapter", JsonSerializeAdapter]);
297
298 }) 283 })
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/json-stringifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698