Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index f85f286b38bf5dfbf0961dba271cc97fab98a6aa..63c1e73bea832f513ef2438773effbc5b4251927 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -361,7 +361,30 @@ template <typename T, class P = FreeStoreAllocationPolicy> class List; |
// ----------------------------------------------------------------------------- |
// Declarations for use in both the preparser and the rest of V8. |
+// The different language modes that V8 implements. ES5 defines two language |
+// modes: an unrestricted mode respectively a strict mode which are indicated by |
+// CLASSIC_MODE respectively STRICT_MODE in the enum. The harmony spec drafts |
+// for the next ES standard specify a new third mode which is called 'extended |
+// mode'. The extended mode is only available if the harmony flag is set. It is |
+// based on the 'strict mode' and adds new functionality to it. This means that |
+// most of the semantics of these two modes coincide. |
+// |
+// In the current draft the term 'base code' is used to refer to code that is |
+// neither in strict nor extended mode. However, the more distinguishing term |
+// 'classic mode' is used in V8 instead to avoid mix-ups. |
+ |
+enum LanguageMode { |
+ CLASSIC_MODE, |
+ STRICT_MODE, |
+ EXTENDED_MODE |
+}; |
+ |
+ |
// The Strict Mode (ECMA-262 5th edition, 4.2.2). |
+// |
+// This flag is used in the backend to represent the language mode. So far |
+// there is no semantic difference between the strict and the extended mode in |
+// the backend, so both modes are represented by the kStrictMode value. |
enum StrictModeFlag { |
kNonStrictMode, |
kStrictMode |