Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index c73f395cb6808672ffc19863112facb8c32c4752..23a647021d14e4724d881d422f6237c460206630 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -227,11 +227,6 @@ template <typename T, class P = FreeStoreAllocationPolicy> class List; |
// ----------------------------------------------------------------------------- |
// Declarations for use in both the preparser and the rest of V8. |
-enum ObjectStrength { |
- WEAK, |
- FIRM // strong object |
-}; |
- |
// The Strict Mode (ECMA-262 5th edition, 4.2.2). |
enum LanguageMode { |
@@ -291,8 +286,27 @@ inline LanguageMode construct_language_mode(bool strict_bit, bool strong_bit) { |
} |
-inline ObjectStrength strength(LanguageMode language_mode) { |
- return is_strong(language_mode) ? FIRM : WEAK; |
+enum class Strength : bool { |
+ WEAK, |
+ FIRM // strong behaviour |
+}; |
+ |
+ |
+inline bool is_strong(Strength strength) { return strength == Strength::FIRM; } |
+ |
+ |
+inline std::ostream& operator<<(std::ostream& os, const Strength& strength) { |
+ return os << (is_strong(strength) ? "firm" : "weak"); |
+} |
+ |
+ |
+inline Strength strength(LanguageMode language_mode) { |
+ return is_strong(language_mode) ? Strength::FIRM : Strength::WEAK; |
+} |
+ |
+ |
+inline size_t hash_value(Strength strength) { |
+ return static_cast<size_t>(strength); |
} |