Unreviewed, update the builtin test results
[WebKit-https.git] / Source / JavaScriptCore / Scripts / tests / builtins / expected / JavaScriptCore-Builtin.Promise-Separate.js-result
1 ### Begin File: BuiltinPromiseBuiltins.h
2 /*
3  * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
4  * Copyright (c) 2016 Apple Inc. All rights reserved.
5  * 
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 
15  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
19  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25  * THE POSSIBILITY OF SUCH DAMAGE.
26  * 
27  */
28
29 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
30 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
31
32 #pragma once
33
34
35
36 namespace JSC {
37 class FunctionExecutable;
38 }
39
40 namespace JSC {
41
42 /* Builtin.Promise */
43 extern const char* const s_builtinPromiseRejectPromiseCode;
44 extern const int s_builtinPromiseRejectPromiseCodeLength;
45 extern const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility;
46 extern const char* const s_builtinPromiseFulfillPromiseCode;
47 extern const int s_builtinPromiseFulfillPromiseCodeLength;
48 extern const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility;
49
50 #define JSC_FOREACH_BUILTIN_PROMISE_BUILTIN_DATA(macro) \
51     macro(rejectPromise, builtinPromiseRejectPromise, 2) \
52     macro(fulfillPromise, builtinPromiseFulfillPromise, 2) \
53
54 #define JSC_BUILTIN_BUILTIN_PROMISE_REJECTPROMISE 1
55 #define JSC_BUILTIN_BUILTIN_PROMISE_FULFILLPROMISE 1
56
57 #define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(macro) \
58     macro(builtinPromiseRejectPromiseCode, rejectPromise, static_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \
59     macro(builtinPromiseFulfillPromiseCode, fulfillPromise, static_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \
60
61 #define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_FUNCTION_NAME(macro) \
62     macro(fulfillPromise) \
63     macro(rejectPromise) \
64
65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
66     JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
67
68 JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
69 #undef DECLARE_BUILTIN_GENERATOR
70
71 } // namespace JSC
72 ### End File: BuiltinPromiseBuiltins.h
73
74 ### Begin File: BuiltinPromiseBuiltins.cpp
75 /*
76  * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
77  * Copyright (c) 2016 Apple Inc. All rights reserved.
78  * 
79  * Redistribution and use in source and binary forms, with or without
80  * modification, are permitted provided that the following conditions
81  * are met:
82  * 1. Redistributions of source code must retain the above copyright
83  *    notice, this list of conditions and the following disclaimer.
84  * 2. Redistributions in binary form must reproduce the above copyright
85  *    notice, this list of conditions and the following disclaimer in the
86  *    documentation and/or other materials provided with the distribution.
87  * 
88  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
89  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
91  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
92  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
93  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
94  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
95  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
96  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
97  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
98  * THE POSSIBILITY OF SUCH DAMAGE.
99  * 
100  */
101
102 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
103 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
104
105 #include "config.h"
106 #include "BuiltinPromiseBuiltins.h"
107
108 #include "BuiltinExecutables.h"
109 #include "HeapInlines.h"
110 #include "IdentifierInlines.h"
111 #include "Intrinsic.h"
112 #include "JSCellInlines.h"
113 #include "VM.h"
114
115 namespace JSC {
116
117 const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
118 const int s_builtinPromiseRejectPromiseCodeLength = 413;
119 static const JSC::Intrinsic s_builtinPromiseRejectPromiseCodeIntrinsic = JSC::NoIntrinsic;
120 const char* const s_builtinPromiseRejectPromiseCode =
121     "(function (promise, reason)\n" \
122     "{\n" \
123     "    \"use strict\";\n" \
124     "\n" \
125     "    var reactions = promise.@promiseRejectReactions;\n" \
126     "    promise.@promiseResult = reason;\n" \
127     "    promise.@promiseFulfillReactions = undefined;\n" \
128     "    promise.@promiseRejectReactions = undefined;\n" \
129     "    promise.@promiseState = @promiseRejected;\n" \
130     "\n" \
131     "    @InspectorInstrumentation.promiseRejected(promise, reason, reactions);\n" \
132     "\n" \
133     "    @triggerPromiseReactions(reactions, reason);\n" \
134     "})\n" \
135 ;
136
137 const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
138 const int s_builtinPromiseFulfillPromiseCodeLength = 412;
139 static const JSC::Intrinsic s_builtinPromiseFulfillPromiseCodeIntrinsic = JSC::NoIntrinsic;
140 const char* const s_builtinPromiseFulfillPromiseCode =
141     "(function (promise, value)\n" \
142     "{\n" \
143     "    \"use strict\";\n" \
144     "\n" \
145     "    var reactions = promise.@promiseFulfillReactions;\n" \
146     "    promise.@promiseResult = value;\n" \
147     "    promise.@promiseFulfillReactions = undefined;\n" \
148     "    promise.@promiseRejectReactions = undefined;\n" \
149     "    promise.@promiseState = @promiseFulfilled;\n" \
150     "\n" \
151     "    @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);\n" \
152     "\n" \
153     "    @triggerPromiseReactions(reactions, value);\n" \
154     "})\n" \
155 ;
156
157
158 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
159 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
160 {\
161     return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); }
162 JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
163 #undef DEFINE_BUILTIN_GENERATOR
164
165
166 } // namespace JSC
167 ### End File: BuiltinPromiseBuiltins.cpp