diff options
| author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
|---|---|---|
| committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
| commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
| tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/objects/js-aggregate-error.tq | |
| parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/objects/js-aggregate-error.tq')
| -rw-r--r-- | chromium/v8/src/objects/js-aggregate-error.tq | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/chromium/v8/src/objects/js-aggregate-error.tq b/chromium/v8/src/objects/js-aggregate-error.tq deleted file mode 100644 index efa416e9fb4..00000000000 --- a/chromium/v8/src/objects/js-aggregate-error.tq +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2020 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include 'src/objects/js-aggregate-error.h' - -@generateCppClass -extern class JSAggregateError extends JSObject { - // Only Undefined during AggregateError object creation. In order to make the - // field type FixedArray, we'd need to initialize it in ErrorUtils::Construct - // (after it, it's too late) which we don't want. - errors: FixedArray|Undefined; -} - -namespace error { - -transitioning javascript builtin AggregateErrorConstructor( - js-implicit context: NativeContext, target: JSFunction, - newTarget: JSAny)(...arguments): JSAny { - // This function is implementing the spec as suggested by - // https://github.com/tc39/proposal-promise-any/pull/59 . FIXME(marja): - // change this if the PR is declined. - - // 1. If NewTarget is undefined, let newTarget be the active function - // object, else let newTarget be NewTarget. - // 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, - // "%AggregateError.prototype%", « [[ErrorData]], [[AggregateErrors]] »). - // 3. If _message_ is not _undefined_, then - // a. Let msg be ? ToString(_message_). - // b. Let msgDesc be the PropertyDescriptor { [[Value]]: _msg_, - // [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* - // c. Perform ! DefinePropertyOrThrow(_O_, *"message"*, _msgDesc_). - const message: JSAny = arguments[1]; - const obj: JSAggregateError = - ConstructAggregateErrorHelper(context, target, newTarget, message); - - // 4. Let errorsList be ? IterableToList(errors). - const errors: JSAny = arguments[0]; - const errorsArray = - iterator::IterableToFixedArrayWithSymbolLookupSlow(errors); - // errorsArray must be marked copy-on-write, since the "errors" getter - // creates a thin JSArray wrapper around it. - MakeFixedArrayCOW(errorsArray); - - // 5. Set O.[[AggregateErrors]] to errorsList. - obj.errors = errorsArray; - - // 6. Return O. - return obj; -} - -transitioning javascript builtin AggregateErrorPrototypeErrorsGetter( - js-implicit context: NativeContext, receiver: JSAny)(): JSAny { - // 1. Let E be the this value. - // 2. If Type(E) is not Object, throw a TypeError exception. - // 3. If E does not have an [[ErrorData]] internal slot, throw a TypeError - // exception. - // 4. If E does not have an [[AggregateErrors]] internal slot, throw a - // TypeError exception. - // 5. Return ! CreateArrayFromList(E.[[AggregateErrors]]). - typeswitch (receiver) { - case (receiver: JSAggregateError): { - return array::CreateJSArrayWithElements( - UnsafeCast<FixedArray>(receiver.errors)); - } - case (Object): { - ThrowTypeError( - MessageTemplate::kNotGeneric, 'JSAggregateError.prototype.errors.get', - 'AggregateError'); - } - } -} - -extern runtime ConstructAggregateErrorHelper( - Context, JSFunction, JSAny, Object): JSAggregateError; - -extern runtime ConstructInternalAggregateErrorHelper( - Context, Object): JSAggregateError; - -extern macro MakeFixedArrayCOW(FixedArray); -} |
