Summary: | Squirrelfish needs support for break and continue | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Oliver Hunt <oliver> | ||||
Component: | JavaScriptCore | Assignee: | 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
Oliver Hunt
2008-03-28 14:40:05 PDT
Created attachment 20165 [details]
Implementate support for continue and goto
+ 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 I think you can change this: + LoopContext scope = { labels, continueTarget, breakTarget }; + m_loopsContextStack.append(scope); to this: m_loopsContextStack.append({ labels, continueTarget, breakTarget }); Comment on attachment 20165 [details]
Implementate support for continue and goto
reviewed by Geoff
|