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

Unified Diff: test/webkit/fast/js/modify-non-references.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/modify-non-references.js
diff --git a/test/webkit/for-in-exeception.js b/test/webkit/fast/js/modify-non-references.js
similarity index 58%
copy from test/webkit/for-in-exeception.js
copy to test/webkit/fast/js/modify-non-references.js
index f5101858daf1ae9f7cbcb660963ee7902982e28c..e8b9682e70685811ec36af7a783a9c041b30039f 100644
--- a/test/webkit/for-in-exeception.js
+++ b/test/webkit/fast/js/modify-non-references.js
@@ -21,26 +21,15 @@
// (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('Test for (foo in somethingWhichThrows) to catch ASSERT');
-
-function throwNullException() {
- throw null;
-}
-
-function throwUndefinedException() {
- throw undefined;
-}
-
-function throwStringException() {
- throw "PASSED"
-}
-
-function test(func) {
- for (var foo in func()) {
- testFailed("Shoud not be reached");
- }
-}
-
-shouldBeUndefined("test(throwUndefinedException)");
-shouldBeUndefined("test(throwNullException)");
-shouldThrow("test(throwStringException)");
+shouldBe("function f() { g()++; } f.toString()", "'function f() { g()++; }'");
+shouldBe("function f() { g()--; } f.toString()", "'function f() { g()--; }'");
+shouldBe("function f() { ++g(); } f.toString()", "'function f() { ++g(); }'");
+shouldBe("function f() { --g(); } f.toString()", "'function f() { --g(); }'");
+shouldBe("function f() { g() = 1; } f.toString()", "'function f() { g() = 1; }'");
+shouldBe("function f() { g() += 1; } f.toString()", "'function f() { g() += 1; }'");
+shouldThrow("g()++", "'ReferenceError: Postfix ++ operator applied to value that is not a reference.'");
+shouldThrow("g()--", "'ReferenceError: Postfix -- operator applied to value that is not a reference.'");
+shouldThrow("++g()", "'ReferenceError: Prefix ++ operator applied to value that is not a reference.'");
+shouldThrow("--g()", "'ReferenceError: Prefix -- operator applied to value that is not a reference.'");
+shouldThrow("g() = 1", "'ReferenceError: Left side of assignment is not a reference.'");
+shouldThrow("g() += 1", "'ReferenceError: Left side of assignment is not a reference.'");

Powered by Google App Engine
This is Rietveld 408576698