mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!2006 asyncfuction bugfix
Merge pull request !2006 from lukai/asyncbugfix
This commit is contained in:
commit
411d56172f
@ -220,10 +220,6 @@ void Builtins::Initialize(const JSHandle<GlobalEnv> &env, JSThread *thread)
|
||||
// initialize Function, forbidden change order
|
||||
InitializeFunction(env, emptyFuncDynclass);
|
||||
|
||||
JSHandle<JSHClass> asyncFuncClass = factory_->CreateFunctionClass(
|
||||
FunctionKind::ASYNC_FUNCTION, JSAsyncFunction::SIZE, JSType::JS_ASYNC_FUNCTION, env->GetFunctionPrototype());
|
||||
env->SetAsyncFunctionClass(thread_, asyncFuncClass);
|
||||
|
||||
JSHandle<JSHClass> asyncAwaitStatusFuncClass =
|
||||
factory_->CreateFunctionClass(FunctionKind::NORMAL_FUNCTION, JSAsyncAwaitStatusFunction::SIZE,
|
||||
JSType::JS_ASYNC_AWAIT_STATUS_FUNCTION, env->GetFunctionPrototype());
|
||||
@ -333,6 +329,10 @@ void Builtins::Initialize(const JSHandle<GlobalEnv> &env, JSThread *thread)
|
||||
JSType::JS_ASYNC_GENERATOR_FUNCTION, env->GetAsyncGeneratorFunctionPrototype());
|
||||
env->SetAsyncGeneratorFunctionClass(thread_, asyncGenetatorFuncClass);
|
||||
env->SetObjectFunctionPrototypeClass(thread_, JSTaggedValue(objFuncPrototype->GetClass()));
|
||||
JSHandle<JSHClass> asyncFuncClass = factory_->CreateFunctionClass(
|
||||
FunctionKind::ASYNC_FUNCTION, JSAsyncFunction::SIZE, JSType::JS_ASYNC_FUNCTION,
|
||||
env->GetAsyncFunctionPrototype());
|
||||
env->SetAsyncFunctionClass(thread_, asyncFuncClass);
|
||||
thread_->ResetGuardians();
|
||||
thread_->SetGlueGlobalEnv(reinterpret_cast<GlobalEnv *>(env.GetTaggedType()));
|
||||
}
|
||||
|
@ -23,6 +23,11 @@ var arrow = () => {}
|
||||
var async_arrow = async () => {}
|
||||
|
||||
print(foo.name)
|
||||
print(foo.call != undefined)
|
||||
print(foo.__proto__.constructor.name);
|
||||
print(foo.__proto__.__proto__.constructor.name);
|
||||
print(foo.__proto__.__proto__.__proto__.constructor.name);
|
||||
print(foo.length)
|
||||
print(arrow.name)
|
||||
print(async_arrow.name)
|
||||
|
||||
|
@ -12,6 +12,11 @@
|
||||
# limitations under the License.
|
||||
|
||||
foo
|
||||
true
|
||||
AsyncFunction
|
||||
Function
|
||||
Object
|
||||
0
|
||||
arrow
|
||||
async_arrow
|
||||
true
|
||||
|
Loading…
Reference in New Issue
Block a user