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

Side by Side Diff: test/cctest/test-api.cc

Issue 1481513002: Revert of Removed support deprecated (//@|/*@) source(URL|MappingURL)= (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/scanner.cc ('k') | test/mjsunit/regress/regress-conditional-position.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 15303 matching lines...) Expand 10 before | Expand all | Expand 10 after
15314 "\n" 15314 "\n"
15315 " bar();\n" 15315 " bar();\n"
15316 "}\n" 15316 "}\n"
15317 "foo();\n" 15317 "foo();\n"
15318 "}\n" 15318 "}\n"
15319 "eval('(' + outer +')()%s');"; 15319 "eval('(' + outer +')()%s');";
15320 15320
15321 i::ScopedVector<char> code(1024); 15321 i::ScopedVector<char> code(1024);
15322 i::SNPrintF(code, source, "//# sourceURL=eval_url"); 15322 i::SNPrintF(code, source, "//# sourceURL=eval_url");
15323 CHECK(CompileRun(code.start())->IsUndefined()); 15323 CHECK(CompileRun(code.start())->IsUndefined());
15324 i::SNPrintF(code, source, "//@ sourceURL=eval_url");
15325 CHECK(CompileRun(code.start())->IsUndefined());
15324 } 15326 }
15325 15327
15326 15328
15327 static int scriptIdInStack[2]; 15329 static int scriptIdInStack[2];
15328 15330
15329 void AnalyzeScriptIdInStack( 15331 void AnalyzeScriptIdInStack(
15330 const v8::FunctionCallbackInfo<v8::Value>& args) { 15332 const v8::FunctionCallbackInfo<v8::Value>& args) {
15331 v8::HandleScope scope(args.GetIsolate()); 15333 v8::HandleScope scope(args.GetIsolate());
15332 v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( 15334 v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
15333 args.GetIsolate(), 10, v8::StackTrace::kScriptId); 15335 args.GetIsolate(), 10, v8::StackTrace::kScriptId);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
15395 "\n" 15397 "\n"
15396 " bar();\n" 15398 " bar();\n"
15397 "}\n" 15399 "}\n"
15398 "foo();\n" 15400 "foo();\n"
15399 "}\n" 15401 "}\n"
15400 "outer()\n%s"; 15402 "outer()\n%s";
15401 15403
15402 i::ScopedVector<char> code(1024); 15404 i::ScopedVector<char> code(1024);
15403 i::SNPrintF(code, source, "//# sourceURL=source_url"); 15405 i::SNPrintF(code, source, "//# sourceURL=source_url");
15404 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined()); 15406 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined());
15407 i::SNPrintF(code, source, "//@ sourceURL=source_url");
15408 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined());
15405 } 15409 }
15406 15410
15407 15411
15408 void AnalyzeStackOfDynamicScriptWithSourceURL( 15412 void AnalyzeStackOfDynamicScriptWithSourceURL(
15409 const v8::FunctionCallbackInfo<v8::Value>& args) { 15413 const v8::FunctionCallbackInfo<v8::Value>& args) {
15410 v8::HandleScope scope(args.GetIsolate()); 15414 v8::HandleScope scope(args.GetIsolate());
15411 v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( 15415 v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
15412 args.GetIsolate(), 10, v8::StackTrace::kDetailed); 15416 args.GetIsolate(), 10, v8::StackTrace::kDetailed);
15413 CHECK_EQ(4, stackTrace->GetFrameCount()); 15417 CHECK_EQ(4, stackTrace->GetFrameCount());
15414 v8::Handle<v8::String> url = v8_str("source_url"); 15418 v8::Handle<v8::String> url = v8_str("source_url");
(...skipping 24 matching lines...) Expand all
15439 "\n" 15443 "\n"
15440 " bar();\n" 15444 " bar();\n"
15441 "}\n" 15445 "}\n"
15442 "foo();\n" 15446 "foo();\n"
15443 "}\n" 15447 "}\n"
15444 "outer()\n%s"; 15448 "outer()\n%s";
15445 15449
15446 i::ScopedVector<char> code(1024); 15450 i::ScopedVector<char> code(1024);
15447 i::SNPrintF(code, source, "//# sourceURL=source_url"); 15451 i::SNPrintF(code, source, "//# sourceURL=source_url");
15448 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); 15452 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined());
15453 i::SNPrintF(code, source, "//@ sourceURL=source_url");
15454 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined());
15449 } 15455 }
15450 15456
15451 15457
15452 TEST(DynamicWithSourceURLInStackTraceString) { 15458 TEST(DynamicWithSourceURLInStackTraceString) {
15453 LocalContext context; 15459 LocalContext context;
15454 v8::HandleScope scope(context->GetIsolate()); 15460 v8::HandleScope scope(context->GetIsolate());
15455 15461
15456 const char *source = 15462 const char *source =
15457 "function outer() {\n" 15463 "function outer() {\n"
15458 " function foo() {\n" 15464 " function foo() {\n"
(...skipping 6760 matching lines...) Expand 10 before | Expand all | Expand 10 after
22219 env2->Global()->Set(v8_str("obj2"), object2); 22225 env2->Global()->Set(v8_str("obj2"), object2);
22220 ExpectString("typeof obj2.values", "function"); 22226 ExpectString("typeof obj2.values", "function");
22221 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); 22227 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values")));
22222 22228
22223 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); 22229 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values")));
22224 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); 22230 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2));
22225 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); 22231 auto ctx2 = v8::Utils::OpenHandle(*env2.local());
22226 CHECK_EQ(fn2->GetCreationContext(), *ctx2); 22232 CHECK_EQ(fn2->GetCreationContext(), *ctx2);
22227 } 22233 }
22228 } 22234 }
OLDNEW
« no previous file with comments | « src/scanner.cc ('k') | test/mjsunit/regress/regress-conditional-position.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698