Bug 880917 - Remove js_RevertVersion and associated shell functionality. r=luke
authorBobby Holley <bobbyholley@gmail.com>
Fri, 19 Jul 2013 18:21:48 -0700
changeset 147964 851c4a78bf5f38314b0c2bd76f2e31cf9097fc55
parent 147963 3d16cbe9d4a83b349c914d939921fd39b4d81d0e
child 147965 1cffd9c675b7700d4f569b2e16e602c3d60afae0
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs880917
milestone24.0a2
Bug 880917 - Remove js_RevertVersion and associated shell functionality. r=luke
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/shell/js.cpp
js/src/tests/js1_8/regress/regress-384412.js
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -823,22 +823,16 @@ JS_SetDebugErrorHook(JSRuntime *rt, JSDe
 {
     rt->debugHooks.debugErrorHook = hook;
     rt->debugHooks.debugErrorHookData = closure;
     return JS_TRUE;
 }
 
 /************************************************************************/
 
-JS_FRIEND_API(void)
-js_RevertVersion(JSContext *cx)
-{
-    cx->clearVersionOverride();
-}
-
 JS_PUBLIC_API(const JSDebugHooks *)
 JS_GetGlobalDebugHooks(JSRuntime *rt)
 {
     return &rt->debugHooks;
 }
 
 /************************************************************************/
 
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -421,19 +421,16 @@ JS_SetCallHook(JSRuntime *rt, JSInterpre
 extern JS_PUBLIC_API(JSBool)
 JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);
 
 extern JS_PUBLIC_API(JSBool)
 JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);
 
 /************************************************************************/
 
-extern JS_FRIEND_API(void)
-js_RevertVersion(JSContext *cx);
-
 extern JS_PUBLIC_API(const JSDebugHooks *)
 JS_GetGlobalDebugHooks(JSRuntime *rt);
 
 /**
  * Add various profiling-related functions as properties of the given object.
  */
 extern JS_PUBLIC_API(JSBool)
 JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -644,25 +644,16 @@ Version(JSContext *cx, unsigned argc, js
             return false;
         }
         JS_SetVersionForCompartment(js::GetContextCompartment(cx), JSVersion(v));
         args.rval().setInt32(origVersion);
     }
     return true;
 }
 
-static JSBool
-RevertVersion(JSContext *cx, unsigned argc, jsval *vp)
-{
-    CallArgs args = CallArgsFromVp(argc, vp);
-    js_RevertVersion(cx);
-    args.rval().setUndefined();
-    return true;
-}
-
 static JSScript *
 GetTopScript(JSContext *cx)
 {
     RootedScript script(cx);
     JS_DescribeScriptedCaller(cx, script.address(), NULL);
     return script;
 }
 
@@ -3570,20 +3561,16 @@ GetSelfHostedValue(JSContext *cx, unsign
     return cx->runtime()->cloneSelfHostedValue(cx, srcName, args.rval());
 }
 
 static const JSFunctionSpecWithHelp shell_functions[] = {
     JS_FN_HELP("version", Version, 0, 0,
 "version([number])",
 "  Get or force a script compilation version number."),
 
-    JS_FN_HELP("revertVersion", RevertVersion, 0, 0,
-"revertVersion()",
-"  Revert previously set version number."),
-
     JS_FN_HELP("options", Options, 0, 0,
 "options([option ...])",
 "  Get or toggle JavaScript options."),
 
     JS_FN_HELP("load", Load, 1, 0,
 "load(['foo.js' ...])",
 "  Load files named by string arguments. Filename is relative to the\n"
 "      current working directory."),
--- a/js/src/tests/js1_8/regress/regress-384412.js
+++ b/js/src/tests/js1_8/regress/regress-384412.js
@@ -132,29 +132,16 @@ function test()
        * the iterator gets run on a string with an empty length property.
        */
       for (let i = 0; i != 0 + this.length; i++)
         yield this[i];
     });
   expect(["a1", "a2", "a3", "b1", "b2", "b3", "c1", "c2", "c3"] + "",
          ([a + b for (a in 'abc') for (b in '123')]) + "");
 
-/*
- * Version switching
- */
-  if (typeof version == 'function')
-  {
-    var v = version(150);
-    f = new Function("return version(arguments[0])");
-    revertVersion();
-    expect(150, f());
-    expect(150, eval("f()"));
-    expect(0, eval("f(0); f()"));
-    revertVersion();
-  }
   print("End of Tests");
 
 /*
  * Utility functions
  */
   function expect(a, b) {
     print('expect: ' + a + ', actual: ' + b);
     reportCompare(a, b, summary);