⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271465 in webkit


Ignore:
Timestamp:
Jan 13, 2021, 3:18:36 PM (6 years ago)
Author:
Russell Epstein
Message:

Revert r270664. rdar://problem/73165685

Location:
branches/safari-611-branch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-611-branch/JSTests/ChangeLog

    r271343 r271465  
     12021-01-13  Russell Epstein  <repstein@apple.com>
     2
     3        Revert r270664. rdar://problem/73165685
     4
    152021-01-08  Alexey Shvayka  <shvaikalesh@gmail.com>
    26
  • branches/safari-611-branch/JSTests/test262/expectations.yaml

    r271265 r271465  
    887887  default: 'Test262Error: "und".minimize() should be "en" Expected SameValue(«en-u-va-posix», «en») to be true'
    888888  strict mode: 'Test262Error: "und".minimize() should be "en" Expected SameValue(«en-u-va-posix», «en») to be true'
     889test/language/arguments-object/mapped/nonconfigurable-nonenumerable-nonwritable-descriptors-set-by-arguments.js:
     890  default: 'Test262Error: Expected obj[0] to have enumerable:false.'
     891test/language/arguments-object/mapped/nonconfigurable-nonenumerable-nonwritable-descriptors-set-by-param.js:
     892  default: 'Test262Error: Expected obj[0] to have enumerable:false.'
     893test/language/arguments-object/mapped/nonconfigurable-nonwritable-descriptors-define-property-consecutive.js:
     894  default: 'Test262Error: Expected obj[0] to have configurable:false.'
     895test/language/arguments-object/mapped/nonconfigurable-nonwritable-descriptors-set-by-arguments.js:
     896  default: 'Test262Error: Expected obj[0] to have configurable:false.'
     897test/language/arguments-object/mapped/nonconfigurable-nonwritable-descriptors-set-by-param.js:
     898  default: 'Test262Error: Expected obj[0] to have configurable:false.'
    889899test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js:
    890900  default: 'Test262: This statement should not be evaluated.'
  • branches/safari-611-branch/Source/JavaScriptCore/ChangeLog

    r271464 r271465  
     12021-01-13  Russell Epstein  <repstein@apple.com>
     2
     3        Revert r270664. rdar://problem/73165685
     4
    152021-01-13  Russell Epstein  <repstein@apple.com>
    26
  • branches/safari-611-branch/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h

    r271269 r271465  
    210210}
    211211
    212 // https://tc39.es/ecma262/#sec-arguments-exotic-objects-defineownproperty-p-desc
    213212template<typename Type>
    214213bool GenericArguments<Type>::defineOwnProperty(JSObject* object, JSGlobalObject* globalObject, PropertyName ident, const PropertyDescriptor& descriptor, bool shouldThrow)
     
    223222        thisObject->overrideThingsIfNecessary(globalObject);
    224223        RETURN_IF_EXCEPTION(scope, false);
    225     } else if (Optional<uint32_t> optionalIndex = parseIndex(ident)) {
    226         uint32_t index = optionalIndex.value();
    227         bool isMapped = thisObject->isMappedArgument(index);
    228         PropertyDescriptor newDescriptor = descriptor;
    229 
    230         if (isMapped) {
    231             if (thisObject->isModifiedArgumentDescriptor(index)) {
    232                 if (!descriptor.value() && descriptor.writablePresent() && !descriptor.writable())
    233                     newDescriptor.setValue(thisObject->getIndexQuickly(index));
    234             } else
    235                 thisObject->putDirectIndex(globalObject, index, thisObject->getIndexQuickly(index));
    236 
    237             scope.assertNoException();
    238         }
    239 
    240         bool status = thisObject->defineOwnIndexedProperty(globalObject, index, newDescriptor, shouldThrow);
    241         if (!status) {
    242             ASSERT(!isMapped || thisObject->isModifiedArgumentDescriptor(index));
    243             RELEASE_AND_RETURN(scope, false);
    244         }
    245 
    246         scope.assertNoException();
    247         thisObject->setModifiedArgumentDescriptor(globalObject, index);
    248         RETURN_IF_EXCEPTION(scope, false);
    249 
    250         if (isMapped) {
    251             if (descriptor.isAccessorDescriptor())
    252                 thisObject->unmapArgument(globalObject, index);
    253             else {
     224    } else {
     225        Optional<uint32_t> optionalIndex = parseIndex(ident);
     226        if (optionalIndex) {
     227            uint32_t index = optionalIndex.value();
     228            if (!descriptor.isAccessorDescriptor() && thisObject->isMappedArgument(optionalIndex.value())) {
     229                // If the property is not deleted and we are using a non-accessor descriptor, then
     230                // make sure that the aliased argument sees the value.
    254231                if (descriptor.value())
    255232                    thisObject->setIndexQuickly(vm, index, descriptor.value());
    256                 if (descriptor.writablePresent() && !descriptor.writable())
     233           
     234                // If the property is not deleted and we are using a non-accessor, writable,
     235                // configurable and enumerable descriptor and isn't modified, then we are done.
     236                // The argument continues to be aliased.
     237                if (descriptor.writable() && descriptor.configurable() && descriptor.enumerable() && !thisObject->isModifiedArgumentDescriptor(index))
     238                    return true;
     239               
     240                if (!thisObject->isModifiedArgumentDescriptor(index)) {
     241                    // If it is a new entry, we need to put direct to initialize argument[i] descriptor properly
     242                    JSValue value = thisObject->getIndexQuickly(index);
     243                    ASSERT(value);
     244                    object->putDirectMayBeIndex(globalObject, ident, value);
     245                    scope.assertNoException();
     246
     247                    thisObject->setModifiedArgumentDescriptor(globalObject, index);
     248                    RETURN_IF_EXCEPTION(scope, false);
     249                }
     250            }
     251           
     252            if (thisObject->isMappedArgument(index)) {
     253                // Just unmap arguments if its descriptor contains {writable: false}.
     254                // Check https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
     255                // and https://tc39.github.io/ecma262/#sec-createmappedargumentsobject to verify that all data
     256                // property from arguments object are {writable: true, configurable: true, enumerable: true} by default
     257                if ((descriptor.writablePresent() && !descriptor.writable()) || descriptor.isAccessorDescriptor()) {
     258                    if (!descriptor.isAccessorDescriptor()) {
     259                        JSValue value = thisObject->getIndexQuickly(index);
     260                        ASSERT(value);
     261                        object->putDirectMayBeIndex(globalObject, ident, value);
     262                        scope.assertNoException();
     263                    }
    257264                    thisObject->unmapArgument(globalObject, index);
     265                    RETURN_IF_EXCEPTION(scope, false);
     266                    thisObject->setModifiedArgumentDescriptor(globalObject, index);
     267                    RETURN_IF_EXCEPTION(scope, false);
     268                }
    258269            }
    259 
    260             RETURN_IF_EXCEPTION(scope, false);
    261         }
    262 
    263         return true;
    264     }
    265 
     270        }
     271    }
     272
     273    // Now just let the normal object machinery do its thing.
    266274    RELEASE_AND_RETURN(scope, Base::defineOwnProperty(object, globalObject, ident, descriptor, shouldThrow));
    267275}
Note: See TracChangeset for help on using the changeset viewer.