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

Unified Diff: src/json-stringifier.h

Issue 11348209: Fix JSON.stringify for objects with interceptor handlers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-accessors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index 3866343328e36429982a1f9e7616351cae091fa7..80ef39507812207ac5dbaa690b51855bfd522793 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -76,9 +76,6 @@ class BasicJsonStringifier BASE_EMBEDDED {
}
}
- Handle<Object> GetProperty(Handle<JSObject> object,
- Handle<String> key);
-
Handle<Object> ApplyToJsonFunction(Handle<Object> object,
Handle<Object> key);
@@ -262,34 +259,6 @@ void BasicJsonStringifier::Append_(const Char* chars) {
}
-Handle<Object> BasicJsonStringifier::GetProperty(Handle<JSObject> object,
- Handle<String> key) {
- LookupResult lookup(isolate_);
- object->LocalLookupRealNamedProperty(*key, &lookup);
- if (!lookup.IsProperty()) return factory_->undefined_value();
- switch (lookup.type()) {
- case NORMAL: {
- Object* value = lookup.holder()->GetNormalizedProperty(&lookup);
- ASSERT(!value->IsTheHole());
- return Handle<Object>(value, isolate_);
- }
- case FIELD: {
- Object* value = lookup.holder()->FastPropertyAt(
- lookup.GetFieldIndex().field_index());
- ASSERT(!value->IsTheHole());
- return Handle<Object>(value, isolate_);
- }
- case CONSTANT_FUNCTION:
- return Handle<Object>(lookup.GetConstantFunction(), isolate_);
- default: {
- PropertyAttributes attr;
- return Object::GetProperty(object, object, &lookup, key, &attr);
- }
- }
- return Handle<Object>::null();
-}
-
-
Handle<Object> BasicJsonStringifier::ApplyToJsonFunction(
Handle<Object> object, Handle<Object> key) {
LookupResult lookup(isolate_);
@@ -400,8 +369,8 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeGeneric(
bool deferred_comma,
bool deferred_key) {
Handle<JSObject> builtins(isolate_->native_context()->builtins());
- Handle<JSFunction> builtin = Handle<JSFunction>::cast(
- v8::internal::GetProperty(builtins, "JSONSerializeAdapter"));
+ Handle<JSFunction> builtin =
+ Handle<JSFunction>::cast(GetProperty(builtins, "JSONSerializeAdapter"));
Handle<Object> argv[] = { key, object };
bool has_exception = false;
« no previous file with comments | « no previous file | test/cctest/test-accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698