Bug 18716

Summary: SQUIRRELFISH: typeof should return undefined for an undefined variable reference
Product: WebKit Reporter: Cameron Zwarich (cpst) <zwarich>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Proposed patch ggaren: review+

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!

Comment 4 Geoffrey Garen 2008-04-24 10:15:11 PDT