Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| index 2bd14c45bb227fb0244f90f5153562cd611cc540..e53f969ec7f285a950584febde72c62eb49fec89 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
| @@ -327,16 +327,16 @@ PassOwnPtr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, ScriptR |
| v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& source, v8::Isolate* isolate, AccessControlStatus accessControlStatus, V8CacheOptions cacheOptions) |
| { |
| - if (source.source().length() >= v8::String::kMaxLength) { |
| + if (!source.source().isNull() && source.source().length() >= v8::String::kMaxLength) { |
|
haraken
2015/11/24 11:15:41
I wonder why we need this change.
hajimehoshi
2015/11/26 10:49:13
This is my mistake... Done.
|
| V8ThrowException::throwGeneralError(isolate, "Source file too large."); |
| return v8::Local<v8::Script>(); |
| } |
| return compileScript(v8String(isolate, source.source()), source.url(), source.sourceMapUrl(), source.startPosition(), isolate, source.resource(), source.streamer(), source.resource() ? source.resource()->cacheHandler() : nullptr, accessControlStatus, cacheOptions); |
| } |
| -v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const String& code, const String& fileName, const String& sourceMapUrl, const TextPosition& textPosition, v8::Isolate* isolate, CachedMetadataHandler* cacheMetadataHandler, AccessControlStatus accessControlStatus, V8CacheOptions v8CacheOptions) |
| +v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const CompressableString& code, const String& fileName, const String& sourceMapUrl, const TextPosition& textPosition, v8::Isolate* isolate, CachedMetadataHandler* cacheMetadataHandler, AccessControlStatus accessControlStatus, V8CacheOptions v8CacheOptions) |
| { |
| - if (code.length() >= v8::String::kMaxLength) { |
| + if (!code.isNull() && code.length() >= v8::String::kMaxLength) { |
|
haraken
2015/11/24 11:15:41
Ditto.
hajimehoshi
2015/11/26 10:49:13
Done.
|
| V8ThrowException::throwGeneralError(isolate, "Source file too large."); |
| return v8::Local<v8::Script>(); |
| } |