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

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

Issue 2959007: Fix preparsing from a source string that is not external.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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
« no previous file with comments | « src/scanner.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
===================================================================
--- test/cctest/test-api.cc (revision 5044)
+++ test/cctest/test-api.cc (working copy)
@@ -8612,20 +8612,31 @@
v8::HandleScope scope;
const char* cstring = "function foo(a) { return a+1; }";
+
v8::ScriptData* sd_from_cstring =
v8::ScriptData::PreCompile(cstring, i::StrLength(cstring));
TestAsciiResource* resource = new TestAsciiResource(cstring);
- v8::ScriptData* sd_from_istring = v8::ScriptData::PreCompile(
+ v8::ScriptData* sd_from_external_string = v8::ScriptData::PreCompile(
v8::String::NewExternal(resource));
- CHECK_EQ(sd_from_cstring->Length(), sd_from_istring->Length());
+ v8::ScriptData* sd_from_string = v8::ScriptData::PreCompile(
+ v8::String::New(cstring));
+
+ CHECK_EQ(sd_from_cstring->Length(), sd_from_external_string->Length());
CHECK_EQ(0, memcmp(sd_from_cstring->Data(),
- sd_from_istring->Data(),
+ sd_from_external_string->Data(),
sd_from_cstring->Length()));
+ CHECK_EQ(sd_from_cstring->Length(), sd_from_string->Length());
+ CHECK_EQ(0, memcmp(sd_from_cstring->Data(),
+ sd_from_string->Data(),
+ sd_from_cstring->Length()));
+
+
delete sd_from_cstring;
- delete sd_from_istring;
+ delete sd_from_external_string;
+ delete sd_from_string;
}
« no previous file with comments | « src/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698