Bug 18192

Summary: Squirrelfish needs support for break and continue
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: JavaScriptCoreAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, mjs, oliver, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Implementate support for continue and goto oliver: review+

Oliver Hunt
Reported 2008-03-28 14:40:05 PDT
Task tracking bug
Attachments
Implementate support for continue and goto (9.67 KB, patch)
2008-03-28 14:47 PDT, Oliver Hunt
oliver: review+
Oliver Hunt
Comment 1 2008-03-28 14:47:12 PDT
Created attachment 20165 [details] Implementate support for continue and goto
Geoffrey Garen
Comment 2 2008-03-28 15:00:53 PDT
+ Vector<LoopContext> m_loopsContextStack; How about calling this "m_loopContextStack"? +CodeGenerator::LoopContext* CodeGenerator::scopeForIdentifier(const Identifier& label) "Scope" is very specifically tied to variable resolution in JavaScript. How about naming this function "loopContextForIdentifier"? + LoopContext* scope = scopeForIdentifier(label); And calling this variable "loopContext"? +LabelID* CodeGenerator::getLabelForContinue(const Identifier& label) +{ + LoopContext* scope = scopeForIdentifier(label); + return scope ? scope->continueTarget : 0; +} + +LabelID* CodeGenerator::getLabelForBreak(const Identifier& label) Our style is to omit the "get" from these function names. Looks good. r=me
Geoffrey Garen
Comment 3 2008-03-28 15:01:34 PDT
I think you can change this: + LoopContext scope = { labels, continueTarget, breakTarget }; + m_loopsContextStack.append(scope); to this: m_loopsContextStack.append({ labels, continueTarget, breakTarget });
Oliver Hunt
Comment 4 2008-03-28 15:38:37 PDT
Comment on attachment 20165 [details] Implementate support for continue and goto reviewed by Geoff
Oliver Hunt
Comment 5 2008-03-28 15:40:42 PDT
Landed r31411
Note You need to log in before you can comment on or make changes to this bug.