!6751 close map get optimize

Merge pull request !6751 from wpy111/master
This commit is contained in:
openharmony_ci 2024-04-01 15:46:12 +00:00 committed by Gitee
commit 288637449c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 5 deletions

View File

@ -1215,8 +1215,7 @@ void Builtins::InitializeSet(const JSHandle<GlobalEnv> &env, JSHandle<JSTaggedVa
factory_->NewEcmaHClass(JSSet::SIZE, JSType::JS_SET, setFuncPrototypeValue);
// Set() = new Function()
JSHandle<JSTaggedValue> setFunction(
NewBuiltinConstructor(env, setFuncPrototype, BuiltinsSet::SetConstructor, "Set", FunctionLength::ZERO,
BUILTINS_STUB_ID(SetConstructor)));
NewBuiltinConstructor(env, setFuncPrototype, BuiltinsSet::SetConstructor, "Set", FunctionLength::ZERO));
JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
JSHandle<JSFunction>(setFunction),
setFuncInstanceHClass.GetTaggedValue());
@ -1292,8 +1291,7 @@ void Builtins::InitializeMap(const JSHandle<GlobalEnv> &env, JSHandle<JSTaggedVa
factory_->NewEcmaHClass(JSMap::SIZE, JSType::JS_MAP, mapFuncPrototypeValue);
// Map() = new Function()
JSHandle<JSTaggedValue> mapFunction(
NewBuiltinConstructor(env, mapFuncPrototype, BuiltinsMap::MapConstructor, "Map", FunctionLength::ZERO,
BUILTINS_STUB_ID(MapConstructor)));
NewBuiltinConstructor(env, mapFuncPrototype, BuiltinsMap::MapConstructor, "Map", FunctionLength::ZERO));
// Map().prototype = Map.Prototype & Map.prototype.constructor = Map()
JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
JSHandle<JSFunction>(mapFunction),

View File

@ -33,7 +33,7 @@
/* Map.prototype.forEach ( callbackfn [ , thisArg ] ) */ \
V("forEach", ForEach, 1, MapForEach) \
/* Map.prototype.get ( key ) */ \
V("get", Get, 1, MapGet) \
V("get", Get, 1, INVALID) \
/* Map.prototype.has ( key ) */ \
V("has", Has, 1, MapHas) \
/* Map.prototype.keys ( ) */ \