Chromium Code Reviews| Index: include/v8-util.h |
| diff --git a/include/v8-util.h b/include/v8-util.h |
| index 60feff549d99da5c1c2b76a40a25a40580e0d857..3b4dd486b597b6eb18f60e83e237a755114efa22 100644 |
| --- a/include/v8-util.h |
| +++ b/include/v8-util.h |
| @@ -283,6 +283,10 @@ class PersistentValueMap { |
| */ |
| UniquePersistent<V> SetUnique(const K& key, UniquePersistent<V>* persistent) { |
| if (Traits::kCallbackType != kNotWeak) { |
| + // If the persistent is empty, the weak callback will actually never |
| + // happen since there's no object to be garbage collected. |
| + RELEASE_ASSERT(!persistent->IsEmpty()); |
|
jochen (gone - plz use gerrit)
2014/05/05 17:42:46
the v8 equivalent to RELEASE_ASSERT() is CHECK(),
|
| + |
| Local<V> value(Local<V>::New(isolate_, *persistent)); |
| persistent->template SetWeak<typename Traits::WeakCallbackDataType>( |
| Traits::WeakCallbackParameter(this, key, value), WeakCallback); |