Bug 1041631, part 2 - Make ES6 Symbols Nightly-only for now. r=Waldo, a=sledru.
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 20 Aug 2014 12:37:37 -0500
changeset 216690 eee93220473c
parent 216689 337d96ca1194
child 216691 d2d97af8ecdd
push id3878
push userjorendorff@mozilla.com
push date2014-09-09 17:26 +0000
treeherdermozilla-beta@eee93220473c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo, sledru
bugs1041631
milestone33.0
Bug 1041631, part 2 - Make ES6 Symbols Nightly-only for now. r=Waldo, a=sledru.
js/src/jsapi-tests/testSymbol.cpp
js/src/jsprototypes.h
js/src/jsversion.h
--- a/js/src/jsapi-tests/testSymbol.cpp
+++ b/js/src/jsapi-tests/testSymbol.cpp
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jsapi-tests/tests.h"
 
+#ifdef JS_HAS_SYMBOLS
+
 BEGIN_TEST(testSymbol_New)
 {
     using namespace JS;
 
     RootedString desc(cx, nullptr);
     RootedSymbol sym1(cx);
     CHECK(sym1 = NewSymbol(cx, desc));
     CHECK_NULL(GetSymbolDescription(sym1));
@@ -75,8 +77,9 @@ BEGIN_TEST(testSymbol_GetWellKnownSymbol
     Rooted<Symbol*> sym2(cx);
     CHECK(sym2 = GetSymbolFor(cx, desc));
     CHECK(sym2 != sym1);
 
     return true;
 }
 END_TEST(testSymbol_GetWellKnownSymbol)
 
+#endif
--- a/js/src/jsprototypes.h
+++ b/js/src/jsprototypes.h
@@ -55,16 +55,22 @@
 #endif
 
 #ifdef ENABLE_SHARED_ARRAY_BUFFER
 #define IF_SAB(real,imaginary) real
 #else
 #define IF_SAB(real,imaginary) imaginary
 #endif
 
+#ifdef JS_HAS_SYMBOLS
+#define IF_SYMBOLS(real,imaginary) real
+#else
+#define IF_SYMBOLS(real,imaginary) imaginary
+#endif
+
 #define JS_FOR_PROTOTYPES(real,imaginary) \
     imaginary(Null,              0,     js_InitNullClass,          dummy) \
     real(Object,                 1,     js_InitViaClassSpec,       &JSObject::class_) \
     real(Function,               2,     js_InitViaClassSpec,       &JSFunction::class_) \
     real(Array,                  3,     js_InitViaClassSpec,       OCLASP(Array)) \
     real(Boolean,                4,     js_InitBooleanClass,       OCLASP(Boolean)) \
     real(JSON,                   5,     js_InitJSONClass,          CLASP(JSON)) \
     real(Date,                   6,     js_InitViaClassSpec,       OCLASP(Date)) \
@@ -92,17 +98,17 @@
     real(Float32Array,          28,     js_InitViaClassSpec,       TYPED_ARRAY_CLASP(Float32)) \
     real(Float64Array,          29,     js_InitViaClassSpec,       TYPED_ARRAY_CLASP(Float64)) \
     real(Uint8ClampedArray,     30,     js_InitViaClassSpec,       TYPED_ARRAY_CLASP(Uint8Clamped)) \
     real(Proxy,                 31,     js_InitProxyClass,         &ProxyObject::uncallableClass_) \
     real(WeakMap,               32,     js_InitWeakMapClass,       OCLASP(WeakMap)) \
     real(Map,                   33,     js_InitMapClass,           OCLASP(Map)) \
     real(Set,                   34,     js_InitSetClass,           OCLASP(Set)) \
     real(DataView,              35,     js_InitDataViewClass,      OCLASP(DataView)) \
-    real(Symbol,                36,     js_InitSymbolClass,        &js::SymbolObject::class_) \
+IF_SYMBOLS(real,imaginary)(Symbol,              36,     js_InitSymbolClass,        &js::SymbolObject::class_) \
 IF_SAB(real,imaginary)(SharedArrayBuffer,       37,     js_InitSharedArrayBufferClass, &js::SharedArrayBufferObject::protoClass) \
 IF_INTL(real,imaginary) (Intl,                  38,     js_InitIntlClass,          CLASP(Intl)) \
 IF_BDATA(real,imaginary)(TypedObject,           39,     js_InitTypedObjectModuleObject,   OCLASP(TypedObjectModule)) \
     imaginary(GeneratorFunction,     40,     js_InitIteratorClasses, dummy) \
 IF_BDATA(real,imaginary)(SIMD,                  41,     js_InitSIMDClass, OCLASP(SIMD)) \
 
 #define JS_FOR_EACH_PROTOTYPE(macro) JS_FOR_PROTOTYPES(macro,macro)
 
--- a/js/src/jsversion.h
+++ b/js/src/jsversion.h
@@ -39,9 +39,14 @@
 #define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)
 
 /*
  * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;
  * support likely to be made opt-in at some future time.
  */
 #define JS_OLD_GETTER_SETTER_METHODS    1
 
+/* Support for Symbols - Nightly-only for now. */
+#ifdef NIGHTLY_BUILD
+#define JS_HAS_SYMBOLS 1
+#endif
+
 #endif /* jsversion_h */