OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 ScriptState::Scope scope(m_scriptState.get()); | 176 ScriptState::Scope scope(m_scriptState.get()); |
177 | 177 |
178 if (!m_disableEvalPending.isEmpty()) { | 178 if (!m_disableEvalPending.isEmpty()) { |
179 m_scriptState->context()->AllowCodeGenerationFromStrings(false); | 179 m_scriptState->context()->AllowCodeGenerationFromStrings(false); |
180 m_scriptState->context()->SetErrorMessageForCodeGenerationFromStrings(v8
String(isolate(), m_disableEvalPending)); | 180 m_scriptState->context()->SetErrorMessageForCodeGenerationFromStrings(v8
String(isolate(), m_disableEvalPending)); |
181 m_disableEvalPending = String(); | 181 m_disableEvalPending = String(); |
182 } | 182 } |
183 | 183 |
184 v8::TryCatch block; | 184 v8::TryCatch block; |
185 | 185 |
186 v8::Handle<v8::String> scriptString = v8String(isolate(), script); | 186 v8::Handle<v8::Script> compiledScript = V8ScriptRunner::compileScript(script
, fileName, String(), scriptStartPosition, isolate(), cacheHandler, SharableCros
sOrigin, v8CacheOptions); |
187 v8::Handle<v8::Script> compiledScript = V8ScriptRunner::compileScript(script
String, fileName, String(), scriptStartPosition, isolate(), nullptr, nullptr, ca
cheHandler, SharableCrossOrigin, v8CacheOptions); | |
188 v8::Local<v8::Value> result = V8ScriptRunner::runCompiledScript(isolate(), c
ompiledScript, &m_workerGlobalScope); | 187 v8::Local<v8::Value> result = V8ScriptRunner::runCompiledScript(isolate(), c
ompiledScript, &m_workerGlobalScope); |
189 | 188 |
190 if (!block.CanContinue()) { | 189 if (!block.CanContinue()) { |
191 forbidExecution(); | 190 forbidExecution(); |
192 return ScriptValue(); | 191 return ScriptValue(); |
193 } | 192 } |
194 | 193 |
195 if (block.HasCaught()) { | 194 if (block.HasCaught()) { |
196 v8::Local<v8::Message> message = block.Message(); | 195 v8::Local<v8::Message> message = block.Message(); |
197 m_globalScopeExecutionState->hadException = true; | 196 m_globalScopeExecutionState->hadException = true; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 281 |
283 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) | 282 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) |
284 { | 283 { |
285 const String& errorMessage = errorEvent->message(); | 284 const String& errorMessage = errorEvent->message(); |
286 if (m_globalScopeExecutionState) | 285 if (m_globalScopeExecutionState) |
287 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent
; | 286 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent
; |
288 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(isola
te(), errorMessage)); | 287 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(isola
te(), errorMessage)); |
289 } | 288 } |
290 | 289 |
291 } // namespace blink | 290 } // namespace blink |
OLD | NEW |