Commit 459a4d3a authored by Joel Einbinder's avatar Joel Einbinder Committed by Commit Bot

DevTools: Dont compile large files

Compiling very large files (40mb) will crash DevTools

Bug: 795363
Change-Id: I15108f3cc6b09daa3501782626dee734e3e3f049
Reviewed-on: https://chromium-review.googlesource.com/835416Reviewed-by: default avatarAndrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525221}
parent bd558ee9
...@@ -73,8 +73,11 @@ Sources.JavaScriptCompilerPlugin = class { ...@@ -73,8 +73,11 @@ Sources.JavaScriptCompilerPlugin = class {
if (!currentExecutionContext) if (!currentExecutionContext)
return; return;
this._compiling = true;
var code = this._textEditor.text(); var code = this._textEditor.text();
if (code.length > 1024 * 1024)
return;
this._compiling = true;
var result = await runtimeModel.compileScript(code, '', false, currentExecutionContext.id); var result = await runtimeModel.compileScript(code, '', false, currentExecutionContext.id);
this._compiling = false; this._compiling = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment