ecma3/Statements/eforin_001.as switch statement case needs to be updated

VERIFIED FIXED

Status

VERIFIED FIXED
10 years ago
10 years ago

People

(Reporter: brbaker, Assigned: brbaker)

Tracking

({flashplayer})

unspecified
x86
All
flashplayer
Bug Flags:
wanted-flashplayer10 +
flashplayer-triage +

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
The case statement is currently set for the string zero "0" but the property of the object that it is switching on is a number zero. Since the switch statement is implemented using !== (ecma 262 section 12.11) so the case will never be executed (0 !== "0")

This is causing the test to actually throw a TypeError in the test and not all testcases are executed:

$ $AVM ecma3/Statements/eforin_001.abc
forin-001 The for...in  statement
object[company] = netscape PASSED!
object[length] = 4 PASSED!
TypeError: Error #1010: A term is undefined and has no properties.
        at MethodInfo-65()
        at global$init()

After fixing the case statements to use: case 0: all of the testcases execute and pass.

$ $AVM ecma3/Statements/eforin_001.abc
forin-001 The for...in  statement
object[company] = netscape PASSED!
object[length] = 4 PASSED!
object[0] = zero PASSED!
object[year] = 2000 PASSED!
object.length = 4 PASSED!
object[company] = netscape PASSED!
object[length] = 4 PASSED!
object[0] = zero PASSED!
object[year] = 2000 PASSED!
object.length = 4 PASSED!
check break out of for...in = pass PASSED!
properties.length = 1 PASSED!
object[properties[0]] == values[0] = PASSED PASSED!
check break out of for...in = pass PASSED!
properties.length = 1 PASSED!
object[properties[0]] == object[properties[0]] = PASSED PASSED!
Flags: wanted-flashplayer10+
Flags: flashplayer-triage+
(Assignee)

Comment 1

10 years ago
Created attachment 348208 [details] [diff] [review]
patch
Assignee: nobody → brbaker
Status: NEW → ASSIGNED
Attachment #348208 - Flags: review?(cpeyer)

Updated

10 years ago
Attachment #348208 - Flags: review?(cpeyer) → review+
(Assignee)

Comment 2

10 years ago
pushed patch into redux 1290:ef275c60b255
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Assignee)

Updated

10 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.