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

Unified Diff: src/objects.cc

Issue 407953002: Support setting named properties on non-JSObjects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index abd018770bbcaf37dbf552ea06ebfa6d7cc92f13..9939927222578657e4f83921efb374506f39175f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -471,6 +471,8 @@ MaybeHandle<Object> Object::SetPropertyWithAccessor(
// value since a const declaration would conflict with the setter.
ASSERT(!structure->IsForeign());
if (structure->IsExecutableAccessorInfo()) {
+ // Don't call executable accessor setters with non-JSObject receivers.
+ if (!receiver->IsJSObject()) return value;
// api style callbacks
ExecutableAccessorInfo* data = ExecutableAccessorInfo::cast(*structure);
if (!data->IsCompatibleReceiver(*receiver)) {
@@ -554,10 +556,9 @@ MaybeHandle<Object> Object::SetPropertyWithDefinedSetter(
}
Handle<Object> argv[] = { value };
- RETURN_ON_EXCEPTION(
- isolate,
- Execution::Call(isolate, setter, receiver, ARRAY_SIZE(argv), argv),
- Object);
+ RETURN_ON_EXCEPTION(isolate, Execution::Call(isolate, setter, receiver,
+ ARRAY_SIZE(argv), argv, true),
+ Object);
return value;
}
@@ -2959,13 +2960,12 @@ MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(LookupIterator* it,
}
-MaybeHandle<Object> JSReceiver::SetProperty(Handle<JSReceiver> object,
- Handle<Name> name,
- Handle<Object> value,
- StrictMode strict_mode,
- StoreFromKeyed store_mode) {
+MaybeHandle<Object> Object::SetProperty(Handle<Object> object,
+ Handle<Name> name, Handle<Object> value,
+ StrictMode strict_mode,
+ StoreFromKeyed store_mode) {
LookupIterator it(object, name);
- return Object::SetProperty(&it, value, strict_mode, store_mode);
+ return SetProperty(&it, value, strict_mode, store_mode);
}
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698