return SetPropertyWithAccessor(it, value, language_mode);
}
case LookupIterator::INTEGER_INDEXED_EXOTIC:
- done = true;
- break;
+ // TODO(verwaest): We should throw an exception.
+ return value;
case LookupIterator::DATA:
if (it->IsReadOnly()) {
break;
case LookupIterator::INTEGER_INDEXED_EXOTIC:
- return result;
+ return RedefineNonconfigurableProperty(it->isolate(), it->GetName(),
+ value, language_mode);
case LookupIterator::DATA: {
PropertyDetails details = own_lookup.property_details();
return WriteToReadOnlyProperty(it, value, language_mode);
}
- if (it->state() == LookupIterator::INTEGER_INDEXED_EXOTIC) return value;
+ DCHECK_NE(LookupIterator::INTEGER_INDEXED_EXOTIC, it->state());
Handle<JSObject> receiver = it->GetStoreTarget();
}
break;
- case LookupIterator::INTEGER_INDEXED_EXOTIC:
- return value;
-
case LookupIterator::ACCESSOR: {
Handle<Object> accessors = it->GetAccessors();
return value;
}
+ case LookupIterator::INTEGER_INDEXED_EXOTIC:
+ return RedefineNonconfigurableProperty(it->isolate(), it->GetName(),
+ value, STRICT);
+
case LookupIterator::DATA: {
PropertyDetails details = it->property_details();
Handle<Object> old_value = it->factory()->the_hole_value();
%OptimizeFunctionOnNextCall(f);
assertEquals(undefined, f());
-Object.defineProperty(new Int32Array(), "-1", {'value': 1});
-Object.defineProperty(new Int32Array(), "-0", {'value': 1});
-Object.defineProperty(new Int32Array(), "-10", {'value': 1});
-Object.defineProperty(new Int32Array(), "4294967295", {'value': 1});
+assertThrows('Object.defineProperty(new Int32Array(100), -1, {value: 1})');
+// -0 gets converted to the string "0", so use "-0" instead.
+assertThrows('Object.defineProperty(new Int32Array(100), "-0", {value: 1})');
+assertThrows('Object.defineProperty(new Int32Array(100), -10, {value: 1})');
+assertThrows('Object.defineProperty(new Int32Array(), 4294967295, {value: 1})');
check();