Index: test/webkit/fast/js/exception-properties.js |
diff --git a/test/webkit/dfg-peephole-compare-final-object-to-final-object-or-other-when-proven-final-object.js b/test/webkit/fast/js/exception-properties.js |
similarity index 71% |
copy from test/webkit/dfg-peephole-compare-final-object-to-final-object-or-other-when-proven-final-object.js |
copy to test/webkit/fast/js/exception-properties.js |
index 5e27539b1710b08bd2d2ec8e019ff855500e62ce..0bbbe768a9ba0fe91e40027cf55ffe0c2ff7064e 100644 |
--- a/test/webkit/dfg-peephole-compare-final-object-to-final-object-or-other-when-proven-final-object.js |
+++ b/test/webkit/fast/js/exception-properties.js |
@@ -21,25 +21,26 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-description( |
-"Tests that the peephole CompareEq optimization for the case where one side is predicted final object and the other side is predicted either final object or other (i.e. null or undefined) doesn't assert when the other side is also proven final object." |
-); |
+description("Test for correct properties on Error objects."); |
-function foo(a, b) { |
+function enumerableProperties(object) |
+{ |
var result = []; |
- result.push(b.f); |
- if (a == b) |
- result.push(true); |
- else |
- result.push(false); |
+ for (var i in object) |
+ result.push(i); |
return result; |
} |
-for (var i = 0; i < 100; ++i) { |
- if (i%2) { |
- var o = {f:42}; |
- shouldBe("foo(o, o)", "[42, true]"); |
- } else |
- shouldThrow("foo({f:42}, null)"); |
-} |
+try { |
+ // generate a RangeError. |
+ [].length = -1; |
+} catch (rangeError) { |
+ var nativeError = rangeError; |
+ var error = new Error("message"); |
+ |
+ shouldBe('enumerableProperties(error)', '[]'); |
+ shouldBe('enumerableProperties(nativeError)', '["stack", "line", "sourceURL"]'); |
+ shouldBe('Object.getPrototypeOf(nativeError).name', '"RangeError"'); |
+ shouldBe('Object.getPrototypeOf(nativeError).message', '""'); |
+} |