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

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

Issue 20679002: Add 'colno' attribute to ErrorEvent interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (!event->hasInterface(eventNames().interfaceForErrorEvent)) 49 if (!event->hasInterface(eventNames().interfaceForErrorEvent))
50 return V8EventListener::callListenerFunction(context, jsEvent, event); 50 return V8EventListener::callListenerFunction(context, jsEvent, event);
51 51
52 ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event); 52 ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
53 v8::Local<v8::Object> listener = getListenerObject(context); 53 v8::Local<v8::Object> listener = getListenerObject(context);
54 v8::Isolate* isolate = toV8Context(context, world())->GetIsolate(); 54 v8::Isolate* isolate = toV8Context(context, world())->GetIsolate();
55 v8::Local<v8::Value> returnValue; 55 v8::Local<v8::Value> returnValue;
56 if (!listener.IsEmpty() && listener->IsFunction()) { 56 if (!listener.IsEmpty() && listener->IsFunction()) {
57 v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(lis tener); 57 v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(lis tener);
58 v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global(); 58 v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
59 v8::Handle<v8::Value> parameters[4] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent ->lineno(), isolate), v8::Integer::New(errorEvent->column(), isolate) }; 59 v8::Handle<v8::Value> parameters[4] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent ->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate) };
60 v8::TryCatch tryCatch; 60 v8::TryCatch tryCatch;
61 tryCatch.SetVerbose(true); 61 tryCatch.SetVerbose(true);
62 if (worldType(isolate) == WorkerWorld) 62 if (worldType(isolate) == WorkerWorld)
63 returnValue = V8ScriptRunner::callFunction(callFunction, context, th isValue, WTF_ARRAY_LENGTH(parameters), parameters); 63 returnValue = V8ScriptRunner::callFunction(callFunction, context, th isValue, WTF_ARRAY_LENGTH(parameters), parameters);
64 else 64 else
65 returnValue = ScriptController::callFunctionWithInstrumentation(0, c allFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters); 65 returnValue = ScriptController::callFunctionWithInstrumentation(0, c allFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters);
66 } 66 }
67 return returnValue; 67 return returnValue;
68 } 68 }
69 69
70 bool V8ErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue) 70 bool V8ErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue)
71 { 71 {
72 return returnValue->IsBoolean() && returnValue->BooleanValue(); 72 return returnValue->IsBoolean() && returnValue->BooleanValue();
73 } 73 }
74 74
75 } // namespace WebCore 75 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698