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

Unified Diff: test/cctest/test-func-name-inference.cc

Issue 83343002: Remove usage of deprecated APIs from cctests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « test/cctest/test-deoptimization.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-func-name-inference.cc
diff --git a/test/cctest/test-func-name-inference.cc b/test/cctest/test-func-name-inference.cc
index 1a000afba29c8e53af4e283f9ccd866ce82b0e07..4e9d1b1922e44f9ae49236a7c57405c7cda45751 100644
--- a/test/cctest/test-func-name-inference.cc
+++ b/test/cctest/test-func-name-inference.cc
@@ -94,8 +94,8 @@ static void CheckFunctionName(v8::Handle<v8::Script> script,
}
-static v8::Handle<v8::Script> Compile(const char* src) {
- return v8::Script::Compile(v8::String::New(src));
+static v8::Handle<v8::Script> Compile(v8::Isolate* isolate, const char* src) {
+ return v8::Script::Compile(v8::String::NewFromUtf8(isolate, src));
}
@@ -104,6 +104,7 @@ TEST(GlobalProperty) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"fun1 = function() { return 1; }\n"
"fun2 = function() { return 2; }\n");
CheckFunctionName(script, "return 1", "fun1");
@@ -116,6 +117,7 @@ TEST(GlobalVar) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"var fun1 = function() { return 1; }\n"
"var fun2 = function() { return 2; }\n");
CheckFunctionName(script, "return 1", "fun1");
@@ -128,6 +130,7 @@ TEST(LocalVar) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function outer() {\n"
" var fun1 = function() { return 1; }\n"
" var fun2 = function() { return 2; }\n"
@@ -142,6 +145,7 @@ TEST(InConstructor) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function MyClass() {\n"
" this.method1 = function() { return 1; }\n"
" this.method2 = function() { return 2; }\n"
@@ -156,6 +160,7 @@ TEST(Factory) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function createMyObj() {\n"
" var obj = {};\n"
" obj.method1 = function() { return 1; }\n"
@@ -172,6 +177,7 @@ TEST(Static) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function MyClass() {}\n"
"MyClass.static1 = function() { return 1; }\n"
"MyClass.static2 = function() { return 2; }\n"
@@ -190,6 +196,7 @@ TEST(Prototype) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function MyClass() {}\n"
"MyClass.prototype.method1 = function() { return 1; }\n"
"MyClass.prototype.method2 = function() { return 2; }\n"
@@ -208,6 +215,7 @@ TEST(ObjectLiteral) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function MyClass() {}\n"
"MyClass.prototype = {\n"
" method1: function() { return 1; },\n"
@@ -222,6 +230,7 @@ TEST(AsParameter) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function f1(a) { return a(); }\n"
"function f2(a, b) { return a() + b(); }\n"
"var result1 = f1(function() { return 1; })\n"
@@ -238,6 +247,7 @@ TEST(MultipleFuncsConditional) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"fun1 = 0 ?\n"
" function() { return 1; } :\n"
" function() { return 2; }");
@@ -251,6 +261,7 @@ TEST(MultipleFuncsInLiteral) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function MyClass() {}\n"
"MyClass.prototype = {\n"
" method1: 0 ? function() { return 1; } :\n"
@@ -265,6 +276,7 @@ TEST(AnonymousInAnonymousClosure1) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"(function() {\n"
" (function() {\n"
" var a = 1;\n"
@@ -284,6 +296,7 @@ TEST(AnonymousInAnonymousClosure2) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"(function() {\n"
" (function() {\n"
" var a = 1;\n"
@@ -300,6 +313,7 @@ TEST(NamedInAnonymousClosure) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"var foo = function() {\n"
" (function named() {\n"
" var a = 1;\n"
@@ -317,6 +331,7 @@ TEST(Issue380) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function a() {\n"
"var result = function(p,a,c,k,e,d)"
"{return p}(\"if blah blah\",62,1976,\'a|b\'.split(\'|\'),0,{})\n"
@@ -330,6 +345,7 @@ TEST(MultipleAssignments) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"var fun1 = fun2 = function () { return 1; }\n"
"var bar1 = bar2 = bar3 = function () { return 2; }\n"
"foo1 = foo2 = function () { return 3; }\n"
@@ -346,6 +362,7 @@ TEST(AsConstructorParameter) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function Foo() {}\n"
"var foo = new Foo(function() { return 1; })\n"
"var bar = new Foo(function() { return 2; }, function() { return 3; })");
@@ -360,6 +377,7 @@ TEST(FactoryHashmap) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function createMyObj() {\n"
" var obj = {};\n"
" obj[\"method1\"] = function() { return 1; }\n"
@@ -376,6 +394,7 @@ TEST(FactoryHashmapVariable) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function createMyObj() {\n"
" var obj = {};\n"
" var methodName = \"method1\";\n"
@@ -395,6 +414,7 @@ TEST(FactoryHashmapConditional) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"function createMyObj() {\n"
" var obj = {};\n"
" obj[0 ? \"method1\" : \"method2\"] = function() { return 1; }\n"
@@ -410,6 +430,7 @@ TEST(GlobalAssignmentAndCall) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"var Foo = function() {\n"
" return 1;\n"
"}();\n"
@@ -428,6 +449,7 @@ TEST(AssignmentAndCall) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"(function Enclosing() {\n"
" var Foo;\n"
" Foo = function() {\n"
@@ -451,6 +473,7 @@ TEST(MethodAssignmentInAnonymousFunctionCall) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"(function () {\n"
" var EventSource = function () { };\n"
" EventSource.prototype.addListener = function () {\n"
@@ -467,6 +490,7 @@ TEST(ReturnAnonymousFunction) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Script> script = Compile(
+ CcTest::isolate(),
"(function() {\n"
" function wrapCode() {\n"
" return function () {\n"
« no previous file with comments | « test/cctest/test-deoptimization.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698