Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1019)

Side by Side Diff: Source/bindings/v8/WorkerScriptController.cpp

Issue 20351002: Add 'error' parameter to 'window.onerror' handlers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rework. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return ScriptValue(); 160 return ScriptValue();
161 } 161 }
162 162
163 if (block.HasCaught()) { 163 if (block.HasCaught()) {
164 v8::Local<v8::Message> message = block.Message(); 164 v8::Local<v8::Message> message = block.Message();
165 state->hadException = true; 165 state->hadException = true;
166 state->errorMessage = toWebCoreString(message->Get()); 166 state->errorMessage = toWebCoreString(message->Get());
167 state->lineNumber = message->GetLineNumber(); 167 state->lineNumber = message->GetLineNumber();
168 state->columnNumber = message->GetStartColumn(); 168 state->columnNumber = message->GetStartColumn();
169 state->sourceURL = toWebCoreString(message->GetScriptResourceName()); 169 state->sourceURL = toWebCoreString(message->GetScriptResourceName());
170 if (m_workerGlobalScope->sanitizeScriptError(state->errorMessage, state- >lineNumber, state->columnNumber, state->sourceURL)) 170 state->error = ScriptValue(block.Exception());
171 if (m_workerGlobalScope->sanitizeScriptError(state->errorMessage, state- >lineNumber, state->columnNumber, state->sourceURL, state->error))
171 state->exception = throwError(v8GeneralError, state->errorMessage.ut f8().data(), m_isolate); 172 state->exception = throwError(v8GeneralError, state->errorMessage.ut f8().data(), m_isolate);
172 else 173 else
173 state->exception = ScriptValue(block.Exception()); 174 state->exception = ScriptValue(block.Exception());
174 175
175 block.Reset(); 176 block.Reset();
176 } else 177 } else
177 state->hadException = false; 178 state->hadException = false;
178 179
179 if (result.IsEmpty() || result->IsUndefined()) 180 if (result.IsEmpty() || result->IsUndefined())
180 return ScriptValue(); 181 return ScriptValue();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 v8::Handle<v8::Object> global = context->Global(); 248 v8::Handle<v8::Object> global = context->Global();
248 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTempla te(context->GetIsolate(), WorkerWorld)); 249 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTempla te(context->GetIsolate(), WorkerWorld));
249 // Return 0 if the current executing context is not the worker context. 250 // Return 0 if the current executing context is not the worker context.
250 if (global.IsEmpty()) 251 if (global.IsEmpty())
251 return 0; 252 return 0;
252 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ; 253 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ;
253 return workerGlobalScope->script(); 254 return workerGlobalScope->script();
254 } 255 }
255 256
256 } // namespace WebCore 257 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698