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

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

Issue 1213783002: Put getter functions on Script line-endings objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 5 years, 6 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 | « test/cctest/cctest.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 5982 matching lines...) Expand 10 before | Expand all | Expand 10 after
5993 USE(evil_script); 5993 USE(evil_script);
5994 Handle<i::ExternalTwoByteString> i_source( 5994 Handle<i::ExternalTwoByteString> i_source(
5995 i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source))); 5995 i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source)));
5996 // This situation can happen if source was an external string disposed 5996 // This situation can happen if source was an external string disposed
5997 // by its owner. 5997 // by its owner.
5998 i_source->set_resource(0); 5998 i_source->set_resource(0);
5999 5999
6000 bool allow_natives_syntax = i::FLAG_allow_natives_syntax; 6000 bool allow_natives_syntax = i::FLAG_allow_natives_syntax;
6001 i::FLAG_allow_natives_syntax = true; 6001 i::FLAG_allow_natives_syntax = true;
6002 EnableDebugger(); 6002 EnableDebugger();
6003 CompileRun( 6003 v8::MaybeLocal<v8::Value> result =
6004 "var scripts = %DebugGetLoadedScripts();" 6004 CompileRun(env.context(),
6005 "var count = scripts.length;" 6005 "var scripts = %DebugGetLoadedScripts();"
6006 "for (var i = 0; i < count; ++i) {" 6006 "var count = scripts.length;"
6007 " scripts[i].line_ends;" 6007 "for (var i = 0; i < count; ++i) {"
6008 "}"); 6008 " var lines = scripts[i].lineCount();"
6009 " if (lines < 1) throw 'lineCount';"
6010 " var last = -1;"
6011 " for (var j = 0; j < lines; ++j) {"
6012 " var end = scripts[i].lineEnd(j);"
6013 " if (last >= end) throw 'lineEnd';"
6014 " last = end;"
6015 " }"
6016 "}");
6017 CHECK(!result.IsEmpty());
6009 DisableDebugger(); 6018 DisableDebugger();
6010 // Must not crash while accessing line_ends. 6019 // Must not crash while accessing line_ends.
6011 i::FLAG_allow_natives_syntax = allow_natives_syntax; 6020 i::FLAG_allow_natives_syntax = allow_natives_syntax;
6012 6021
6013 // Some scripts are retrieved - at least the number of native scripts. 6022 // Some scripts are retrieved - at least the number of native scripts.
6014 CHECK_GT((*env) 6023 CHECK_GT((*env)
6015 ->Global() 6024 ->Global()
6016 ->Get(v8::String::NewFromUtf8(env->GetIsolate(), "count")) 6025 ->Get(v8::String::NewFromUtf8(env->GetIsolate(), "count"))
6017 ->Int32Value(), 6026 ->Int32Value(),
6018 8); 6027 8);
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
7683 "let y = 2; \n" 7692 "let y = 2; \n"
7684 "debugger; \n" 7693 "debugger; \n"
7685 "x * y", 7694 "x * y",
7686 30); 7695 30);
7687 ExpectInt32( 7696 ExpectInt32(
7688 "x = 1; y = 2; \n" 7697 "x = 1; y = 2; \n"
7689 "debugger;" 7698 "debugger;"
7690 "x * y", 7699 "x * y",
7691 30); 7700 30);
7692 } 7701 }
OLDNEW
« no previous file with comments | « test/cctest/cctest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698