Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: test/webkit/fast/js/exception-properties.js

Issue 20280003: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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', '""');
+}
« no previous file with comments | « test/webkit/fast/js/end-in-string-escape-expected.txt ('k') | test/webkit/fast/js/exception-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698