Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proposal-promise-any #6641

Merged
merged 27 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
acfa7d3
Add AggregateError Ctor and prototype
Kingwl Mar 16, 2021
8e1e8aa
Add throwAggregateErrror function
Kingwl Mar 16, 2021
fa2e93f
Add promise.any
Kingwl Mar 17, 2021
1b2010f
Merge branch 'master' into proposal-promise-any
Kingwl Mar 23, 2021
6887c8b
Add aggregate into ignore
Kingwl Mar 23, 2021
0a7fa0c
Fix bytecode
Kingwl Mar 23, 2021
c6129ad
fix copyright
Kingwl Mar 23, 2021
2a6fedc
Simplify code
Kingwl Mar 23, 2021
da57f7d
Fix unicode characters
Kingwl Mar 23, 2021
87d36ee
Fix unicode characters
Kingwl Mar 23, 2021
233093c
Add tests for aggregate error
Kingwl Mar 23, 2021
1c48f86
Add error cause with aggregate errors
Kingwl Mar 24, 2021
228b22e
Add promise async tests
Kingwl Mar 24, 2021
631974f
Add promise any tests
Kingwl Mar 24, 2021
a5058d7
Fix some CR issues.
Kingwl Mar 25, 2021
0d097a7
Fix some CR issues
Kingwl Apr 1, 2021
dfeb078
Add some case
Kingwl Apr 1, 2021
f3aee6a
Fix cr issues
Kingwl Apr 1, 2021
2225ff9
Update copyright
Kingwl Apr 1, 2021
3b5d57a
Merge branch 'master' into proposal-promise-any
Kingwl Apr 1, 2021
6902d29
Merge branch 'master' into proposal-promise-any
Kingwl Apr 7, 2021
caddaf3
Fix incorrect call arguments
Kingwl Apr 7, 2021
a8528b7
Merge branch 'master' into proposal-promise-any
Kingwl Apr 14, 2021
c9825c6
Merge branch 'master' into proposal-promise-any
rhuanjl Apr 16, 2021
8d5e6bd
Add more tests and fix
Kingwl Apr 21, 2021
7fa26cd
Merge branch 'proposal-promise-any' of github.com:Kingwl/ChakraCore i…
Kingwl Apr 21, 2021
9fcf2c0
Merge branch 'master' into proposal-promise-any
Kingwl Apr 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/ch/DbgController.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var controllerObj = (function () {
[
"#__proto__",
"globalThis",
"AggregateError",
"Array",
"ArrayBuffer",
"Atomics",
Expand Down
4 changes: 4 additions & 0 deletions lib/Common/ConfigFlagsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ PHASE(All)
#define DEFAULT_CONFIG_ESHashbang (true)
#define DEFAULT_CONFIG_ESSymbolDescription (true)
#define DEFAULT_CONFIG_ESArrayFindFromLast (false)
#define DEFAULT_CONFIG_ESPromiseAny (true)
#define DEFAULT_CONFIG_ESNullishCoalescingOperator (true)
#define DEFAULT_CONFIG_ESGlobalThis (true)

Expand Down Expand Up @@ -1208,6 +1209,9 @@ FLAGR(Boolean, ESSymbolDescription, "Enable Symbol.prototype.description", DEFAU

FLAGR(Boolean, ESArrayFindFromLast, "Enable findLast, findLastIndex for Array.prototype and TypedArray.prorotype", DEFAULT_CONFIG_ESArrayFindFromLast)

// ES Promise.any and AggregateError flag
FLAGR(Boolean, ESPromiseAny, "Enable Promise.any and AggregateError", DEFAULT_CONFIG_ESPromiseAny)

// ES import.meta keyword meta-property
FLAGR(Boolean, ESImportMeta, "Enable import.meta keyword", DEFAULT_CONFIG_ESImportMeta)

Expand Down
2 changes: 2 additions & 0 deletions lib/Parser/ParserCommon.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// Common definitions used outside parser so that we don't have to include the whole Parser.h.
Expand All @@ -25,6 +26,7 @@ enum ErrorTypeEnum
kjstSyntaxError,
kjstTypeError,
kjstURIError,
kjstAggregateError,
kjstWebAssemblyCompileError,
kjstWebAssemblyRuntimeError,
kjstWebAssemblyLinkError,
Expand Down
9 changes: 6 additions & 3 deletions lib/Parser/rterrors.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (C) Microsoft Corporation and contributors. All rights reserved.
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#define IDS_COMPILATION_ERROR_SOURCE 4096
Expand Down Expand Up @@ -205,7 +206,7 @@ RT_ERROR_MSG(JSERR_InvalidTypedArraySubarrayLength, 5085, "", "Invalid begin/end
RT_ERROR_MSG(JSERR_TypedArray_NeedSource, 5086, "", "Invalid source in typed array set", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_This_NeedDataView, 5087, "", "'this' is not a DataView object", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_DataView_NeedArgument, 5088, "Required argument %s in DataView method is not specified", "Invalid arguments in DataView", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_DataView_InvalidOffset, 5089, "", "DataView operation access beyond specified buffer length", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_DataView_InvalidOffset, 5089, "", "DataView operation access beyond specified buffer length", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_DataView_InvalidArgument, 5090, "DataView constructor argument %s is invalid", "Invalid arguments in DataView", kjstRangeError, 0)

RT_ERROR_MSG(JSERR_InvalidFunctionSignature, 5091, "The function '%s' has an invalid signature and cannot be called", "invalid function signature", kjstTypeError, 0)
Expand Down Expand Up @@ -305,7 +306,9 @@ RT_ERROR_MSG(JSERR_GeneratorAlreadyExecuting, 5618, "%s: Cannot execute generato
RT_ERROR_MSG(JSERR_LengthIsTooBig, 5619, "Length property would exceed maximum value in output from '%s'", "", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_NonObjectFromIterable, 5620, "Iterable provided to %s must not return non-object or null value.", "", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_EmptyArrayAndInitValueNotPresent, 5621, "%s: Array contains no elements and initialValue is not provided", "", kjstTypeError, 0)
// 5622-5626 Unused
RT_ERROR_MSG(JSERR_PromiseAllRejected, 5622, "", "Promise.any all promises rejected.", kjstAggregateError, 0)

// 5623-5626 Unused
RT_ERROR_MSG(JSERR_NeedConstructor, 5627, "'%s' is not a constructor", "Constructor expected", kjstTypeError, 0)

RT_ERROR_MSG(VBSERR_CantDisplayDate, 32812, "", "The specified date is not available in the current locale's calendar", kjstRangeError, 0)
Expand Down
3 changes: 3 additions & 0 deletions lib/Runtime/Base/JnDirectFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ENTRY_SYMBOL(_symbolUnscopables, _u("Symbol.unscopables"))
// math functions must remain contiguous for quick modification check
ENTRY(abs)
ENTRY(acos)
ENTRY(any)
ENTRY(asin)
ENTRY(atan)
ENTRY(atan2)
Expand Down Expand Up @@ -132,6 +133,7 @@ ENTRY(description)
ENTRY(detach)
ENTRY(done)
ENTRY(E)
ENTRY(errors)
ENTRY(encodeURI)
ENTRY(encodeURIComponent)
ENTRY(endsWith)
Expand Down Expand Up @@ -414,6 +416,7 @@ ENTRY(unknown)
ENTRY(unscopables)
ENTRY(unshift)
ENTRY(URIError)
ENTRY(AggregateError)
ENTRY(UTC)
ENTRY(valueOf)
ENTRY(values)
Expand Down
1 change: 1 addition & 0 deletions lib/Runtime/Base/ThreadConfigFlagsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ FLAG_RELEASE(IsESHashbangEnabled, ESHashbang)
FLAG_RELEASE(IsESNullishCoalescingOperatorEnabled, ESNullishCoalescingOperator)
FLAG_RELEASE(IsESExportNsAsEnabled, ESExportNsAs)
FLAG_RELEASE(IsESSymbolDescriptionEnabled, ESSymbolDescription)
FLAG_RELEASE(IsESPromiseAnyEnabled, ESPromiseAny)
FLAG_RELEASE(IsESArrayFindFromLastEnabled , ESArrayFindFromLast)
FLAG_RELEASE(IsESGlobalThisEnabled, ESGlobalThis)
FLAG_RELEASE(IsES2018AsyncIterationEnabled, ES2018AsyncIteration)
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// NOTE: If there is a merge conflict the correct fix is to make a new GUID.
// This file was generated with tools/regenByteCode.py

// {61a8b64e-9359-442c-af0c-5a4fa8058917}
// {7e624f04-e6a9-408a-9a53-d067a2b1c80e}
const GUID byteCodeCacheReleaseFileVersion =
{ 0x61a8b64e, 0x9359, 0x442c, {0xaf, 0x0c, 0x5a, 0x4f, 0xa8, 0x05, 0x89, 0x17 } };
{ 0x7e624f04, 0xe6a9, 0x408a, {0x9a, 0x53, 0xd0, 0x67, 0xa2, 0xb1, 0xc8, 0x0e } };

2 changes: 2 additions & 0 deletions lib/Runtime/Debug/TTSupport.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
Expand Down Expand Up @@ -251,6 +252,7 @@ namespace TTD
SnapPromiseReactionTaskFunctionObject,
SnapPromiseAllResolveElementFunctionObject,
SnapPromiseAllSettledResolveOrRejectElementFunctionObject,
SnapPromiseAnyRejectElementFunctionObject,
SnapGeneratorFunction,
SnapGeneratorVirtualScriptFunction,
SnapAsyncFunction,
Expand Down
Loading