Commit 30bd09cb authored by mmaly@chromium.org's avatar mmaly@chromium.org

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
parent 9cc9ecbf
...@@ -243,8 +243,8 @@ Handle<Object> SetProperty(Handle<JSObject> object, ...@@ -243,8 +243,8 @@ Handle<Object> SetProperty(Handle<JSObject> object,
Handle<String> key, Handle<String> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
CALL_HEAP_FUNCTION(object->SetProperty(*key, *value, attributes, strict), CALL_HEAP_FUNCTION(object->SetProperty(*key, *value, attributes, strict_mode),
Object); Object);
} }
...@@ -253,9 +253,9 @@ Handle<Object> SetProperty(Handle<Object> object, ...@@ -253,9 +253,9 @@ Handle<Object> SetProperty(Handle<Object> object,
Handle<Object> key, Handle<Object> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
CALL_HEAP_FUNCTION( CALL_HEAP_FUNCTION(
Runtime::SetObjectProperty(object, key, value, attributes, strict), Runtime::SetObjectProperty(object, key, value, attributes, strict_mode),
Object); Object);
} }
...@@ -309,11 +309,11 @@ Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object, ...@@ -309,11 +309,11 @@ Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object,
Handle<String> key, Handle<String> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
CALL_HEAP_FUNCTION(object->SetPropertyWithInterceptor(*key, CALL_HEAP_FUNCTION(object->SetPropertyWithInterceptor(*key,
*value, *value,
attributes, attributes,
strict), strict_mode),
Object); Object);
} }
......
...@@ -224,13 +224,13 @@ Handle<Object> SetProperty(Handle<JSObject> object, ...@@ -224,13 +224,13 @@ Handle<Object> SetProperty(Handle<JSObject> object,
Handle<String> key, Handle<String> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
Handle<Object> SetProperty(Handle<Object> object, Handle<Object> SetProperty(Handle<Object> object,
Handle<Object> key, Handle<Object> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
Handle<Object> ForceSetProperty(Handle<JSObject> object, Handle<Object> ForceSetProperty(Handle<JSObject> object,
Handle<Object> key, Handle<Object> key,
...@@ -262,7 +262,7 @@ Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object, ...@@ -262,7 +262,7 @@ Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object,
Handle<String> key, Handle<String> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
Handle<Object> SetElement(Handle<JSObject> object, Handle<Object> SetElement(Handle<JSObject> object,
uint32_t index, uint32_t index,
......
...@@ -1445,14 +1445,14 @@ MaybeObject* JSObject::SetPropertyPostInterceptor( ...@@ -1445,14 +1445,14 @@ MaybeObject* JSObject::SetPropertyPostInterceptor(
String* name, String* name,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
// Check local property, ignore interceptor. // Check local property, ignore interceptor.
LookupResult result; LookupResult result;
LocalLookupRealNamedProperty(name, &result); LocalLookupRealNamedProperty(name, &result);
if (result.IsFound()) { if (result.IsFound()) {
// An existing property, a map transition or a null descriptor was // An existing property, a map transition or a null descriptor was
// found. Use set property to handle all these cases. // 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. // Add a new real property.
return AddProperty(name, value, attributes); return AddProperty(name, value, attributes);
...@@ -1578,7 +1578,7 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( ...@@ -1578,7 +1578,7 @@ MaybeObject* JSObject::SetPropertyWithInterceptor(
String* name, String* name,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
HandleScope scope; HandleScope scope;
Handle<JSObject> this_handle(this); Handle<JSObject> this_handle(this);
Handle<String> name_handle(name); Handle<String> name_handle(name);
...@@ -1608,7 +1608,7 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( ...@@ -1608,7 +1608,7 @@ MaybeObject* JSObject::SetPropertyWithInterceptor(
this_handle->SetPropertyPostInterceptor(*name_handle, this_handle->SetPropertyPostInterceptor(*name_handle,
*value_handle, *value_handle,
attributes, attributes,
strict); strict_mode);
RETURN_IF_SCHEDULED_EXCEPTION(); RETURN_IF_SCHEDULED_EXCEPTION();
return raw_result; return raw_result;
} }
...@@ -1617,10 +1617,10 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( ...@@ -1617,10 +1617,10 @@ MaybeObject* JSObject::SetPropertyWithInterceptor(
MaybeObject* JSObject::SetProperty(String* name, MaybeObject* JSObject::SetProperty(String* name,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
LookupResult result; LookupResult result;
LocalLookup(name, &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, ...@@ -1901,7 +1901,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result,
String* name, String* name,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
// Make sure that the top context does not change when doing callbacks or // Make sure that the top context does not change when doing callbacks or
// interceptor calls. // interceptor calls.
AssertNoContextChange ncc; AssertNoContextChange ncc;
...@@ -1929,7 +1929,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, ...@@ -1929,7 +1929,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result,
if (proto->IsNull()) return value; if (proto->IsNull()) return value;
ASSERT(proto->IsJSGlobalObject()); ASSERT(proto->IsJSGlobalObject());
return JSObject::cast(proto)->SetProperty( return JSObject::cast(proto)->SetProperty(
result, name, value, attributes, strict); result, name, value, attributes, strict_mode);
} }
if (!result->IsProperty() && !IsJSContextExtensionObject()) { if (!result->IsProperty() && !IsJSContextExtensionObject()) {
...@@ -1949,7 +1949,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, ...@@ -1949,7 +1949,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result,
return AddProperty(name, value, attributes); return AddProperty(name, value, attributes);
} }
if (result->IsReadOnly() && result->IsProperty()) { if (result->IsReadOnly() && result->IsProperty()) {
if (strict == kStrictMode) { if (strict_mode == kStrictMode) {
HandleScope scope; HandleScope scope;
Handle<String> key(name); Handle<String> key(name);
Handle<Object> holder(this); Handle<Object> holder(this);
...@@ -1988,7 +1988,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result, ...@@ -1988,7 +1988,7 @@ MaybeObject* JSObject::SetProperty(LookupResult* result,
value, value,
result->holder()); result->holder());
case INTERCEPTOR: case INTERCEPTOR:
return SetPropertyWithInterceptor(name, value, attributes, strict); return SetPropertyWithInterceptor(name, value, attributes, strict_mode);
case CONSTANT_TRANSITION: { case CONSTANT_TRANSITION: {
// If the same constant function is being added we can simply // If the same constant function is being added we can simply
// transition to the target map. // transition to the target map.
......
...@@ -1362,12 +1362,12 @@ class JSObject: public HeapObject { ...@@ -1362,12 +1362,12 @@ class JSObject: public HeapObject {
MUST_USE_RESULT MaybeObject* SetProperty(String* key, MUST_USE_RESULT MaybeObject* SetProperty(String* key,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result, MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result,
String* key, String* key,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck( MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck(
LookupResult* result, LookupResult* result,
String* name, String* name,
...@@ -1383,12 +1383,12 @@ class JSObject: public HeapObject { ...@@ -1383,12 +1383,12 @@ class JSObject: public HeapObject {
String* name, String* name,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor(
String* name, String* name,
Object* value, Object* value,
PropertyAttributes attributes, PropertyAttributes attributes,
StrictModeFlag strict); StrictModeFlag strict_mode);
MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes(
String* key, String* key,
Object* value, Object* value,
......
...@@ -3784,7 +3784,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle<Object> object, ...@@ -3784,7 +3784,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle<Object> object,
Handle<Object> key, Handle<Object> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attr, PropertyAttributes attr,
StrictModeFlag strict) { StrictModeFlag strict_mode) {
HandleScope scope; HandleScope scope;
if (object->IsUndefined() || object->IsNull()) { if (object->IsUndefined() || object->IsNull()) {
...@@ -3827,7 +3827,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle<Object> object, ...@@ -3827,7 +3827,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle<Object> object,
} else { } else {
Handle<String> key_string = Handle<String>::cast(key); Handle<String> key_string = Handle<String>::cast(key);
key_string->TryFlatten(); 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(); if (result.is_null()) return Failure::Exception();
return *value; return *value;
...@@ -3843,7 +3843,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle<Object> object, ...@@ -3843,7 +3843,7 @@ MaybeObject* Runtime::SetObjectProperty(Handle<Object> object,
// TODO(1220): Implement SetElement strict mode. // TODO(1220): Implement SetElement strict mode.
return js_object->SetElement(index, *value); return js_object->SetElement(index, *value);
} else { } 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) { ...@@ -3947,15 +3947,19 @@ static MaybeObject* Runtime_SetProperty(Arguments args) {
PropertyAttributes attributes = PropertyAttributes attributes =
static_cast<PropertyAttributes>(unchecked_attributes); static_cast<PropertyAttributes>(unchecked_attributes);
StrictModeFlag strict = kNonStrictMode; StrictModeFlag strict_mode = kNonStrictMode;
if (args.length() == 5) { if (args.length() == 5) {
CONVERT_SMI_CHECKED(strict_unchecked, args[4]); CONVERT_SMI_CHECKED(strict_unchecked, args[4]);
RUNTIME_ASSERT(strict_unchecked == kStrictMode || RUNTIME_ASSERT(strict_unchecked == kStrictMode ||
strict_unchecked == kNonStrictMode); strict_unchecked == kNonStrictMode);
strict = static_cast<StrictModeFlag>(strict_unchecked); strict_mode = static_cast<StrictModeFlag>(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) { ...@@ -7545,8 +7549,7 @@ static MaybeObject* Runtime_StoreContextSlot(Arguments args) {
CONVERT_SMI_CHECKED(strict_unchecked, args[3]); CONVERT_SMI_CHECKED(strict_unchecked, args[3]);
RUNTIME_ASSERT(strict_unchecked == kStrictMode || RUNTIME_ASSERT(strict_unchecked == kStrictMode ||
strict_unchecked == kNonStrictMode); strict_unchecked == kNonStrictMode);
StrictModeFlag strict = static_cast<StrictModeFlag>(strict_unchecked); StrictModeFlag strict_mode = static_cast<StrictModeFlag>(strict_unchecked);
int index; int index;
PropertyAttributes attributes; PropertyAttributes attributes;
...@@ -7590,11 +7593,12 @@ static MaybeObject* Runtime_StoreContextSlot(Arguments args) { ...@@ -7590,11 +7593,12 @@ static MaybeObject* Runtime_StoreContextSlot(Arguments args) {
// extension object itself. // extension object itself.
if ((attributes & READ_ONLY) == 0 || if ((attributes & READ_ONLY) == 0 ||
(context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) { (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) {
RETURN_IF_EMPTY_HANDLE(SetProperty(context_ext, name, value, NONE, strict)); RETURN_IF_EMPTY_HANDLE(
} else if (strict == kStrictMode && (attributes & READ_ONLY) != 0) { SetProperty(context_ext, name, value, NONE, strict_mode));
} else if (strict_mode == kStrictMode && (attributes & READ_ONLY) != 0) {
// Setting read only property in strict mode. // Setting read only property in strict mode.
Handle<Object> error = Handle<Object> error =
Factory::NewTypeError("strict_cannot_assign", HandleVector(&name, 1)); Factory::NewTypeError("strict_cannot_assign", HandleVector(&name, 1));
return Top::Throw(*error); return Top::Throw(*error);
} }
return *value; return *value;
......
...@@ -553,7 +553,7 @@ class Runtime : public AllStatic { ...@@ -553,7 +553,7 @@ class Runtime : public AllStatic {
Handle<Object> key, Handle<Object> key,
Handle<Object> value, Handle<Object> value,
PropertyAttributes attr, PropertyAttributes attr,
StrictModeFlag strict); StrictModeFlag strict_mode);
MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty( MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
Handle<JSObject> object, Handle<JSObject> object,
......
...@@ -1429,13 +1429,13 @@ MaybeObject* StoreInterceptorProperty(Arguments args) { ...@@ -1429,13 +1429,13 @@ MaybeObject* StoreInterceptorProperty(Arguments args) {
JSObject* recv = JSObject::cast(args[0]); JSObject* recv = JSObject::cast(args[0]);
String* name = String::cast(args[1]); String* name = String::cast(args[1]);
Object* value = args[2]; Object* value = args[2];
StrictModeFlag strict = StrictModeFlag strict_mode =
static_cast<StrictModeFlag>(Smi::cast(args[3])->value()); static_cast<StrictModeFlag>(Smi::cast(args[3])->value());
ASSERT(strict == kStrictMode || strict == kNonStrictMode); ASSERT(strict_mode == kStrictMode || strict_mode == kNonStrictMode);
ASSERT(recv->HasNamedInterceptor()); ASSERT(recv->HasNamedInterceptor());
PropertyAttributes attr = NONE; PropertyAttributes attr = NONE;
MaybeObject* result = recv->SetPropertyWithInterceptor( MaybeObject* result = recv->SetPropertyWithInterceptor(
name, value, attr, strict); name, value, attr, strict_mode);
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment