Reviewed by Oliver Hunt.
Fix http://bugs.webkit.org/show_bug.cgi?id=17939
Bug 17939: Crash decompiling "const a = 1, b;"
* kjs/nodes2string.cpp:
(KJS::ConstDeclNode::streamTo): Null-check the correct variable.
2008-03-19 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Test for http://bugs.webkit.org/show_bug.cgi?id=17939
Bug 17939: Crash decompiling "const a = 1, b;"
* fast/js/function-toString-parentheses-expected.txt:
* fast/js/resources/function-toString-parentheses.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31149
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-03-19 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Fix http://bugs.webkit.org/show_bug.cgi?id=17939
+ Bug 17939: Crash decompiling "const a = 1, b;"
+
+ * kjs/nodes2string.cpp:
+ (KJS::ConstDeclNode::streamTo): Null-check the correct variable.
+
2008-03-18 Oliver Hunt <oliver@apple.com>
Reviewed by Mark Rowe.
s << " = " << PrecAssignment << m_init;
for (ConstDeclNode* n = m_next.get(); n; n = n->m_next.get()) {
s << ", " << n->m_ident;
- if (m_init)
+ if (n->m_init)
s << " = " << PrecAssignment << n->m_init;
}
}
+2008-03-19 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Test for http://bugs.webkit.org/show_bug.cgi?id=17939
+ Bug 17939: Crash decompiling "const a = 1, b;"
+
+ * fast/js/function-toString-parentheses-expected.txt:
+ * fast/js/resources/function-toString-parentheses.js:
+
2008-03-18 Oliver Hunt <oliver@apple.com>
Reviewed by Mark Rowe.
PASS compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3') is 'var a = 1, b = 2, c = 3'
PASS compileAndSerializeLeftmostTest('const a = 1') is 'const a = 1'
PASS compileAndSerializeLeftmostTest('const a = (1, 2)') is 'const a = (1, 2)'
+PASS compileAndSerializeLeftmostTest('const a, b = 1') is 'const a, b = 1'
+PASS compileAndSerializeLeftmostTest('const a = 1, b') is 'const a = 1, b'
PASS compileAndSerializeLeftmostTest('const a = 1, b = 1') is 'const a = 1, b = 1'
PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = 1') is 'const a = (1, 2), b = 1'
PASS compileAndSerializeLeftmostTest('const a = 1, b = (1, 2)') is 'const a = 1, b = (1, 2)'
shouldBe("compileAndSerializeLeftmostTest('const a = 1')", "'const a = 1'");
shouldBe("compileAndSerializeLeftmostTest('const a = (1, 2)')", "'const a = (1, 2)'");
+shouldBe("compileAndSerializeLeftmostTest('const a, b = 1')", "'const a, b = 1'");
+shouldBe("compileAndSerializeLeftmostTest('const a = 1, b')", "'const a = 1, b'");
shouldBe("compileAndSerializeLeftmostTest('const a = 1, b = 1')", "'const a = 1, b = 1'");
shouldBe("compileAndSerializeLeftmostTest('const a = (1, 2), b = 1')", "'const a = (1, 2), b = 1'");
shouldBe("compileAndSerializeLeftmostTest('const a = 1, b = (1, 2)')", "'const a = 1, b = (1, 2)'");