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

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

Issue 1543803002: Revert of [proxies] Better print for proxies in d8 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/js/collection.js ('k') | src/js/macros.py » ('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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } else { 181 } else {
182 return SerializeObject(value, replacer, stack, indent, gap); 182 return SerializeObject(value, replacer, stack, indent, gap);
183 } 183 }
184 } 184 }
185 // Undefined or a callable object. 185 // Undefined or a callable object.
186 return UNDEFINED; 186 return UNDEFINED;
187 } 187 }
188 188
189 189
190 function JSONStringify(value, replacer, space) { 190 function JSONStringify(value, replacer, space) {
191 if (%_ArgumentsLength() == 1 && !IS_PROXY(value)) { 191 if (%_ArgumentsLength() == 1 && !%_IsJSProxy(value)) {
192 return %BasicJSONStringify(value); 192 return %BasicJSONStringify(value);
193 } 193 }
194 if (!IS_CALLABLE(replacer) && %is_arraylike(replacer)) { 194 if (!IS_CALLABLE(replacer) && %is_arraylike(replacer)) {
195 var property_list = new InternalArray(); 195 var property_list = new InternalArray();
196 var seen_properties = new GlobalSet(); 196 var seen_properties = new GlobalSet();
197 var length = TO_LENGTH(replacer.length); 197 var length = TO_LENGTH(replacer.length);
198 for (var i = 0; i < length; i++) { 198 for (var i = 0; i < length; i++) {
199 var v = replacer[i]; 199 var v = replacer[i];
200 var item; 200 var item;
201 if (IS_STRING(v)) { 201 if (IS_STRING(v)) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 function JsonSerializeAdapter(key, object) { 254 function JsonSerializeAdapter(key, object) {
255 var holder = {}; 255 var holder = {};
256 holder[key] = object; 256 holder[key] = object;
257 // No need to pass the actual holder since there is no replacer function. 257 // No need to pass the actual holder since there is no replacer function.
258 return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", ""); 258 return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", "");
259 } 259 }
260 260
261 %InstallToContext(["json_serialize_adapter", JsonSerializeAdapter]); 261 %InstallToContext(["json_serialize_adapter", JsonSerializeAdapter]);
262 262
263 }) 263 })
OLDNEW
« no previous file with comments | « src/js/collection.js ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698