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

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

Issue 23812006: Have Dictionary use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test Created 7 years, 3 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
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/bindings/v8/V8StringResource.h » ('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) 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 block.ReThrow(); \ 78 block.ReThrow(); \
79 return; \ 79 return; \
80 } \ 80 } \
81 } \ 81 } \
82 if (UNLIKELY(!ok)) { \ 82 if (UNLIKELY(!ok)) { \
83 throwTypeError(isolate); \ 83 throwTypeError(isolate); \
84 return; \ 84 return; \
85 } \ 85 } \
86 } 86 }
87 87
88 #define V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(type, var, value, retVal) \
89 type var(value); \
90 if (!var.prepare()) \
91 return retVal;
92
88 #define V8TRYCATCH_FOR_V8STRINGRESOURCE(type, var, value) \ 93 #define V8TRYCATCH_FOR_V8STRINGRESOURCE(type, var, value) \
89 type var(value); \ 94 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(type, var, value, v8::Undefined());
90 if (!var.prepare()) \
91 return v8::Undefined();
92 95
93 #define V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(type, var, value) \ 96 #define V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(type, var, value) \
94 type var(value); \ 97 type var(value); \
95 if (!var.prepare()) \ 98 if (!var.prepare()) \
96 return; 99 return;
97 100
98 } // namespace WebCore 101 } // namespace WebCore
99 102
100 #endif // V8BindingMacros_h 103 #endif // V8BindingMacros_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/bindings/v8/V8StringResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698