Bug 1440043 - Remove jsversion.h. r=jandem.
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 21 Feb 2018 13:54:53 -0600
changeset 457532 03a00bb49a69b334c06c567a3c2bc198686f229e
parent 457531 e657516be4498ff0fc3c88e4adee2aa84c3c5f27
child 457533 7089df4b037451cd7cfa6176a0011ec50048d91c
push id8799
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 16:46:23 +0000
treeherdermozilla-beta@15334014dc67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1440043
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1440043 - Remove jsversion.h. r=jandem.
js/src/builtin/JSON.cpp
js/src/builtin/Object.cpp
js/src/builtin/Object.h
js/src/builtin/RegExp.cpp
js/src/builtin/intl/Collator.cpp
js/src/builtin/intl/DateTimeFormat.cpp
js/src/builtin/intl/IntlObject.cpp
js/src/builtin/intl/NumberFormat.cpp
js/src/builtin/intl/PluralRules.cpp
js/src/builtin/intl/RelativeTimeFormat.cpp
js/src/jsapi.cpp
js/src/jsarray.cpp
js/src/jsbool.cpp
js/src/jsdate.cpp
js/src/jsexn.cpp
js/src/jsmath.cpp
js/src/jsnum.cpp
js/src/jsstr.cpp
js/src/jstypes.h
js/src/jsversion.h
js/src/moz.build
js/src/vm/JSFunction.cpp
js/src/wasm/WasmJS.cpp
--- a/js/src/builtin/JSON.cpp
+++ b/js/src/builtin/JSON.cpp
@@ -906,25 +906,23 @@ js::ParseJSONWithReviver(JSContext* cx, 
 template bool
 js::ParseJSONWithReviver(JSContext* cx, const mozilla::Range<const Latin1Char> chars,
                          HandleValue reviver, MutableHandleValue vp);
 
 template bool
 js::ParseJSONWithReviver(JSContext* cx, const mozilla::Range<const char16_t> chars, HandleValue reviver,
                          MutableHandleValue vp);
 
-#if JS_HAS_TOSOURCE
 static bool
 json_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().JSON);
     return true;
 }
-#endif
 
 /* ES5 15.12.2. */
 static bool
 json_parse(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /* Step 1. */
@@ -975,19 +973,17 @@ json_stringify(JSContext* cx, unsigned a
     } else {
         args.rval().setUndefined();
     }
 
     return true;
 }
 
 static const JSFunctionSpec json_static_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,  json_toSource,      0, 0),
-#endif
     JS_FN("parse",          json_parse,         2, 0),
     JS_FN("stringify",      json_stringify,     3, 0),
     JS_FS_END
 };
 
 JSObject*
 js::InitJSONClass(JSContext* cx, HandleObject obj)
 {
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -107,17 +107,16 @@ js::obj_propertyIsEnumerable(JSContext* 
     if (!GetOwnPropertyDescriptor(cx, obj, idRoot, &desc))
         return false;
 
     /* Steps 4-5. */
     args.rval().setBoolean(desc.object() && desc.enumerable());
     return true;
 }
 
-#if JS_HAS_TOSOURCE
 static bool
 obj_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     if (!CheckRecursionLimit(cx))
         return false;
 
@@ -426,17 +425,16 @@ js::ObjectToSource(JSContext* cx, Handle
 
     if (!buf.append('}'))
         return nullptr;
     if (outermost && !buf.append(')'))
         return nullptr;
 
     return buf.finishString();
 }
-#endif /* JS_HAS_TOSOURCE */
 
 static bool
 GetBuiltinTagSlow(JSContext* cx, HandleObject obj, MutableHandleString builtinTag)
 {
     // Step 4.
     bool isArray;
     if (!IsArray(cx, obj, &isArray))
         return false;
@@ -1946,38 +1944,32 @@ ProtoSetter(JSContext* cx, unsigned argc
     if (!SetPrototype(cx, obj, newProto))
         return false;
 
     args.rval().setUndefined();
     return true;
 }
 
 static const JSFunctionSpec object_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,             obj_toSource,                0,0),
-#endif
     JS_INLINABLE_FN(js_toString_str,   obj_toString,                0,0, ObjectToString),
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Object_toLocaleString", 0, 0),
     JS_SELF_HOSTED_FN(js_valueOf_str,  "Object_valueOf",            0,0),
     JS_SELF_HOSTED_FN(js_hasOwnProperty_str, "Object_hasOwnProperty", 1,0),
     JS_FN(js_isPrototypeOf_str,        obj_isPrototypeOf,           1,0),
     JS_FN(js_propertyIsEnumerable_str, obj_propertyIsEnumerable,    1,0),
-#if JS_OLD_GETTER_SETTER_METHODS
     JS_SELF_HOSTED_FN(js_defineGetter_str, "ObjectDefineGetter",    2,0),
     JS_SELF_HOSTED_FN(js_defineSetter_str, "ObjectDefineSetter",    2,0),
     JS_SELF_HOSTED_FN(js_lookupGetter_str, "ObjectLookupGetter",    1,0),
     JS_SELF_HOSTED_FN(js_lookupSetter_str, "ObjectLookupSetter",    1,0),
-#endif
     JS_FS_END
 };
 
 static const JSPropertySpec object_properties[] = {
-#if JS_HAS_OBJ_PROTO_PROP
     JS_PSGS("__proto__", ProtoGetter, ProtoSetter, 0),
-#endif
     JS_PS_END
 };
 
 static const JSFunctionSpec object_static_methods[] = {
     JS_FN("assign",                    obj_assign,                  2, 0),
     JS_SELF_HOSTED_FN("getPrototypeOf", "ObjectGetPrototypeOf",     1, 0),
     JS_FN("setPrototypeOf",            obj_setPrototypeOf,          2, 0),
     JS_SELF_HOSTED_FN("getOwnPropertyDescriptor", "ObjectGetOwnPropertyDescriptor", 2, 0),
--- a/js/src/builtin/Object.h
+++ b/js/src/builtin/Object.h
@@ -66,21 +66,19 @@ GetOwnPropertyDescriptorToArray(JSContex
 /*
  * Like IdToValue, but convert int jsids to strings. This is used when
  * exposing a jsid to script for Object.getOwnProperty{Names,Symbols}
  * or scriptable proxy traps.
  */
 MOZ_MUST_USE bool
 IdToStringOrSymbol(JSContext* cx, JS::HandleId id, JS::MutableHandleValue result);
 
-#if JS_HAS_TOSOURCE
 // Object.prototype.toSource. Function.prototype.toSource and uneval use this.
 JSString*
 ObjectToSource(JSContext* cx, JS::HandleObject obj);
-#endif // JS_HAS_TOSOURCE
 
 extern MOZ_MUST_USE bool
 WatchHandler(JSContext* cx, JSObject* obj, jsid id, const JS::Value& old,
              JS::Value* nvp, void* closure);
 
 } /* namespace js */
 
 #endif /* builtin_Object_h */
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -759,19 +759,17 @@ const JSPropertySpec js::regexp_properti
     JS_PSG("multiline", regexp_multiline, 0),
     JS_PSG("source", regexp_source, 0),
     JS_PSG("sticky", regexp_sticky, 0),
     JS_PSG("unicode", regexp_unicode, 0),
     JS_PS_END
 };
 
 const JSFunctionSpec js::regexp_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_SELF_HOSTED_FN(js_toSource_str, "RegExpToString", 0, 0),
-#endif
     JS_SELF_HOSTED_FN(js_toString_str, "RegExpToString", 0, 0),
     JS_FN("compile",        regexp_compile,     2,0),
     JS_SELF_HOSTED_FN("exec", "RegExp_prototype_Exec", 1,0),
     JS_SELF_HOSTED_FN("test", "RegExpTest" ,    1,0),
     JS_SELF_HOSTED_SYM_FN(match, "RegExpMatch", 1,0),
     JS_SELF_HOSTED_SYM_FN(replace, "RegExpReplace", 2,0),
     JS_SELF_HOSTED_SYM_FN(search, "RegExpSearch", 1,0),
     JS_SELF_HOSTED_SYM_FN(split, "RegExpSplit", 2,0),
--- a/js/src/builtin/intl/Collator.cpp
+++ b/js/src/builtin/intl/Collator.cpp
@@ -45,36 +45,32 @@ const ClassOps CollatorObject::classOps_
 
 const Class CollatorObject::class_ = {
     js_Object_str,
     JSCLASS_HAS_RESERVED_SLOTS(CollatorObject::SLOT_COUNT) |
     JSCLASS_FOREGROUND_FINALIZE,
     &CollatorObject::classOps_
 };
 
-#if JS_HAS_TOSOURCE
 static bool
 collator_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().Collator);
     return true;
 }
-#endif
 
 static const JSFunctionSpec collator_static_methods[] = {
     JS_SELF_HOSTED_FN("supportedLocalesOf", "Intl_Collator_supportedLocalesOf", 1, 0),
     JS_FS_END
 };
 
 static const JSFunctionSpec collator_methods[] = {
     JS_SELF_HOSTED_FN("resolvedOptions", "Intl_Collator_resolvedOptions", 0, 0),
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, collator_toSource, 0, 0),
-#endif
     JS_FS_END
 };
 
 static const JSPropertySpec collator_properties[] = {
     JS_SELF_HOSTED_GET("compare", "Intl_Collator_compare_get", 0),
     JS_STRING_SYM_PS(toStringTag, "Object", JSPROP_READONLY),
     JS_PS_END
 };
--- a/js/src/builtin/intl/DateTimeFormat.cpp
+++ b/js/src/builtin/intl/DateTimeFormat.cpp
@@ -51,37 +51,33 @@ const ClassOps DateTimeFormatObject::cla
 
 const Class DateTimeFormatObject::class_ = {
     js_Object_str,
     JSCLASS_HAS_RESERVED_SLOTS(DateTimeFormatObject::SLOT_COUNT) |
     JSCLASS_FOREGROUND_FINALIZE,
     &DateTimeFormatObject::classOps_
 };
 
-#if JS_HAS_TOSOURCE
 static bool
 dateTimeFormat_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().DateTimeFormat);
     return true;
 }
-#endif
 
 static const JSFunctionSpec dateTimeFormat_static_methods[] = {
     JS_SELF_HOSTED_FN("supportedLocalesOf", "Intl_DateTimeFormat_supportedLocalesOf", 1, 0),
     JS_FS_END
 };
 
 static const JSFunctionSpec dateTimeFormat_methods[] = {
     JS_SELF_HOSTED_FN("resolvedOptions", "Intl_DateTimeFormat_resolvedOptions", 0, 0),
     JS_SELF_HOSTED_FN("formatToParts", "Intl_DateTimeFormat_formatToParts", 1, 0),
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, dateTimeFormat_toSource, 0, 0),
-#endif
     JS_FS_END
 };
 
 static const JSPropertySpec dateTimeFormat_properties[] = {
     JS_SELF_HOSTED_GET("format", "Intl_DateTimeFormat_format_get", 0),
     JS_STRING_SYM_PS(toStringTag, "Object", JSPROP_READONLY),
     JS_PS_END
 };
--- a/js/src/builtin/intl/IntlObject.cpp
+++ b/js/src/builtin/intl/IntlObject.cpp
@@ -479,30 +479,26 @@ js::intl_GetLocaleInfo(JSContext* cx, un
     return true;
 }
 
 const Class js::IntlClass = {
     js_Object_str,
     JSCLASS_HAS_CACHED_PROTO(JSProto_Intl)
 };
 
-#if JS_HAS_TOSOURCE
 static bool
 intl_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().Intl);
     return true;
 }
-#endif
 
 static const JSFunctionSpec intl_static_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,  intl_toSource,        0, 0),
-#endif
     JS_SELF_HOSTED_FN("getCanonicalLocales", "Intl_getCanonicalLocales", 1, 0),
     JS_FS_END
 };
 
 /**
  * Initializes the Intl Object and its standard built-in properties.
  * Spec: ECMAScript Internationalization API Specification, 8.0, 8.1
  */
--- a/js/src/builtin/intl/NumberFormat.cpp
+++ b/js/src/builtin/intl/NumberFormat.cpp
@@ -52,37 +52,33 @@ const ClassOps NumberFormatObject::class
 
 const Class NumberFormatObject::class_ = {
     js_Object_str,
     JSCLASS_HAS_RESERVED_SLOTS(NumberFormatObject::SLOT_COUNT) |
     JSCLASS_FOREGROUND_FINALIZE,
     &NumberFormatObject::classOps_
 };
 
-#if JS_HAS_TOSOURCE
 static bool
 numberFormat_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().NumberFormat);
     return true;
 }
-#endif
 
 static const JSFunctionSpec numberFormat_static_methods[] = {
     JS_SELF_HOSTED_FN("supportedLocalesOf", "Intl_NumberFormat_supportedLocalesOf", 1, 0),
     JS_FS_END
 };
 
 static const JSFunctionSpec numberFormat_methods[] = {
     JS_SELF_HOSTED_FN("resolvedOptions", "Intl_NumberFormat_resolvedOptions", 0, 0),
     JS_SELF_HOSTED_FN("formatToParts", "Intl_NumberFormat_formatToParts", 1, 0),
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, numberFormat_toSource, 0, 0),
-#endif
     JS_FS_END
 };
 
 static const JSPropertySpec numberFormat_properties[] = {
     JS_SELF_HOSTED_GET("format", "Intl_NumberFormat_format_get", 0),
     JS_STRING_SYM_PS(toStringTag, "Object", JSPROP_READONLY),
     JS_PS_END
 };
--- a/js/src/builtin/intl/PluralRules.cpp
+++ b/js/src/builtin/intl/PluralRules.cpp
@@ -42,37 +42,33 @@ const ClassOps PluralRulesObject::classO
 
 const Class PluralRulesObject::class_ = {
     js_Object_str,
     JSCLASS_HAS_RESERVED_SLOTS(PluralRulesObject::SLOT_COUNT) |
     JSCLASS_FOREGROUND_FINALIZE,
     &PluralRulesObject::classOps_
 };
 
-#if JS_HAS_TOSOURCE
 static bool
 pluralRules_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().PluralRules);
     return true;
 }
-#endif
 
 static const JSFunctionSpec pluralRules_static_methods[] = {
     JS_SELF_HOSTED_FN("supportedLocalesOf", "Intl_PluralRules_supportedLocalesOf", 1, 0),
     JS_FS_END
 };
 
 static const JSFunctionSpec pluralRules_methods[] = {
     JS_SELF_HOSTED_FN("resolvedOptions", "Intl_PluralRules_resolvedOptions", 0, 0),
     JS_SELF_HOSTED_FN("select", "Intl_PluralRules_select", 1, 0),
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, pluralRules_toSource, 0, 0),
-#endif
     JS_FS_END
 };
 
 /**
  * PluralRules constructor.
  * Spec: ECMAScript 402 API, PluralRules, 13.2.1
  */
 static bool
--- a/js/src/builtin/intl/RelativeTimeFormat.cpp
+++ b/js/src/builtin/intl/RelativeTimeFormat.cpp
@@ -42,37 +42,33 @@ const ClassOps RelativeTimeFormatObject:
 
 const Class RelativeTimeFormatObject::class_ = {
     js_Object_str,
     JSCLASS_HAS_RESERVED_SLOTS(RelativeTimeFormatObject::SLOT_COUNT) |
     JSCLASS_FOREGROUND_FINALIZE,
     &RelativeTimeFormatObject::classOps_
 };
 
-#if JS_HAS_TOSOURCE
 static bool
 relativeTimeFormat_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().RelativeTimeFormat);
     return true;
 }
-#endif
 
 static const JSFunctionSpec relativeTimeFormat_static_methods[] = {
     JS_SELF_HOSTED_FN("supportedLocalesOf", "Intl_RelativeTimeFormat_supportedLocalesOf", 1, 0),
     JS_FS_END
 };
 
 static const JSFunctionSpec relativeTimeFormat_methods[] = {
     JS_SELF_HOSTED_FN("resolvedOptions", "Intl_RelativeTimeFormat_resolvedOptions", 0, 0),
     JS_SELF_HOSTED_FN("format", "Intl_RelativeTimeFormat_format", 2, 0),
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, relativeTimeFormat_toSource, 0, 0),
-#endif
     JS_FS_END
 };
 
 /**
  * RelativeTimeFormat constructor.
  * Spec: ECMAScript 402 API, RelativeTimeFormat, 1.1
  */
 static bool
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1052,19 +1052,17 @@ static const JSStdName builtin_property_
 
     /* String global functions. */
     { EAGER_ATOM(escape), JSProto_String },
     { EAGER_ATOM(unescape), JSProto_String },
     { EAGER_ATOM(decodeURI), JSProto_String },
     { EAGER_ATOM(encodeURI), JSProto_String },
     { EAGER_ATOM(decodeURIComponent), JSProto_String },
     { EAGER_ATOM(encodeURIComponent), JSProto_String },
-#if JS_HAS_UNEVAL
     { EAGER_ATOM(uneval), JSProto_String },
-#endif
 
     { 0, JSProto_LIMIT }
 };
 
 #undef EAGER_ATOM
 
 JS_PUBLIC_API(bool)
 JS_ResolveStandardClass(JSContext* cx, HandleObject obj, HandleId id, bool* resolved)
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -1120,18 +1120,16 @@ ArraySpeciesCreate(JSContext* cx, Handle
         return false;
     }
 
     MOZ_ASSERT(rval.isObject());
     arr.set(&rval.toObject());
     return true;
 }
 
-#if JS_HAS_TOSOURCE
-
 static bool
 array_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     if (!CheckRecursionLimit(cx))
         return false;
 
     CallArgs args = CallArgsFromVp(argc, vp);
 
@@ -1199,18 +1197,16 @@ array_toSource(JSContext* cx, unsigned a
     JSString* str = sb.finishString();
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
 }
 
-#endif
-
 struct EmptySeparatorOp
 {
     bool operator()(JSContext*, StringBuffer& sb) { return true; }
 };
 
 template <typename CharT>
 struct CharSeparatorOp
 {
@@ -3495,19 +3491,17 @@ const JSJitInfo js::array_splice_info = 
   { 0 }, /* unused */
   { 0 }, /* unused */
   JSJitInfo::IgnoresReturnValueNative,
   JSJitInfo::AliasEverything,
   JSVAL_TYPE_UNDEFINED,
 };
 
 static const JSFunctionSpec array_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,      array_toSource,     0,0),
-#endif
     JS_SELF_HOSTED_FN(js_toString_str, "ArrayToString",      0,0),
     JS_FN(js_toLocaleString_str,       array_toLocaleString, 0,0),
 
     /* Perl-ish methods. */
     JS_INLINABLE_FN("join",     array_join,         1,0, ArrayJoin),
     JS_FN("reverse",            array_reverse,      0,0),
     JS_SELF_HOSTED_FN("sort",   "ArraySort",        1,0),
     JS_INLINABLE_FN("push",     array_push,         1,0, ArrayPush),
--- a/js/src/jsbool.cpp
+++ b/js/src/jsbool.cpp
@@ -31,17 +31,16 @@ const Class BooleanObject::class_ = {
 };
 
 MOZ_ALWAYS_INLINE bool
 IsBoolean(HandleValue v)
 {
     return v.isBoolean() || (v.isObject() && v.toObject().is<BooleanObject>());
 }
 
-#if JS_HAS_TOSOURCE
 MOZ_ALWAYS_INLINE bool
 bool_toSource_impl(JSContext* cx, const CallArgs& args)
 {
     HandleValue thisv = args.thisv();
     MOZ_ASSERT(IsBoolean(thisv));
 
     bool b = thisv.isBoolean() ? thisv.toBoolean() : thisv.toObject().as<BooleanObject>().unbox();
 
@@ -57,17 +56,16 @@ bool_toSource_impl(JSContext* cx, const 
 }
 
 static bool
 bool_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsBoolean, bool_toSource_impl>(cx, args);
 }
-#endif
 
 MOZ_ALWAYS_INLINE bool
 bool_toString_impl(JSContext* cx, const CallArgs& args)
 {
     HandleValue thisv = args.thisv();
     MOZ_ASSERT(IsBoolean(thisv));
 
     bool b = thisv.isBoolean() ? thisv.toBoolean() : thisv.toObject().as<BooleanObject>().unbox();
@@ -96,19 +94,17 @@ bool_valueOf_impl(JSContext* cx, const C
 static bool
 bool_valueOf(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsBoolean, bool_valueOf_impl>(cx, args);
 }
 
 static const JSFunctionSpec boolean_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,  bool_toSource,  0, 0),
-#endif
     JS_FN(js_toString_str,  bool_toString,  0, 0),
     JS_FN(js_valueOf_str,   bool_valueOf,   0, 0),
     JS_FS_END
 };
 
 static bool
 Boolean(JSContext* cx, unsigned argc, Value* vp)
 {
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -2901,17 +2901,16 @@ date_toDateString_impl(JSContext* cx, co
 
 static bool
 date_toDateString(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_toDateString_impl>(cx, args);
 }
 
-#if JS_HAS_TOSOURCE
 MOZ_ALWAYS_INLINE bool
 date_toSource_impl(JSContext* cx, const CallArgs& args)
 {
     StringBuffer sb(cx);
     if (!sb.append("(new Date(") ||
         !NumberValueToStringBuffer(cx, args.thisv().toObject().as<DateObject>().UTCTime(), sb) ||
         !sb.append("))"))
     {
@@ -2926,17 +2925,16 @@ date_toSource_impl(JSContext* cx, const 
 }
 
 static bool
 date_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsDate, date_toSource_impl>(cx, args);
 }
-#endif
 
 // ES6 20.3.4.41.
 MOZ_ALWAYS_INLINE bool
 date_toString_impl(JSContext* cx, const CallArgs& args)
 {
     // Steps 1-2.
     return FormatDate(cx, args.thisv().toObject().as<DateObject>().UTCTime().toNumber(),
                       FormatSpec::DateTime, args.rval());
@@ -3040,19 +3038,17 @@ static const JSFunctionSpec date_methods
     JS_FN(js_toLocaleString_str, date_toLocaleString,     0,0),
     JS_FN("toLocaleDateString",  date_toLocaleDateString, 0,0),
     JS_FN("toLocaleTimeString",  date_toLocaleTimeString, 0,0),
 #endif
     JS_FN("toDateString",        date_toDateString,       0,0),
     JS_FN("toTimeString",        date_toTimeString,       0,0),
     JS_FN("toISOString",         date_toISOString,        0,0),
     JS_FN(js_toJSON_str,         date_toJSON,             1,0),
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,       date_toSource,           0,0),
-#endif
     JS_FN(js_toString_str,       date_toString,           0,0),
     JS_FN(js_valueOf_str,        date_valueOf,            0,0),
     JS_SYM_FN(toPrimitive,       date_toPrimitive,        1,JSPROP_READONLY),
     JS_FS_END
 };
 
 static bool
 NewDateObject(JSContext* cx, const CallArgs& args, ClippedTime t)
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -69,19 +69,17 @@ ErrorObject::protoClasses[JSEXN_ERROR_LI
 
     IMPLEMENT_ERROR_PROTO_CLASS(DebuggeeWouldRun),
     IMPLEMENT_ERROR_PROTO_CLASS(CompileError),
     IMPLEMENT_ERROR_PROTO_CLASS(LinkError),
     IMPLEMENT_ERROR_PROTO_CLASS(RuntimeError)
 };
 
 static const JSFunctionSpec error_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, exn_toSource, 0, 0),
-#endif
     JS_SELF_HOSTED_FN(js_toString_str, "ErrorToString", 0,0),
     JS_FS_END
 };
 
 static const JSPropertySpec error_properties[] = {
     JS_STRING_PS("message", "", 0),
     JS_STRING_PS("name", "Error", 0),
     // Only Error.prototype has .stack!
@@ -492,17 +490,16 @@ Error(JSContext* cx, unsigned argc, Valu
                                              lineNumber, columnNumber, nullptr, message, proto));
     if (!obj)
         return false;
 
     args.rval().setObject(*obj);
     return true;
 }
 
-#if JS_HAS_TOSOURCE
 /*
  * Return a string that may eval to something similar to the original object.
  */
 static bool
 exn_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     if (!CheckRecursionLimit(cx))
         return false;
@@ -571,17 +568,16 @@ exn_toSource(JSContext* cx, unsigned arg
         return false;
 
     JSString* str = sb.finishString();
     if (!str)
         return false;
     args.rval().setString(str);
     return true;
 }
-#endif
 
 /* static */ JSObject*
 ErrorObject::createProto(JSContext* cx, JSProtoKey key)
 {
     JSExnType type = ExnTypeFromProtoKey(key);
 
     if (type == JSEXN_ERR) {
         return GlobalObject::createBlankPrototype(cx, cx->global(),
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -1429,30 +1429,26 @@ js::math_cbrt_uncached(double x)
 }
 
 bool
 js::math_cbrt(JSContext* cx, unsigned argc, Value* vp)
 {
     return math_function<math_cbrt_impl>(cx, argc, vp);
 }
 
-#if JS_HAS_TOSOURCE
 static bool
 math_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().Math);
     return true;
 }
-#endif
 
 static const JSFunctionSpec math_static_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,  math_toSource,        0, 0),
-#endif
     JS_INLINABLE_FN("abs",    math_abs,             1, 0, MathAbs),
     JS_INLINABLE_FN("acos",   math_acos,            1, 0, MathACos),
     JS_INLINABLE_FN("asin",   math_asin,            1, 0, MathASin),
     JS_INLINABLE_FN("atan",   math_atan,            1, 0, MathATan),
     JS_INLINABLE_FN("atan2",  math_atan2,           2, 0, MathATan2),
     JS_INLINABLE_FN("ceil",   math_ceil,            1, 0, MathCeil),
     JS_INLINABLE_FN("clz32",  math_clz32,           1, 0, MathClz32),
     JS_INLINABLE_FN("cos",    math_cos,             1, 0, MathCos),
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -522,17 +522,16 @@ IsNumber(HandleValue v)
 static inline double
 Extract(const Value& v)
 {
     if (v.isNumber())
         return v.toNumber();
     return v.toObject().as<NumberObject>().unbox();
 }
 
-#if JS_HAS_TOSOURCE
 MOZ_ALWAYS_INLINE bool
 num_toSource_impl(JSContext* cx, const CallArgs& args)
 {
     double d = Extract(args.thisv());
 
     StringBuffer sb(cx);
     if (!sb.append("(new Number(") ||
         !NumberValueToStringBuffer(cx, NumberValue(d), sb) ||
@@ -549,17 +548,16 @@ num_toSource_impl(JSContext* cx, const C
 }
 
 static bool
 num_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsNumber, num_toSource_impl>(cx, args);
 }
-#endif
 
 ToCStringBuf::ToCStringBuf() : dbuf(nullptr)
 {
     static_assert(sbufSize >= DTOSTR_STANDARD_BUFFER_SIZE,
                   "builtin space must be large enough to store even the "
                   "longest string produced by a conversion");
 }
 
@@ -1089,19 +1087,17 @@ num_toPrecision_impl(JSContext* cx, cons
 static bool
 num_toPrecision(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsNumber, num_toPrecision_impl>(cx, args);
 }
 
 static const JSFunctionSpec number_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,       num_toSource,          0, 0),
-#endif
     JS_FN(js_toString_str,       num_toString,          1, 0),
 #if EXPOSE_INTL_API
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Number_toLocaleString", 0,0),
 #else
     JS_FN(js_toLocaleString_str, num_toLocaleString,     0,0),
 #endif
     JS_FN(js_valueOf_str,        num_valueOf,           0, 0),
     JS_FN("toFixed",             num_toFixed,           1, 0),
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -479,36 +479,32 @@ str_unescape(JSContext* cx, unsigned arg
     } else {
         result = str;
     }
 
     args.rval().setString(result);
     return true;
 }
 
-#if JS_HAS_UNEVAL
 static bool
 str_uneval(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     JSString* str = ValueToSource(cx, args.get(0));
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
 }
-#endif
 
 static const JSFunctionSpec string_functions[] = {
     JS_FN(js_escape_str,             str_escape,                1, JSPROP_RESOLVING),
     JS_FN(js_unescape_str,           str_unescape,              1, JSPROP_RESOLVING),
-#if JS_HAS_UNEVAL
     JS_FN(js_uneval_str,             str_uneval,                1, JSPROP_RESOLVING),
-#endif
     JS_FN(js_decodeURI_str,          str_decodeURI,             1, JSPROP_RESOLVING),
     JS_FN(js_encodeURI_str,          str_encodeURI,             1, JSPROP_RESOLVING),
     JS_FN(js_decodeURIComponent_str, str_decodeURI_Component,   1, JSPROP_RESOLVING),
     JS_FN(js_encodeURIComponent_str, str_encodeURI_Component,   1, JSPROP_RESOLVING),
 
     JS_FS_END
 };
 
@@ -615,18 +611,16 @@ ToStringForStringFunction(JSContext* cx,
 }
 
 MOZ_ALWAYS_INLINE bool
 IsString(HandleValue v)
 {
     return v.isString() || (v.isObject() && v.toObject().is<StringObject>());
 }
 
-#if JS_HAS_TOSOURCE
-
 MOZ_ALWAYS_INLINE bool
 str_toSource_impl(JSContext* cx, const CallArgs& args)
 {
     MOZ_ASSERT(IsString(args.thisv()));
 
     Rooted<JSString*> str(cx, ToString<CanGC>(cx, args.thisv()));
     if (!str)
         return false;
@@ -648,18 +642,16 @@ str_toSource_impl(JSContext* cx, const C
 
 static bool
 str_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsString, str_toSource_impl>(cx, args);
 }
 
-#endif /* JS_HAS_TOSOURCE */
-
 MOZ_ALWAYS_INLINE bool
 str_toString_impl(JSContext* cx, const CallArgs& args)
 {
     MOZ_ASSERT(IsString(args.thisv()));
 
     args.rval().setString(args.thisv().isString()
                               ? args.thisv().toString()
                               : args.thisv().toObject().as<StringObject>().unbox());
@@ -3292,19 +3284,17 @@ js::str_concat(JSContext* cx, unsigned a
         }
     }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,     str_toSource,          0,0),
-#endif
 
     /* Java-like methods. */
     JS_FN(js_toString_str,     str_toString,          0,0),
     JS_FN(js_valueOf_str,      str_toString,          0,0),
     JS_INLINABLE_FN("toLowerCase", str_toLowerCase,   0,0, StringToLowerCase),
     JS_INLINABLE_FN("toUpperCase", str_toUpperCase,   0,0, StringToUpperCase),
     JS_INLINABLE_FN("charAt",  str_charAt,            1,0, StringCharAt),
     JS_INLINABLE_FN("charCodeAt", str_charCodeAt,     1,0, StringCharCodeAt),
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -21,23 +21,21 @@
 #ifndef jstypes_h
 #define jstypes_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Casting.h"
 #include "mozilla/Types.h"
 
 // jstypes.h is (or should be!) included by every file in SpiderMonkey.
-// js-config.h and jsversion.h also should be included by every file.
-// So include them here.
-// XXX: including them in js/RequiredDefines.h should be a better option, since
+// js-config.h also should be included by every file. So include it here.
+// XXX: including it in js/RequiredDefines.h should be a better option, since
 // that is by definition the header file that should be included in all
 // SpiderMonkey code.  However, Gecko doesn't do this!  See bug 909576.
 #include "js-config.h"
-#include "jsversion.h"
 
 /***********************************************************************
 ** MACROS:      JS_EXTERN_API
 **              JS_EXPORT_API
 ** DESCRIPTION:
 **      These are only for externally visible routines and globals.  For
 **      internal routines, just use "extern" for type checking and that
 **      will not export internal cross-file or forward-declared symbols.
deleted file mode 100644
--- a/js/src/jsversion.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * 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/. */
-
-#ifndef jsversion_h
-#define jsversion_h
-
-/*
- * JS Capability Macros.
- */
-#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
-#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
-#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
-
-/*
- * 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
-
-#endif /* jsversion_h */
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -89,17 +89,16 @@ EXPORTS += [
     'jsalloc.h',
     'jsapi.h',
     'jsbytecode.h',
     'jsfriendapi.h',
     'jsprf.h',
     'jsprototypes.h',
     'jspubtd.h',
     'jstypes.h',
-    'jsversion.h',
     'jswrapper.h',
     'perf/jsperf.h',
 ]
 
 EXPORTS.js += [
     '../public/CallArgs.h',
     '../public/CallNonGenericMethod.h',
     '../public/CharacterEncoding.h',
--- a/js/src/vm/JSFunction.cpp
+++ b/js/src/vm/JSFunction.cpp
@@ -1116,17 +1116,16 @@ js::fun_toString(JSContext* cx, unsigned
     JSString* str = fun_toStringHelper(cx, obj, /* isToSource = */ false);
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
 }
 
-#if JS_HAS_TOSOURCE
 static bool
 fun_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(IsFunctionObject(args.calleev()));
 
     RootedObject obj(cx, ToObject(cx, args.thisv()));
     if (!obj)
@@ -1138,17 +1137,16 @@ fun_toSource(JSContext* cx, unsigned arg
     else
         str = ObjectToSource(cx, obj);
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
 }
-#endif
 
 bool
 js::fun_call(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     HandleValue func = args.thisv();
 
@@ -1645,19 +1643,17 @@ JSFunction::maybeRelazify(JSRuntime* rt)
         MOZ_ASSERT(isExtended());
         MOZ_ASSERT(getExtendedSlot(LAZY_FUNCTION_NAME_SLOT).toString()->isAtom());
     }
 
     comp->scheduleDelazificationForDebugger();
 }
 
 const JSFunctionSpec js::function_methods[] = {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,   fun_toSource,   0,0),
-#endif
     JS_FN(js_toString_str,   fun_toString,   0,0),
     JS_FN(js_apply_str,      fun_apply,      2,0),
     JS_FN(js_call_str,       fun_call,       1,0),
     JS_SELF_HOSTED_FN("bind", "FunctionBind", 2, 0),
     JS_SYM_FN(hasInstance, fun_symbolHasInstance, 1, JSPROP_READONLY | JSPROP_PERMANENT),
     JS_FS_END
 };
 
--- a/js/src/wasm/WasmJS.cpp
+++ b/js/src/wasm/WasmJS.cpp
@@ -2116,25 +2116,23 @@ WasmGlobalObject::value() const
     return getReservedSlot(VALUE_SLOT);
 }
 
 #endif // ENABLE_WASM_GLOBAL
 
 // ============================================================================
 // WebAssembly class and static methods
 
-#if JS_HAS_TOSOURCE
 static bool
 WebAssembly_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().WebAssembly);
     return true;
 }
-#endif
 
 static bool
 RejectWithPendingException(JSContext* cx, Handle<PromiseObject*> promise)
 {
     if (!cx->isExceptionPending())
         return false;
 
     RootedValue rejectionValue(cx);
@@ -2859,19 +2857,17 @@ WebAssembly_instantiateStreaming(JSConte
         return RejectWithPendingException(cx, promise, callArgs);
 
     callArgs.rval().setObject(*promise);
     return true;
 }
 
 static const JSFunctionSpec WebAssembly_static_methods[] =
 {
-#if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str, WebAssembly_toSource, 0, 0),
-#endif
     JS_FN("compile", WebAssembly_compile, 1, 0),
     JS_FN("instantiate", WebAssembly_instantiate, 1, 0),
     JS_FN("validate", WebAssembly_validate, 1, 0),
     JS_FN("compileStreaming", WebAssembly_compileStreaming, 1, 0),
     JS_FN("instantiateStreaming", WebAssembly_instantiateStreaming, 1, 0),
     JS_FS_END
 };