Changeset 30105
- Timestamp:
- 2008-02-08 21:17:06 (8 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/kjs/grammar.y (modified) (1 diff)
-
JavaScriptCore/kjs/nodes.h (modified) (1 diff)
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/js/function-toString-parentheses-expected.txt (modified) (1 diff)
-
LayoutTests/fast/js/resources/function-toString-parentheses.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r30103 r30105 1 2008-02-08 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Maciej. 4 5 <rdar://problem/5731773> REGRESSION (r28973): Extraneous parentheses in function.toString() 6 https://bugs.webkit.org/show_bug.cgi?id=17214 7 8 Make a subclass of CommaNode to provide the correct precedence for each expression in 9 a variable declaration list. 10 11 * kjs/grammar.y: 12 * kjs/nodes.h: 13 (KJS::VarDeclCommaNode::): 14 1 15 2008-02-08 Darin Adler <darin@apple.com> 2 16 -
trunk/JavaScriptCore/kjs/grammar.y
r29825 r30105 1247 1247 if (!list) 1248 1248 return init; 1249 return new CommaNode(list, init);1249 return new VarDeclCommaNode(list, init); 1250 1250 } 1251 1251 -
trunk/JavaScriptCore/kjs/nodes.h
r30103 r30105 2277 2277 RefPtr<ExpressionNode> m_expr2; 2278 2278 }; 2279 2280 class VarDeclCommaNode : public CommaNode { 2281 public: 2282 VarDeclCommaNode(ExpressionNode* expr1, ExpressionNode* expr2) KJS_FAST_CALL 2283 : CommaNode(expr1, expr2) 2284 { 2285 } 2286 virtual Precedence precedence() const { return PrecAssignment; } 2287 }; 2279 2288 2280 2289 class ConstDeclNode : public ExpressionNode { -
trunk/LayoutTests/ChangeLog
r30103 r30105 1 2008-02-08 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Maciej. 4 5 Test cases for decompilation of variable declaration lists. 6 7 * fast/js/function-toString-parentheses-expected.txt: 8 * fast/js/resources/function-toString-parentheses.js: 9 1 10 2008-02-08 Darin Adler <darin@apple.com> 2 11 -
trunk/LayoutTests/fast/js/function-toString-parentheses-expected.txt
r29815 r30105 482 482 PASS compileAndSerializeLeftmostTest('(function () { })()') is '(function () { })()' 483 483 PASS compileAndSerializeLeftmostTest('x = function () { }') is 'x = function () { }' 484 PASS compileAndSerializeLeftmostTest('var a') is 'var a' 485 PASS compileAndSerializeLeftmostTest('var a = 1') is 'var a = 1' 486 PASS compileAndSerializeLeftmostTest('var a, b') is 'var a, b' 487 PASS compileAndSerializeLeftmostTest('var a = 1, b = 2') is 'var a = 1, b = 2' 488 PASS compileAndSerializeLeftmostTest('var a, b, c') is 'var a, b, c' 489 PASS compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3') is 'var a = 1, b = 2, c = 3' 484 490 PASS successfullyParsed is true 485 491 -
trunk/LayoutTests/fast/js/resources/function-toString-parentheses.js
r29815 r30105 199 199 shouldBe("compileAndSerializeLeftmostTest('x = function () { }')", "'x = function () { }'"); 200 200 201 shouldBe("compileAndSerializeLeftmostTest('var a')", "'var a'"); 202 shouldBe("compileAndSerializeLeftmostTest('var a = 1')", "'var a = 1'"); 203 shouldBe("compileAndSerializeLeftmostTest('var a, b')", "'var a, b'"); 204 shouldBe("compileAndSerializeLeftmostTest('var a = 1, b = 2')", "'var a = 1, b = 2'"); 205 shouldBe("compileAndSerializeLeftmostTest('var a, b, c')", "'var a, b, c'"); 206 shouldBe("compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3')", "'var a = 1, b = 2, c = 3'"); 207 201 208 var successfullyParsed = true;