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

Side by Side Diff: src/builtins.cc

Issue 2010533002: [json] support replacer function in BasicJsonStringifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@jsonproplist
Patch Set: fix 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.h ('k') | src/js/array.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api-arguments.h" 7 #include "src/api-arguments.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
11 #include "src/bootstrapper.h" 11 #include "src/bootstrapper.h"
12 #include "src/code-factory.h" 12 #include "src/code-factory.h"
13 #include "src/code-stub-assembler.h" 13 #include "src/code-stub-assembler.h"
14 #include "src/dateparser-inl.h" 14 #include "src/dateparser-inl.h"
15 #include "src/elements.h" 15 #include "src/elements.h"
16 #include "src/frames-inl.h" 16 #include "src/frames-inl.h"
17 #include "src/gdb-jit.h" 17 #include "src/gdb-jit.h"
18 #include "src/ic/handler-compiler.h" 18 #include "src/ic/handler-compiler.h"
19 #include "src/ic/ic.h" 19 #include "src/ic/ic.h"
20 #include "src/isolate-inl.h" 20 #include "src/isolate-inl.h"
21 #include "src/json-stringifier.h"
21 #include "src/messages.h" 22 #include "src/messages.h"
22 #include "src/profiler/cpu-profiler.h" 23 #include "src/profiler/cpu-profiler.h"
23 #include "src/property-descriptor.h" 24 #include "src/property-descriptor.h"
24 #include "src/prototype.h" 25 #include "src/prototype.h"
25 #include "src/string-builder.h" 26 #include "src/string-builder.h"
26 #include "src/uri.h" 27 #include "src/uri.h"
27 #include "src/vm-state-inl.h" 28 #include "src/vm-state-inl.h"
28 29
29 namespace v8 { 30 namespace v8 {
30 namespace internal { 31 namespace internal {
(...skipping 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 Handle<JSFunction> function; 2173 Handle<JSFunction> function;
2173 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2174 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2174 isolate, function, 2175 isolate, function,
2175 CompileString(handle(target->native_context(), isolate), 2176 CompileString(handle(target->native_context(), isolate),
2176 Handle<String>::cast(x), NO_PARSE_RESTRICTION)); 2177 Handle<String>::cast(x), NO_PARSE_RESTRICTION));
2177 RETURN_RESULT_OR_FAILURE( 2178 RETURN_RESULT_OR_FAILURE(
2178 isolate, 2179 isolate,
2179 Execution::Call(isolate, function, target_global_proxy, 0, nullptr)); 2180 Execution::Call(isolate, function, target_global_proxy, 0, nullptr));
2180 } 2181 }
2181 2182
2183 // ES6 section 24.3.2 JSON.stringify.
2184 BUILTIN(JsonStringify) {
2185 HandleScope scope(isolate);
2186 JsonStringifier stringifier(isolate);
2187 Handle<Object> object = args.atOrUndefined(isolate, 1);
2188 Handle<Object> replacer = args.atOrUndefined(isolate, 2);
2189 Handle<Object> indent = args.atOrUndefined(isolate, 3);
2190 RETURN_RESULT_OR_FAILURE(isolate,
2191 stringifier.Stringify(object, replacer, indent));
2192 }
2182 2193
2183 // ----------------------------------------------------------------------------- 2194 // -----------------------------------------------------------------------------
2184 // ES6 section 20.2.2 Function Properties of the Math Object 2195 // ES6 section 20.2.2 Function Properties of the Math Object
2185 2196
2186 2197
2187 // ES6 section 20.2.2.2 Math.acos ( x ) 2198 // ES6 section 20.2.2.2 Math.acos ( x )
2188 BUILTIN(MathAcos) { 2199 BUILTIN(MathAcos) {
2189 HandleScope scope(isolate); 2200 HandleScope scope(isolate);
2190 DCHECK_EQ(2, args.length()); 2201 DCHECK_EQ(2, args.length());
2191 Handle<Object> x = args.at<Object>(1); 2202 Handle<Object> x = args.at<Object>(1);
(...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after
5532 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) 5543 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)
5533 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 5544 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
5534 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 5545 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
5535 #undef DEFINE_BUILTIN_ACCESSOR_C 5546 #undef DEFINE_BUILTIN_ACCESSOR_C
5536 #undef DEFINE_BUILTIN_ACCESSOR_A 5547 #undef DEFINE_BUILTIN_ACCESSOR_A
5537 #undef DEFINE_BUILTIN_ACCESSOR_T 5548 #undef DEFINE_BUILTIN_ACCESSOR_T
5538 #undef DEFINE_BUILTIN_ACCESSOR_H 5549 #undef DEFINE_BUILTIN_ACCESSOR_H
5539 5550
5540 } // namespace internal 5551 } // namespace internal
5541 } // namespace v8 5552 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/js/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698