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

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

Issue 7685005: Inserted a missing string encoding check in lastIndexOf. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Included a test case. Created 9 years, 4 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
« src/runtime.cc ('K') | « src/string.js ('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 3ed6b523f0ead3b11453c4e36e0aa23c6b0c2511..e206bb9ac366f3ed1ade216406cf9914410b6ca0 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -13693,6 +13693,9 @@ THREADED_TEST(TwoByteStringInAsciiCons) {
"str2;";
Local<Value> result = CompileRun(init_code);
+ Local<Value> indexof = CompileRun("str2.indexOf('els')");
+ Local<Value> lastindexof = CompileRun("str2.lastIndexOf('dab')");
+
CHECK(result->IsString());
i::Handle<i::String> string = v8::Utils::OpenHandle(String::Cast(*result));
int length = string->length();
@@ -13758,6 +13761,10 @@ THREADED_TEST(TwoByteStringInAsciiCons) {
ExpectString("str2.charAt(2);", "e");
+ ExpectObject("str2.indexOf('els');", indexof);
+
+ ExpectObject("str2.lastIndexOf('dab');", lastindexof);
+
reresult = CompileRun("str2.charCodeAt(2);");
CHECK_EQ(static_cast<int32_t>('e'), reresult->Int32Value());
}
« src/runtime.cc ('K') | « src/string.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698