OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 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 |
11 * copyright notice, this list of conditions and the following disclaimer | 11 * copyright notice, this list of conditions and the following disclaimer |
12 * in the documentation and/or other materials provided with the | 12 * in the documentation and/or other materials provided with the |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 v8::Local<v8::String> scriptString = v8ExternalString(script); | 198 v8::Local<v8::String> scriptString = v8ExternalString(script); |
199 v8::Handle<v8::Script> compiledScript = V8Proxy::compileScript(scriptString,
fileName, scriptStartPosition); | 199 v8::Handle<v8::Script> compiledScript = V8Proxy::compileScript(scriptString,
fileName, scriptStartPosition); |
200 v8::Local<v8::Value> result = runScript(compiledScript); | 200 v8::Local<v8::Value> result = runScript(compiledScript); |
201 | 201 |
202 if (!exceptionCatcher.CanContinue()) | 202 if (!exceptionCatcher.CanContinue()) |
203 return ScriptValue(); | 203 return ScriptValue(); |
204 | 204 |
205 if (exceptionCatcher.HasCaught()) { | 205 if (exceptionCatcher.HasCaught()) { |
206 v8::Local<v8::Message> message = exceptionCatcher.Message(); | 206 v8::Local<v8::Message> message = exceptionCatcher.Message(); |
207 state->hadException = true; | 207 state->hadException = true; |
208 state->exception = ScriptValue(exceptionCatcher.Exception()); | |
209 state->errorMessage = toWebCoreString(message->Get()); | 208 state->errorMessage = toWebCoreString(message->Get()); |
210 state->lineNumber = message->GetLineNumber(); | 209 state->lineNumber = message->GetLineNumber(); |
211 state->sourceURL = toWebCoreString(message->GetScriptResourceName()); | 210 state->sourceURL = toWebCoreString(message->GetScriptResourceName()); |
| 211 if (m_workerContext->sanitizeScriptError(state->errorMessage, state->lin
eNumber, state->sourceURL)) |
| 212 state->exception = V8Proxy::throwError(V8Proxy::GeneralError, state-
>errorMessage.utf8().data()); |
| 213 else |
| 214 state->exception = ScriptValue(exceptionCatcher.Exception()); |
| 215 |
212 exceptionCatcher.Reset(); | 216 exceptionCatcher.Reset(); |
213 } else | 217 } else |
214 state->hadException = false; | 218 state->hadException = false; |
215 | 219 |
216 if (result.IsEmpty() || result->IsUndefined()) | 220 if (result.IsEmpty() || result->IsUndefined()) |
217 return ScriptValue(); | 221 return ScriptValue(); |
218 | 222 |
219 return ScriptValue(result); | 223 return ScriptValue(result); |
220 } | 224 } |
221 | 225 |
(...skipping 30 matching lines...) Expand all Loading... |
252 } | 256 } |
253 | 257 |
254 void WorkerContextExecutionProxy::trackEvent(Event* event) | 258 void WorkerContextExecutionProxy::trackEvent(Event* event) |
255 { | 259 { |
256 m_events.append(event); | 260 m_events.append(event); |
257 } | 261 } |
258 | 262 |
259 } // namespace WebCore | 263 } // namespace WebCore |
260 | 264 |
261 #endif // ENABLE(WORKERS) | 265 #endif // ENABLE(WORKERS) |
OLD | NEW |