| Index: src/objects.cc
|
| ===================================================================
|
| --- src/objects.cc (revision 7051)
|
| +++ src/objects.cc (working copy)
|
| @@ -1474,14 +1474,14 @@
|
| String* name,
|
| Object* value,
|
| PropertyAttributes attributes,
|
| - StrictModeFlag strict) {
|
| + StrictModeFlag strict_mode) {
|
| // Check local property, ignore interceptor.
|
| LookupResult result;
|
| LocalLookupRealNamedProperty(name, &result);
|
| if (result.IsFound()) {
|
| // An existing property, a map transition or a null descriptor was
|
| // found. Use set property to handle all these cases.
|
| - return SetProperty(&result, name, value, attributes, strict);
|
| + return SetProperty(&result, name, value, attributes, strict_mode);
|
| }
|
| // Add a new real property.
|
| return AddProperty(name, value, attributes);
|
| @@ -1608,7 +1608,7 @@
|
| String* name,
|
| Object* value,
|
| PropertyAttributes attributes,
|
| - StrictModeFlag strict) {
|
| + StrictModeFlag strict_mode) {
|
| Isolate* isolate = GetIsolate();
|
| HandleScope scope(isolate);
|
| Handle<JSObject> this_handle(this);
|
| @@ -1640,7 +1640,7 @@
|
| this_handle->SetPropertyPostInterceptor(*name_handle,
|
| *value_handle,
|
| attributes,
|
| - strict);
|
| + strict_mode);
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| return raw_result;
|
| }
|
| @@ -1649,10 +1649,10 @@
|
| MaybeObject* JSObject::SetProperty(String* name,
|
| Object* value,
|
| PropertyAttributes attributes,
|
| - StrictModeFlag strict) {
|
| + StrictModeFlag strict_mode) {
|
| LookupResult result;
|
| LocalLookup(name, &result);
|
| - return SetProperty(&result, name, value, attributes, strict);
|
| + return SetProperty(&result, name, value, attributes, strict_mode);
|
| }
|
|
|
|
|
| @@ -1942,7 +1942,7 @@
|
| String* name,
|
| Object* value,
|
| PropertyAttributes attributes,
|
| - StrictModeFlag strict) {
|
| + StrictModeFlag strict_mode) {
|
| Heap* heap = GetHeap();
|
| // Make sure that the top context does not change when doing callbacks or
|
| // interceptor calls.
|
| @@ -1971,7 +1971,7 @@
|
| if (proto->IsNull()) return value;
|
| ASSERT(proto->IsJSGlobalObject());
|
| return JSObject::cast(proto)->SetProperty(
|
| - result, name, value, attributes, strict);
|
| + result, name, value, attributes, strict_mode);
|
| }
|
|
|
| if (!result->IsProperty() && !IsJSContextExtensionObject()) {
|
| @@ -1991,7 +1991,7 @@
|
| return AddProperty(name, value, attributes);
|
| }
|
| if (result->IsReadOnly() && result->IsProperty()) {
|
| - if (strict == kStrictMode) {
|
| + if (strict_mode == kStrictMode) {
|
| HandleScope scope;
|
| Handle<String> key(name);
|
| Handle<Object> holder(this);
|
| @@ -2030,7 +2030,7 @@
|
| value,
|
| result->holder());
|
| case INTERCEPTOR:
|
| - return SetPropertyWithInterceptor(name, value, attributes, strict);
|
| + return SetPropertyWithInterceptor(name, value, attributes, strict_mode);
|
| case CONSTANT_TRANSITION: {
|
| // If the same constant function is being added we can simply
|
| // transition to the target map.
|
| @@ -5650,6 +5650,10 @@
|
|
|
|
|
| Object* JSFunction::RemovePrototype() {
|
| + if (map() == context()->global_context()->function_without_prototype_map()) {
|
| + // Be idempotent.
|
| + return this;
|
| + }
|
| ASSERT(map() == context()->global_context()->function_map());
|
| Heap* heap = GetHeap();
|
| set_map(context()->global_context()->function_without_prototype_map());
|
| @@ -6635,13 +6639,6 @@
|
| }
|
|
|
|
|
| -// Computes the new capacity when expanding the elements of a JSObject.
|
| -static int NewElementsCapacity(int old_capacity) {
|
| - // (old_capacity + 50%) + 16
|
| - return old_capacity + (old_capacity >> 1) + 16;
|
| -}
|
| -
|
| -
|
| static Failure* ArrayLengthRangeError(Heap* heap) {
|
| HandleScope scope;
|
| return heap->isolate()->Throw(
|
|
|