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

Side by Side Diff: src/json-stringifier.h

Issue 253843006: Object::Lookup(), JSObject::*Lookup*() and JSReceiver::*Lookup*() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/ic.cc ('k') | src/objects.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 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 #ifndef V8_JSON_STRINGIFIER_H_ 5 #ifndef V8_JSON_STRINGIFIER_H_
6 #define V8_JSON_STRINGIFIER_H_ 6 #define V8_JSON_STRINGIFIER_H_
7 7
8 #include "v8.h" 8 #include "v8.h"
9 #include "conversions.h" 9 #include "conversions.h"
10 #include "utils.h" 10 #include "utils.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 template <bool is_ascii, typename Char> 333 template <bool is_ascii, typename Char>
334 void BasicJsonStringifier::Append_(const Char* chars) { 334 void BasicJsonStringifier::Append_(const Char* chars) {
335 for ( ; *chars != '\0'; chars++) Append_<is_ascii, Char>(*chars); 335 for ( ; *chars != '\0'; chars++) Append_<is_ascii, Char>(*chars);
336 } 336 }
337 337
338 338
339 MaybeHandle<Object> BasicJsonStringifier::ApplyToJsonFunction( 339 MaybeHandle<Object> BasicJsonStringifier::ApplyToJsonFunction(
340 Handle<Object> object, Handle<Object> key) { 340 Handle<Object> object, Handle<Object> key) {
341 LookupResult lookup(isolate_); 341 LookupResult lookup(isolate_);
342 JSObject::cast(*object)->LookupRealNamedProperty(*tojson_string_, &lookup); 342 JSObject::cast(*object)->LookupRealNamedProperty(tojson_string_, &lookup);
343 if (!lookup.IsProperty()) return object; 343 if (!lookup.IsProperty()) return object;
344 PropertyAttributes attr; 344 PropertyAttributes attr;
345 Handle<Object> fun; 345 Handle<Object> fun;
346 ASSIGN_RETURN_ON_EXCEPTION( 346 ASSIGN_RETURN_ON_EXCEPTION(
347 isolate_, fun, 347 isolate_, fun,
348 Object::GetProperty(object, object, &lookup, tojson_string_, &attr), 348 Object::GetProperty(object, object, &lookup, tojson_string_, &attr),
349 Object); 349 Object);
350 if (!fun->IsJSFunction()) return object; 350 if (!fun->IsJSFunction()) return object;
351 351
352 // Call toJSON function. 352 // Call toJSON function.
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 SerializeString_<false, uint8_t>(object); 875 SerializeString_<false, uint8_t>(object);
876 } else { 876 } else {
877 SerializeString_<false, uc16>(object); 877 SerializeString_<false, uc16>(object);
878 } 878 }
879 } 879 }
880 } 880 }
881 881
882 } } // namespace v8::internal 882 } } // namespace v8::internal
883 883
884 #endif // V8_JSON_STRINGIFIER_H_ 884 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698