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

Unified Diff: src/accessors.cc

Issue 378583002: Revert "Treat ExecutableAccessorInfo as regular data properties." (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 | « no previous file | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index eb7e372851ae8c4a377c696066beee59bc0c5e4b..cfa2049aaeea253ca90b7cbef2f8cafe368ec686 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -191,7 +191,15 @@ void Accessors::ArrayLengthSetter(
Handle<JSObject> object = Handle<JSObject>::cast(
Utils::OpenHandle(*info.This()));
Handle<Object> value = Utils::OpenHandle(*val);
- ASSERT(object->IsJSArray());
+ // This means one of the object's prototypes is a JSArray and the
+ // object does not have a 'length' property. Calling SetProperty
+ // causes an infinite loop.
+ if (!object->IsJSArray()) {
+ MaybeHandle<Object> maybe_result = JSObject::SetOwnPropertyIgnoreAttributes(
+ object, isolate->factory()->length_string(), value, NONE);
+ maybe_result.Check();
+ return;
+ }
value = FlattenNumber(isolate, value);
@@ -862,7 +870,12 @@ static Handle<Object> SetFunctionPrototype(Isolate* isolate,
function = Handle<JSFunction>(function_raw, isolate);
}
- ASSERT(function->should_have_prototype());
+ if (!function->should_have_prototype()) {
+ // Since we hit this accessor, object will have no prototype property.
+ MaybeHandle<Object> maybe_result = JSObject::SetOwnPropertyIgnoreAttributes(
+ receiver, isolate->factory()->prototype_string(), value, NONE);
+ return maybe_result.ToHandleChecked();
+ }
Handle<Object> old_value;
bool is_observed = *function == *receiver && function->map()->is_observed();
« no previous file with comments | « no previous file | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698