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

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

Issue 1308123006: [V8] Report JSON parser script to DevTools (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/json-parser.h ('k') | no next file » | 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 6345 matching lines...) Expand 10 before | Expand all | Expand 10 after
6356 CHECK_EQ(0, compile_error_event_count); 6356 CHECK_EQ(0, compile_error_event_count);
6357 6357
6358 // Throws SyntaxError: Unexpected end of input 6358 // Throws SyntaxError: Unexpected end of input
6359 v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "+++")); 6359 v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "+++"));
6360 CHECK_EQ(1, compile_error_event_count); 6360 CHECK_EQ(1, compile_error_event_count);
6361 6361
6362 v8::Script::Compile( 6362 v8::Script::Compile(
6363 v8::String::NewFromUtf8(env->GetIsolate(), "/sel\\/: \\")); 6363 v8::String::NewFromUtf8(env->GetIsolate(), "/sel\\/: \\"));
6364 CHECK_EQ(2, compile_error_event_count); 6364 CHECK_EQ(2, compile_error_event_count);
6365 6365
6366 v8::Script::Compile( 6366 v8::Local<v8::Script> script = v8::Script::Compile(
6367 v8::String::NewFromUtf8(env->GetIsolate(), "JSON.parse('1234:')")); 6367 v8::String::NewFromUtf8(env->GetIsolate(), "JSON.parse('1234:')"));
6368 CHECK_EQ(2, compile_error_event_count); 6368 CHECK_EQ(2, compile_error_event_count);
6369 script->Run();
6370 CHECK_EQ(3, compile_error_event_count);
6369 6371
6370 v8::Script::Compile( 6372 v8::Script::Compile(
6371 v8::String::NewFromUtf8(env->GetIsolate(), "new RegExp('/\\/\\\\');")); 6373 v8::String::NewFromUtf8(env->GetIsolate(), "new RegExp('/\\/\\\\');"));
6372 CHECK_EQ(2, compile_error_event_count); 6374 CHECK_EQ(3, compile_error_event_count);
6373 6375
6374 v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "throw 1;")); 6376 v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "throw 1;"));
6375 CHECK_EQ(2, compile_error_event_count); 6377 CHECK_EQ(3, compile_error_event_count);
6376 } 6378 }
6377 6379
6378 6380
6379 // Tests that break event is sent when message handler is reset. 6381 // Tests that break event is sent when message handler is reset.
6380 TEST(BreakMessageWhenMessageHandlerIsReset) { 6382 TEST(BreakMessageWhenMessageHandlerIsReset) {
6381 DebugLocalContext env; 6383 DebugLocalContext env;
6382 v8::HandleScope scope(env->GetIsolate()); 6384 v8::HandleScope scope(env->GetIsolate());
6383 after_compile_message_count = 0; 6385 after_compile_message_count = 0;
6384 const char* script = "function f() {};"; 6386 const char* script = "function f() {};";
6385 6387
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
7617 "let y = 2; \n" 7619 "let y = 2; \n"
7618 "debugger; \n" 7620 "debugger; \n"
7619 "x * y", 7621 "x * y",
7620 30); 7622 30);
7621 ExpectInt32( 7623 ExpectInt32(
7622 "x = 1; y = 2; \n" 7624 "x = 1; y = 2; \n"
7623 "debugger;" 7625 "debugger;"
7624 "x * y", 7626 "x * y",
7625 30); 7627 30);
7626 } 7628 }
OLDNEW
« no previous file with comments | « src/json-parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698