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

Unified Diff: src/smart-pointer.h

Issue 7519: Added first shot at a development shell (Closed)
Patch Set: Factored js code out of d8.cc. Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
« src/d8.js ('K') | « src/natives.h ('k') | tools/js2c.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/smart-pointer.h
diff --git a/src/smart-pointer.h b/src/smart-pointer.h
index 03fd229b43c50262f72d8656f50fbcc0b7312bd3..c39df16869582f9426cec5a4162046d57675b180 100644
--- a/src/smart-pointer.h
+++ b/src/smart-pointer.h
@@ -86,7 +86,7 @@ class SmartPointer {
// the copy constructor it removes the pointer in the original to avoid
// double freeing.
inline SmartPointer& operator=(const SmartPointer<T>& rhs) {
- ASSERT(p == NULL);
+ ASSERT(is_empty());
T* tmp = rhs.p; // swap to handle self-assignment
const_cast<SmartPointer<T>&>(rhs).p = NULL;
p = tmp;
@@ -94,6 +94,11 @@ class SmartPointer {
}
+ inline bool is_empty() {
+ return p == NULL;
+ }
+
+
private:
T* p;
};
« src/d8.js ('K') | « src/natives.h ('k') | tools/js2c.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698