diff --git a/ecmascript/compiler/builtins/builtins_object_stub_builder.cpp b/ecmascript/compiler/builtins/builtins_object_stub_builder.cpp index 9122178789977ad86e3725624e54629e96fde6d5..fca3fbe8523e2f01c9525b31bceeb050f835e429 100644 --- a/ecmascript/compiler/builtins/builtins_object_stub_builder.cpp +++ b/ecmascript/compiler/builtins/builtins_object_stub_builder.cpp @@ -175,7 +175,7 @@ void BuiltinsObjectStubBuilder::AssignEnumElementProperty(Variable *result, Labe Bind(¬Hole); { // value - FastSetPropertyByIndex(glue_, toAssign, *idx, value); + FastSetPropertyByIndex(glue_, toAssign, TaggedGetInt(key), value); Label exception(env); BRANCH(HasPendingException(glue_), &exception, &loopEnd); Bind(&exception); diff --git a/test/moduletest/obj_dictionarymode/obj_dictionarymode.js b/test/moduletest/obj_dictionarymode/obj_dictionarymode.js index 323c7f0da410c16fea320cbde682c1e132346b56..868a69d5ba60f0c41a3809ba8b8031e38d7e1fc6 100644 --- a/test/moduletest/obj_dictionarymode/obj_dictionarymode.js +++ b/test/moduletest/obj_dictionarymode/obj_dictionarymode.js @@ -166,4 +166,9 @@ delete arrayLike[1]; assert_equal(ArkTools.hasFastProperties(arrayLike), false); } + +{ + let obj = Object.assign({ "11785313": "spt", "35961926": "xel" }, { "139": "sl", "11420": "ls" }); + assert_equal(JSON.stringify(obj), '{"139":"sl","11420":"ls","11785313":"spt","35961926":"xel"}'); +} test_end(); \ No newline at end of file