Revision: 5031
Author: [email protected]
Date: Wed Jul 7 04:31:33 2010
Log: Test for correct exception message in invalid preparse data test in
test-api.cc
Review URL: http://codereview.chromium.org/2829049
http://code.google.com/p/v8/source/detail?r=5031
Modified:
/branches/bleeding_edge/test/cctest/test-api.cc
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Wed Jul 7 03:28:22 2010
+++ /branches/bleeding_edge/test/cctest/test-api.cc Wed Jul 7 04:31:33 2010
@@ -8581,14 +8581,25 @@
// Overwrite function bar's end position with 0.
sd_data[kHeaderSize + 1 * kFunctionEntrySize + kFunctionEntryEndOffset]
= 0;
+ v8::TryCatch try_catch;
+
Local<String> source = String::New(script);
Local<Script> compiled_script = Script::New(source, NULL, sd);
-
+ CHECK(try_catch.HasCaught());
+ String::AsciiValue exception_value(try_catch.Message()->Get());
+ CHECK_EQ("Uncaught SyntaxError: Invalid preparser data for function bar",
+ *exception_value);
+
+ try_catch.Reset();
// Overwrite function bar's start position with 200. The function entry
// will not be found when searching for it by position.
sd_data[kHeaderSize + 1 * kFunctionEntrySize +
kFunctionEntryStartOffset] =
200;
compiled_script = Script::New(source, NULL, sd);
+ CHECK(try_catch.HasCaught());
+ String::AsciiValue second_exception_value(try_catch.Message()->Get());
+ CHECK_EQ("Uncaught SyntaxError: Invalid preparser data for function bar",
+ *second_exception_value);
delete sd;
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev