OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 /** | 369 /** |
370 * This check fails when trying to convert between incompatible | 370 * This check fails when trying to convert between incompatible |
371 * handles. For example, converting from a Handle<String> to a | 371 * handles. For example, converting from a Handle<String> to a |
372 * Handle<Number>. | 372 * Handle<Number>. |
373 */ | 373 */ |
374 TYPE_CHECK(T, S); | 374 TYPE_CHECK(T, S); |
375 } | 375 } |
376 | 376 |
377 template <class S> V8_INLINE(Persistent(S* that)) : Handle<T>(that) { } | 377 template <class S> V8_INLINE(Persistent(S* that)) : Handle<T>(that) { } |
378 | 378 |
379 template <class S> V8_INLINE(Persistent(Isolate* isolate, Handle<S> that)) | |
380 : Handle<T>(New(isolate, that)) { } | |
dcarney
2013/04/24 13:46:02
Should be a comment here. This is required for ha
| |
381 | |
379 /** | 382 /** |
380 * "Casts" a plain handle which is known to be a persistent handle | 383 * "Casts" a plain handle which is known to be a persistent handle |
381 * to a persistent handle. | 384 * to a persistent handle. |
382 */ | 385 */ |
383 template <class S> explicit V8_INLINE(Persistent(Handle<S> that)) | 386 template <class S> explicit V8_INLINE(Persistent(Handle<S> that)) |
384 : Handle<T>(*that) { } | 387 : Handle<T>(*that) { } |
385 | 388 |
386 template <class S> V8_INLINE(static Persistent<T> Cast(Persistent<S> that)) { | 389 template <class S> V8_INLINE(static Persistent<T> Cast(Persistent<S> that)) { |
387 #ifdef V8_ENABLE_CHECKS | 390 #ifdef V8_ENABLE_CHECKS |
388 // If we're going to perform the type check then we have to check | 391 // If we're going to perform the type check then we have to check |
(...skipping 4832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5221 | 5224 |
5222 | 5225 |
5223 } // namespace v8 | 5226 } // namespace v8 |
5224 | 5227 |
5225 | 5228 |
5226 #undef V8EXPORT | 5229 #undef V8EXPORT |
5227 #undef TYPE_CHECK | 5230 #undef TYPE_CHECK |
5228 | 5231 |
5229 | 5232 |
5230 #endif // V8_H_ | 5233 #endif // V8_H_ |
OLD | NEW |