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

Side by Side Diff: Source/bindings/core/v8/V8Binding.h

Issue 460923002: Decouple arity errors creation from throwing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/bindings/core/v8/ScriptPromise.cpp ('k') | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 class ScriptWrappable; 58 class ScriptWrappable;
59 class XPathNSResolver; 59 class XPathNSResolver;
60 60
61 namespace TraceEvent { 61 namespace TraceEvent {
62 class ConvertableToTraceFormat; 62 class ConvertableToTraceFormat;
63 } 63 }
64 64
65 const int kMaxRecursionDepth = 22; 65 const int kMaxRecursionDepth = 22;
66 66
67 // Helpers for throwing JavaScript TypeErrors for arity mismatches. 67 // Helpers for throwing JavaScript TypeErrors for arity mismatches.
68 void throwArityTypeErrorForMethod(const char* method, const char* type, const ch ar* valid, unsigned provided, v8::Isolate*); 68 void setArityTypeError(ExceptionState&, const char* valid, unsigned provided);
69 void throwArityTypeErrorForConstructor(const char* type, const char* valid, unsi gned provided, v8::Isolate*); 69 v8::Local<v8::Value> createMinimumArityTypeErrorForMethod(const char* method, co nst char* type, unsigned expected, unsigned providedLeastNumMandatoryParams, v8: :Isolate*);
70 void throwArityTypeError(ExceptionState&, const char* valid, unsigned provided); 70 v8::Local<v8::Value> createMinimumArityTypeErrorForConstructor(const char* type, unsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*);
71 void throwMinimumArityTypeErrorForMethod(const char* method, const char* type, u nsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*); 71 void setMinimumArityTypeError(ExceptionState&, unsigned expected, unsigned provi dedLeastNumMandatoryParams);
72 void throwMinimumArityTypeErrorForConstructor(const char* type, unsigned expecte d, unsigned providedLeastNumMandatoryParams, v8::Isolate*);
73 void throwMinimumArityTypeError(ExceptionState&, unsigned expected, unsigned pro videdLeastNumMandatoryParams);
74 72
75 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); 73 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator();
76 74
77 template<typename CallbackInfo, typename V> 75 template<typename CallbackInfo, typename V>
78 inline void v8SetReturnValue(const CallbackInfo& info, V v) 76 inline void v8SetReturnValue(const CallbackInfo& info, V v)
79 { 77 {
80 info.GetReturnValue().Set(v); 78 info.GetReturnValue().Set(v);
81 } 79 }
82 80
83 template<typename CallbackInfo> 81 template<typename CallbackInfo>
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 m_block.ReThrow(); 956 m_block.ReThrow();
959 } 957 }
960 958
961 private: 959 private:
962 v8::TryCatch& m_block; 960 v8::TryCatch& m_block;
963 }; 961 };
964 962
965 } // namespace blink 963 } // namespace blink
966 964
967 #endif // V8Binding_h 965 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptPromise.cpp ('k') | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698