inspector: do not use SeekForward to move backward
We can use Seek + Advance instead on source stream. TBR=verwaest@chromium.org Bug: chromium:879550 Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Ic6ad12a86105ce68ea404e313b74d11417928cf0 Reviewed-on: https://chromium-review.googlesource.com/1196686 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#55552}
This commit is contained in:
parent
bd9df9a797
commit
3fd1f8a7b4
@ -1881,7 +1881,8 @@ void EnsureMagicComments(Isolate* isolate, Handle<Script> script) {
|
||||
handle(Smi::FromInt(prev_start), isolate)));
|
||||
if (start == -1) return;
|
||||
|
||||
scanner.SeekForward(start);
|
||||
scanner_stream->Seek(start);
|
||||
scanner_stream->Advance();
|
||||
scanner.Next();
|
||||
|
||||
Handle<String> source_url = scanner.SourceUrl(isolate);
|
||||
|
@ -657,6 +657,24 @@ scriptParsed
|
||||
url : eval.js
|
||||
}
|
||||
scriptFailedToParse
|
||||
{
|
||||
scriptSource : {a:2:<nl>//# sourceURL=http://a.js
|
||||
}
|
||||
{
|
||||
endColumn : 25
|
||||
endLine : 1
|
||||
executionContextId : <executionContextId>
|
||||
hasSourceURL : true
|
||||
hash : 33c5612558c02e5a3bfa0d098c82865f38f98df2
|
||||
isModule : false
|
||||
length : 31
|
||||
scriptId : <scriptId>
|
||||
sourceMapURL :
|
||||
startColumn : 0
|
||||
startLine : 0
|
||||
url : http://a.js
|
||||
}
|
||||
scriptFailedToParse
|
||||
{
|
||||
scriptSource : }//# sourceURL=failed.js<nl>//# sourceMappingURL=failed-map
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ function addScripts() {
|
||||
.then(() => addScript("function foo13(){}"))
|
||||
// script in eval
|
||||
.then(() => addScript("function foo15(){}; eval(\"function foo14(){}//# sourceURL=eval.js\")//# sourceURL=eval-wrapper.js"))
|
||||
// // inside sourceURL
|
||||
.then(() => addScript("{a:2:\n//# sourceURL=http://a.js"))
|
||||
// sourceURL and sourceMappingURL works even for script with syntax error
|
||||
.then(() => addScript("}//# sourceURL=failed.js\n//# sourceMappingURL=failed-map"))
|
||||
.then(() => addScript("{a:2://# sourceURL=failed.js\n//# sourceMappingURL=failed-map"))
|
||||
|
Loading…
Reference in New Issue
Block a user