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

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

Issue 1927003003: Version 5.0.71.40 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: Created 4 years, 8 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/x87/code-stubs-x87.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-regexp.cc
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
index 14ec12f21b87f98bdc19693e48cec099af9f98b8..22321c36643e09e264a8b38706dd60067c19e02f 100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -1967,3 +1967,26 @@ TEST(UseCountRegExp) {
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]);
CHECK(resultToStringError->IsObject());
}
+
+class UncachedExternalString
+ : public v8::String::ExternalOneByteStringResource {
+ public:
+ const char* data() const override { return "abcdefghijklmnopqrstuvwxyz"; }
+ size_t length() const override { return 26; }
+ bool IsCompressible() const override { return true; }
+};
+
+TEST(UncachedExternalString) {
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+ LocalContext env;
+ v8::Local<v8::String> external =
+ v8::String::NewExternalOneByte(isolate, new UncachedExternalString())
+ .ToLocalChecked();
+ CHECK(v8::Utils::OpenHandle(*external)->map() ==
+ CcTest::i_isolate()->heap()->short_external_one_byte_string_map());
+ v8::Local<v8::Object> global = env->Global();
+ global->Set(env.local(), v8_str("external"), external).FromJust();
+ CompileRun("var re = /y(.)/; re.test('ab');");
+ ExpectString("external.substring(1).match(re)[1]", "z");
+}
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698