OLD | NEW |
---|---|
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 #define TOSTRING_VOID(type, var, value) \ | 70 #define TOSTRING_VOID(type, var, value) \ |
71 type var(value); \ | 71 type var(value); \ |
72 if (UNLIKELY(!var.prepare())) \ | 72 if (UNLIKELY(!var.prepare())) \ |
73 return; | 73 return; |
74 | 74 |
75 #define TOSTRING_DEFAULT(type, var, value, retVal) \ | 75 #define TOSTRING_DEFAULT(type, var, value, retVal) \ |
76 type var(value); \ | 76 type var(value); \ |
77 if (UNLIKELY(!var.prepare())) \ | 77 if (UNLIKELY(!var.prepare())) \ |
78 return retVal; | 78 return retVal; |
79 | 79 |
80 template <typename T> | |
81 bool inline getValueFromMaybe(v8::Maybe<T> maybe, T& outVariable) | |
Yuki
2015/03/11 07:55:22
nit: s/bool inline/inline bool/
bashi
2015/03/11 10:22:35
Done.
| |
82 { | |
83 if (maybe.IsNothing()) | |
84 return false; | |
85 outVariable = maybe.FromJust(); | |
86 return true; | |
87 } | |
88 | |
89 #define V8_CALL(outVariable, handle, methodCall, failureExpression) \ | |
Yuki
2015/03/11 07:55:22
nit: You cannot use 'break' in failureExpression.
bashi
2015/03/11 10:22:35
Thanks, I took "if (...) { failureExpression; } el
| |
90 do { \ | |
91 if (handle.IsEmpty() || !getValueFromMaybe(handle->methodCall, outVariab le)) { \ | |
92 do { \ | |
Jens Widell
2015/03/11 07:39:34
This inner do{}while() is OTOH strictly speaking r
bashi
2015/03/11 07:51:18
Oh, right. Done.
| |
93 failureExpression; \ | |
94 } while (false); \ | |
95 } \ | |
96 } while (false) | |
97 | |
80 } // namespace blink | 98 } // namespace blink |
81 | 99 |
82 #endif // V8BindingMacros_h | 100 #endif // V8BindingMacros_h |
OLD | NEW |