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

Side by Side Diff: src/runtime/runtime-object.cc

Issue 1922603006: [JSON] implement indentation in the BasicJsonStringifier and expose via API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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/runtime/runtime-json.cc ('k') | src/string-builder.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 LookupIterator it = 220 LookupIterator it =
221 LookupIterator::PropertyOrElement(isolate, object, key, &success); 221 LookupIterator::PropertyOrElement(isolate, object, key, &success);
222 if (!success) return MaybeHandle<Object>(); 222 if (!success) return MaybeHandle<Object>();
223 223
224 MAYBE_RETURN_NULL(Object::SetProperty(&it, value, language_mode, 224 MAYBE_RETURN_NULL(Object::SetProperty(&it, value, language_mode,
225 Object::MAY_BE_STORE_FROM_KEYED)); 225 Object::MAY_BE_STORE_FROM_KEYED));
226 return value; 226 return value;
227 } 227 }
228 228
229 MaybeHandle<Object> Runtime::BasicJsonStringify(Isolate* isolate, 229 MaybeHandle<Object> Runtime::BasicJsonStringify(Isolate* isolate,
230 Handle<Object> object) { 230 Handle<Object> object,
231 return BasicJsonStringifier(isolate).Stringify(object); 231 Handle<String> gap) {
232 return BasicJsonStringifier(isolate, gap).Stringify(object);
232 } 233 }
233 234
234 MaybeHandle<Object> Runtime::BasicJsonStringifyString(Isolate* isolate, 235 MaybeHandle<Object> Runtime::BasicJsonStringifyString(Isolate* isolate,
235 Handle<String> string) { 236 Handle<String> string) {
236 return BasicJsonStringifier::StringifyString(isolate, string); 237 return BasicJsonStringifier::StringifyString(isolate, string);
237 } 238 }
238 239
239 RUNTIME_FUNCTION(Runtime_GetPrototype) { 240 RUNTIME_FUNCTION(Runtime_GetPrototype) {
240 HandleScope scope(isolate); 241 HandleScope scope(isolate);
241 DCHECK(args.length() == 1); 242 DCHECK(args.length() == 1);
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 isolate, o, key, &success, LookupIterator::OWN); 1029 isolate, o, key, &success, LookupIterator::OWN);
1029 if (!success) return isolate->heap()->exception(); 1030 if (!success) return isolate->heap()->exception();
1030 MAYBE_RETURN( 1031 MAYBE_RETURN(
1031 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), 1032 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR),
1032 isolate->heap()->exception()); 1033 isolate->heap()->exception());
1033 return *value; 1034 return *value;
1034 } 1035 }
1035 1036
1036 } // namespace internal 1037 } // namespace internal
1037 } // namespace v8 1038 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-json.cc ('k') | src/string-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698