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

Unified Diff: test/cctest/test-api.cc

Issue 542010: Added ScriptData::HasError. (Closed)
Patch Set: Created 10 years, 11 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
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 3e3c9578e3b23cf2641e126a76ae325d5d455bcc..3db7c37f1cd60bcaf4d5a31894dbdae9d2ba0809 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -6742,6 +6742,27 @@ TEST(PreCompile) {
v8::ScriptData::PreCompile(script, i::StrLength(script));
CHECK_NE(sd->Length(), 0);
CHECK_NE(sd->Data(), NULL);
+ CHECK(!sd->HasError());
+ delete sd;
+}
+
+
+TEST(PreCompileWithError) {
+ v8::V8::Initialize();
+ const char *script = "function foo(a) { return 1 * * 2; }";
+ v8::ScriptData *sd =
+ v8::ScriptData::PreCompile(script, i::StrLength(script));
+ CHECK(sd->HasError());
+ delete sd;
+}
+
+
+TEST(Regress31661) {
+ v8::V8::Initialize();
+ const char *script = " The Definintive Guide";
+ v8::ScriptData *sd =
+ v8::ScriptData::PreCompile(script, i::StrLength(script));
+ CHECK(sd->HasError());
delete sd;
}
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698