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

Side by Side Diff: Source/bindings/v8/ExceptionState.h

Issue 105693002: Generate a bit less code to handle failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 , m_context(context) 74 , m_context(context)
75 , m_propertyName(0) 75 , m_propertyName(0)
76 , m_interfaceName(interfaceName) 76 , m_interfaceName(interfaceName)
77 , m_creationContext(creationContext) 77 , m_creationContext(creationContext)
78 , m_isolate(isolate) { ASSERT(m_context == ConstructionContext); } 78 , m_isolate(isolate) { ASSERT(m_context == ConstructionContext); }
79 79
80 virtual void throwDOMException(const ExceptionCode&, const String& message); 80 virtual void throwDOMException(const ExceptionCode&, const String& message);
81 virtual void throwTypeError(const String& message); 81 virtual void throwTypeError(const String& message);
82 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()); 82 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String());
83 83
84 // Throw a TypeError if too few arguments were supplied.
85 void notEnoughArguments(int expected, int actual);
Mike West 2013/12/05 11:48:59 Hrm. 1. This should have "throw" in the name. 2.
sof 2013/12/09 22:53:20 (FTR, there are currently 484 applications of this
86
84 // Please don't use these methods. Use ::throwDOMException and ::throwTypeEr ror, and pass in a useful exception message. 87 // Please don't use these methods. Use ::throwDOMException and ::throwTypeEr ror, and pass in a useful exception message.
85 virtual void throwUninformativeAndGenericDOMException(const ExceptionCode& e c) { throwDOMException(ec, String()); } 88 virtual void throwUninformativeAndGenericDOMException(const ExceptionCode& e c) { throwDOMException(ec, String()); }
86 virtual void throwUninformativeAndGenericTypeError() { throwTypeError(String ()); } 89 virtual void throwUninformativeAndGenericTypeError() { throwTypeError(String ()); }
87 90
88 bool hadException() const { return !m_exception.isEmpty() || m_code; } 91 bool hadException() const { return !m_exception.isEmpty() || m_code; }
89 void clearException(); 92 void clearException();
90 93
91 ExceptionCode code() const { return m_code; } 94 ExceptionCode code() const { return m_code; }
92 95
93 bool throwIfNeeded() 96 bool throwIfNeeded()
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 public: 129 public:
127 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } 130 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { }
128 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL; 131 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL;
129 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ; 132 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ;
130 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL; 133 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL;
131 }; 134 };
132 135
133 } // namespace WebCore 136 } // namespace WebCore
134 137
135 #endif // ExceptionState_h 138 #endif // ExceptionState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698