Skip to content

Commit

Permalink
Fix false negative in for-in test
Browse files Browse the repository at this point in the history
As originally written, this test would spuriously pass when the deleted
property was incorrectly visited by enumation but correctly removed from
the object. In such cases, the accumulator string would take the form

    "aa1baundefinedca3"

And satisfy all conditions intended to highlight implementation errors.

Refactor the test to avoid false negative by using an object with a null
prototype and verifying the exact contents of the accumulator string.
  • Loading branch information
rwaldron committed Apr 5, 2022
1 parent 3c88e9b commit 384a4e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/language/statements/for-in/S12.6.4_A7_T2.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ for (var __key in __obj){

}

<<<<<<< HEAD
assert(
__accum === "aa1ca3" || __accum === "ca3aa1",
"Unexpected value: '" + __accum + "'"
);
=======
assert.sameValue(__accum, "aa1ca3");
>>>>>>> eeb002c698 (Fix false negative in for-in test)

// erasator is the hash map terminator
function erasator_T_1000(hash_map, charactr){
Expand Down

0 comments on commit 384a4e1

Please sign in to comment.