Remove one more case behind --es5_readonly flag.

Plus add a couple of assertions.

R=mstarzinger@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10535011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11719 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
rossberg@chromium.org 2012-06-05 16:56:53 +00:00
parent eba324f9b1
commit 4ea1fc0d27
4 changed files with 6 additions and 0 deletions

View File

@ -4684,6 +4684,7 @@ HInstruction* HGraphBuilder::BuildStoreNamedField(HValue* object,
} else {
// Otherwise, find the top prototype.
while (proto->GetPrototype()->IsJSObject()) proto = proto->GetPrototype();
ASSERT(proto->GetPrototype()->IsNull());
}
ASSERT(proto->IsJSObject());
AddInstruction(new(zone()) HCheckPrototypeMaps(

View File

@ -2117,6 +2117,7 @@ MaybeObject* JSObject::SetPropertyViaPrototypes(
break;
}
case CALLBACKS: {
if (!FLAG_es5_readonly && result.IsReadOnly()) break;
*done = true;
return SetPropertyWithCallback(result.GetCallbackObject(),
name, value, result.holder(), strict_mode);
@ -2550,6 +2551,7 @@ void JSObject::LookupRealNamedPropertyInPrototypes(String* name,
return result->HandlerResult(JSProxy::cast(pt));
}
JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result);
ASSERT(!(result->IsProperty() && result->type() == INTERCEPTOR));
if (result->IsProperty()) return;
}
result->NotFound();

View File

@ -10260,6 +10260,7 @@ static v8::Handle<Value> ChildGetter(Local<String> name,
THREADED_TEST(Overriding) {
i::FLAG_es5_readonly = true;
v8::HandleScope scope;
LocalContext context;

View File

@ -27,6 +27,8 @@
// Test that readonly variables are treated correctly.
// Flags: --es5_readonly
// Create an object with a read-only length property in the prototype
// chain by putting the string split function in the prototype chain.
var o = {};