OLD | NEW |
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 17476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17487 "\n" | 17487 "\n" |
17488 " bar();\n" | 17488 " bar();\n" |
17489 "}\n" | 17489 "}\n" |
17490 "foo();\n" | 17490 "foo();\n" |
17491 "}\n" | 17491 "}\n" |
17492 "eval('(' + outer +')()%s');"; | 17492 "eval('(' + outer +')()%s');"; |
17493 | 17493 |
17494 i::ScopedVector<char> code(1024); | 17494 i::ScopedVector<char> code(1024); |
17495 i::SNPrintF(code, source, "//# sourceURL=eval_url"); | 17495 i::SNPrintF(code, source, "//# sourceURL=eval_url"); |
17496 CHECK(CompileRun(code.start())->IsUndefined()); | 17496 CHECK(CompileRun(code.start())->IsUndefined()); |
| 17497 i::SNPrintF(code, source, "//@ sourceURL=eval_url"); |
| 17498 CHECK(CompileRun(code.start())->IsUndefined()); |
17497 } | 17499 } |
17498 | 17500 |
17499 | 17501 |
17500 static int scriptIdInStack[2]; | 17502 static int scriptIdInStack[2]; |
17501 | 17503 |
17502 void AnalyzeScriptIdInStack( | 17504 void AnalyzeScriptIdInStack( |
17503 const v8::FunctionCallbackInfo<v8::Value>& args) { | 17505 const v8::FunctionCallbackInfo<v8::Value>& args) { |
17504 v8::HandleScope scope(args.GetIsolate()); | 17506 v8::HandleScope scope(args.GetIsolate()); |
17505 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( | 17507 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( |
17506 args.GetIsolate(), 10, v8::StackTrace::kScriptId); | 17508 args.GetIsolate(), 10, v8::StackTrace::kScriptId); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17567 "\n" | 17569 "\n" |
17568 " bar();\n" | 17570 " bar();\n" |
17569 "}\n" | 17571 "}\n" |
17570 "foo();\n" | 17572 "foo();\n" |
17571 "}\n" | 17573 "}\n" |
17572 "outer()\n%s"; | 17574 "outer()\n%s"; |
17573 | 17575 |
17574 i::ScopedVector<char> code(1024); | 17576 i::ScopedVector<char> code(1024); |
17575 i::SNPrintF(code, source, "//# sourceURL=source_url"); | 17577 i::SNPrintF(code, source, "//# sourceURL=source_url"); |
17576 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined()); | 17578 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined()); |
| 17579 i::SNPrintF(code, source, "//@ sourceURL=source_url"); |
| 17580 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined()); |
17577 } | 17581 } |
17578 | 17582 |
17579 | 17583 |
17580 void AnalyzeStackOfDynamicScriptWithSourceURL( | 17584 void AnalyzeStackOfDynamicScriptWithSourceURL( |
17581 const v8::FunctionCallbackInfo<v8::Value>& args) { | 17585 const v8::FunctionCallbackInfo<v8::Value>& args) { |
17582 v8::HandleScope scope(args.GetIsolate()); | 17586 v8::HandleScope scope(args.GetIsolate()); |
17583 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( | 17587 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( |
17584 args.GetIsolate(), 10, v8::StackTrace::kDetailed); | 17588 args.GetIsolate(), 10, v8::StackTrace::kDetailed); |
17585 CHECK_EQ(4, stackTrace->GetFrameCount()); | 17589 CHECK_EQ(4, stackTrace->GetFrameCount()); |
17586 v8::Local<v8::String> url = v8_str("source_url"); | 17590 v8::Local<v8::String> url = v8_str("source_url"); |
(...skipping 24 matching lines...) Expand all Loading... |
17611 "\n" | 17615 "\n" |
17612 " bar();\n" | 17616 " bar();\n" |
17613 "}\n" | 17617 "}\n" |
17614 "foo();\n" | 17618 "foo();\n" |
17615 "}\n" | 17619 "}\n" |
17616 "outer()\n%s"; | 17620 "outer()\n%s"; |
17617 | 17621 |
17618 i::ScopedVector<char> code(1024); | 17622 i::ScopedVector<char> code(1024); |
17619 i::SNPrintF(code, source, "//# sourceURL=source_url"); | 17623 i::SNPrintF(code, source, "//# sourceURL=source_url"); |
17620 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); | 17624 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
| 17625 i::SNPrintF(code, source, "//@ sourceURL=source_url"); |
| 17626 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
17621 } | 17627 } |
17622 | 17628 |
17623 | 17629 |
17624 TEST(DynamicWithSourceURLInStackTraceString) { | 17630 TEST(DynamicWithSourceURLInStackTraceString) { |
17625 LocalContext context; | 17631 LocalContext context; |
17626 v8::HandleScope scope(context->GetIsolate()); | 17632 v8::HandleScope scope(context->GetIsolate()); |
17627 | 17633 |
17628 const char *source = | 17634 const char *source = |
17629 "function outer() {\n" | 17635 "function outer() {\n" |
17630 " function foo() {\n" | 17636 " function foo() {\n" |
(...skipping 7248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24879 CHECK(proxy->GetTarget()->SameValue(target)); | 24885 CHECK(proxy->GetTarget()->SameValue(target)); |
24880 CHECK(proxy->GetHandler()->SameValue(handler)); | 24886 CHECK(proxy->GetHandler()->SameValue(handler)); |
24881 | 24887 |
24882 proxy->Revoke(); | 24888 proxy->Revoke(); |
24883 CHECK(proxy->IsProxy()); | 24889 CHECK(proxy->IsProxy()); |
24884 CHECK(!target->IsProxy()); | 24890 CHECK(!target->IsProxy()); |
24885 CHECK(proxy->IsRevoked()); | 24891 CHECK(proxy->IsRevoked()); |
24886 CHECK(proxy->GetTarget()->SameValue(target)); | 24892 CHECK(proxy->GetTarget()->SameValue(target)); |
24887 CHECK(proxy->GetHandler()->IsNull()); | 24893 CHECK(proxy->GetHandler()->IsNull()); |
24888 } | 24894 } |
OLD | NEW |