Bug 18716 - SQUIRRELFISH: typeof should return undefined for an undefined variable reference
Summary: SQUIRRELFISH: typeof should return undefined for an undefined variable reference
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-24 09:59 PDT by Cameron Zwarich (cpst)
Modified: 2008-04-24 10:17 PDT (History)
0 users

See Also:


Attachments
Proposed patch (1.43 KB, patch)
2008-04-24 10:01 PDT, Cameron Zwarich (cpst)
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Zwarich (cpst) 2008-04-24 09:59:55 PDT
The expression "typeof x" throws an exception when x is undefined, but it should return undefined instead. This affects the JavaScriptCore regression tests ecma/Expressions/11.4.1.js and js1_5/Array/regress-157652.js.
Comment 1 Cameron Zwarich (cpst) 2008-04-24 10:01:55 PDT
Created attachment 20795 [details]
Proposed patch

This fixes the two tests.
Comment 2 Geoffrey Garen 2008-04-24 10:08:28 PDT
r=me if you use resolveBaseAndProperty instead.
Comment 3 Geoffrey Garen 2008-04-24 10:11:25 PDT
Comment on attachment 20795 [details]
Proposed patch

Cameron pointed out that resolveBaseAndProperty throws an exception for undefined variables. Doh!

r=me
Comment 4 Geoffrey Garen 2008-04-24 10:15:11 PDT
r32494