From 30bd09cbd69ba8f7da7e131ecf71573c5f7cedf3 Mon Sep 17 00:00:00 2001 From: "mmaly@chromium.org" Date: Thu, 3 Mar 2011 16:17:28 +0000 Subject: [PATCH] Renaming strict to strict_mode for uniformity. Review URL: http://codereview.chromium.org/6611003/ git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/handles.cc | 12 ++++++------ src/handles.h | 6 +++--- src/objects.cc | 20 ++++++++++---------- src/objects.h | 8 ++++---- src/runtime.cc | 26 +++++++++++++++----------- src/runtime.h | 2 +- src/stub-cache.cc | 6 +++--- 7 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/handles.cc b/src/handles.cc index 05c81bb..d91855c 100644 --- a/src/handles.cc +++ b/src/handles.cc @@ -243,8 +243,8 @@ Handle SetProperty(Handle object, Handle key, Handle value, PropertyAttributes attributes, - StrictModeFlag strict) { - CALL_HEAP_FUNCTION(object->SetProperty(*key, *value, attributes, strict), + StrictModeFlag strict_mode) { + CALL_HEAP_FUNCTION(object->SetProperty(*key, *value, attributes, strict_mode), Object); } @@ -253,9 +253,9 @@ Handle SetProperty(Handle object, Handle key, Handle value, PropertyAttributes attributes, - StrictModeFlag strict) { + StrictModeFlag strict_mode) { CALL_HEAP_FUNCTION( - Runtime::SetObjectProperty(object, key, value, attributes, strict), + Runtime::SetObjectProperty(object, key, value, attributes, strict_mode), Object); } @@ -309,11 +309,11 @@ Handle SetPropertyWithInterceptor(Handle object, Handle key, Handle value, PropertyAttributes attributes, - StrictModeFlag strict) { + StrictModeFlag strict_mode) { CALL_HEAP_FUNCTION(object->SetPropertyWithInterceptor(*key, *value, attributes, - strict), + strict_mode), Object); } diff --git a/src/handles.h b/src/handles.h index 9d3588b..ccdf4d5 100644 --- a/src/handles.h +++ b/src/handles.h @@ -224,13 +224,13 @@ Handle SetProperty(Handle object, Handle key, Handle value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); Handle SetProperty(Handle object, Handle key, Handle value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); Handle ForceSetProperty(Handle object, Handle key, @@ -262,7 +262,7 @@ Handle SetPropertyWithInterceptor(Handle object, Handle key, Handle value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); Handle SetElement(Handle object, uint32_t index, diff --git a/src/objects.cc b/src/objects.cc index aa485df..a081b59 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -1445,14 +1445,14 @@ MaybeObject* JSObject::SetPropertyPostInterceptor( 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); @@ -1578,7 +1578,7 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( String* name, Object* value, PropertyAttributes attributes, - StrictModeFlag strict) { + StrictModeFlag strict_mode) { HandleScope scope; Handle this_handle(this); Handle name_handle(name); @@ -1608,7 +1608,7 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( this_handle->SetPropertyPostInterceptor(*name_handle, *value_handle, attributes, - strict); + strict_mode); RETURN_IF_SCHEDULED_EXCEPTION(); return raw_result; } @@ -1617,10 +1617,10 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( 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); } @@ -1901,7 +1901,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, String* name, Object* value, PropertyAttributes attributes, - StrictModeFlag strict) { + StrictModeFlag strict_mode) { // Make sure that the top context does not change when doing callbacks or // interceptor calls. AssertNoContextChange ncc; @@ -1929,7 +1929,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, 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()) { @@ -1949,7 +1949,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, return AddProperty(name, value, attributes); } if (result->IsReadOnly() && result->IsProperty()) { - if (strict == kStrictMode) { + if (strict_mode == kStrictMode) { HandleScope scope; Handle key(name); Handle holder(this); @@ -1988,7 +1988,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, 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. diff --git a/src/objects.h b/src/objects.h index e9e9f63..fc1c73a 100644 --- a/src/objects.h +++ b/src/objects.h @@ -1362,12 +1362,12 @@ class JSObject: public HeapObject { MUST_USE_RESULT MaybeObject* SetProperty(String* key, Object* value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result, String* key, Object* value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck( LookupResult* result, String* name, @@ -1383,12 +1383,12 @@ class JSObject: public HeapObject { String* name, Object* value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( String* name, Object* value, PropertyAttributes attributes, - StrictModeFlag strict); + StrictModeFlag strict_mode); MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( String* key, Object* value, diff --git a/src/runtime.cc b/src/runtime.cc index f7b6ad4..4a5d3b9 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -3784,7 +3784,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle object, Handle key, Handle value, PropertyAttributes attr, - StrictModeFlag strict) { + StrictModeFlag strict_mode) { HandleScope scope; if (object->IsUndefined() || object->IsNull()) { @@ -3827,7 +3827,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle object, } else { Handle key_string = Handle::cast(key); key_string->TryFlatten(); - result = SetProperty(js_object, key_string, value, attr, strict); + result = SetProperty(js_object, key_string, value, attr, strict_mode); } if (result.is_null()) return Failure::Exception(); return *value; @@ -3843,7 +3843,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle object, // TODO(1220): Implement SetElement strict mode. return js_object->SetElement(index, *value); } else { - return js_object->SetProperty(*name, *value, attr, strict); + return js_object->SetProperty(*name, *value, attr, strict_mode); } } @@ -3947,15 +3947,19 @@ static MaybeObject* Runtime_SetProperty(Arguments args) { PropertyAttributes attributes = static_cast(unchecked_attributes); - StrictModeFlag strict = kNonStrictMode; + StrictModeFlag strict_mode = kNonStrictMode; if (args.length() == 5) { CONVERT_SMI_CHECKED(strict_unchecked, args[4]); RUNTIME_ASSERT(strict_unchecked == kStrictMode || strict_unchecked == kNonStrictMode); - strict = static_cast(strict_unchecked); + strict_mode = static_cast(strict_unchecked); } - return Runtime::SetObjectProperty(object, key, value, attributes, strict); + return Runtime::SetObjectProperty(object, + key, + value, + attributes, + strict_mode); } @@ -7545,8 +7549,7 @@ static MaybeObject* Runtime_StoreContextSlot(Arguments args) { CONVERT_SMI_CHECKED(strict_unchecked, args[3]); RUNTIME_ASSERT(strict_unchecked == kStrictMode || strict_unchecked == kNonStrictMode); - StrictModeFlag strict = static_cast(strict_unchecked); - + StrictModeFlag strict_mode = static_cast(strict_unchecked); int index; PropertyAttributes attributes; @@ -7590,11 +7593,12 @@ static MaybeObject* Runtime_StoreContextSlot(Arguments args) { // extension object itself. if ((attributes & READ_ONLY) == 0 || (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) { - RETURN_IF_EMPTY_HANDLE(SetProperty(context_ext, name, value, NONE, strict)); - } else if (strict == kStrictMode && (attributes & READ_ONLY) != 0) { + RETURN_IF_EMPTY_HANDLE( + SetProperty(context_ext, name, value, NONE, strict_mode)); + } else if (strict_mode == kStrictMode && (attributes & READ_ONLY) != 0) { // Setting read only property in strict mode. Handle error = - Factory::NewTypeError("strict_cannot_assign", HandleVector(&name, 1)); + Factory::NewTypeError("strict_cannot_assign", HandleVector(&name, 1)); return Top::Throw(*error); } return *value; diff --git a/src/runtime.h b/src/runtime.h index 9dd6eda..8e73d5c 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -553,7 +553,7 @@ class Runtime : public AllStatic { Handle key, Handle value, PropertyAttributes attr, - StrictModeFlag strict); + StrictModeFlag strict_mode); MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty( Handle object, diff --git a/src/stub-cache.cc b/src/stub-cache.cc index 360f0b7..f23f382 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -1429,13 +1429,13 @@ MaybeObject* StoreInterceptorProperty(Arguments args) { JSObject* recv = JSObject::cast(args[0]); String* name = String::cast(args[1]); Object* value = args[2]; - StrictModeFlag strict = + StrictModeFlag strict_mode = static_cast(Smi::cast(args[3])->value()); - ASSERT(strict == kStrictMode || strict == kNonStrictMode); + ASSERT(strict_mode == kStrictMode || strict_mode == kNonStrictMode); ASSERT(recv->HasNamedInterceptor()); PropertyAttributes attr = NONE; MaybeObject* result = recv->SetPropertyWithInterceptor( - name, value, attr, strict); + name, value, attr, strict_mode); return result; } -- 2.7.4