зеркало из https://github.com/mozilla/pjs.git
Removal of deprecated features including WrapHandler
This commit is contained in:
Родитель
c2ea7ec445
Коммит
ed3d0aff1f
|
@ -613,16 +613,6 @@ public class Context
|
|||
ContextFactory.getGlobal().addListener(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see ContextFactory#seal()
|
||||
* @see ContextFactory#getGlobal()
|
||||
*/
|
||||
public static void disableStaticContextListening()
|
||||
{
|
||||
ContextFactory.getGlobal().disableContextListening();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current Context.
|
||||
*
|
||||
|
@ -1414,16 +1404,6 @@ public class Context
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see #decompileScript(Script script, int indent)
|
||||
*/
|
||||
public final String decompileScript(Script script, Scriptable scope,
|
||||
int indent)
|
||||
{
|
||||
return decompileScript(script, indent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompile the script.
|
||||
* <p>
|
||||
|
@ -2021,78 +2001,6 @@ public class Context
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Proxy to allow to use deprecated WrapHandler in place
|
||||
* of WrapFactory.
|
||||
*/
|
||||
private static class WrapHandlerProxy extends WrapFactory
|
||||
{
|
||||
WrapHandler _handler;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
WrapHandlerProxy(WrapHandler handler)
|
||||
{
|
||||
_handler = handler;
|
||||
}
|
||||
|
||||
public Object wrap(Context cx, Scriptable scope,
|
||||
Object obj, Class staticType)
|
||||
{
|
||||
if (obj == null) { return obj; }
|
||||
Object result = _handler.wrap(scope, obj, staticType);
|
||||
if (result == null) {
|
||||
result = super.wrap(cx, scope, obj, staticType);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Scriptable wrapNewObject(Context cx, Scriptable scope,
|
||||
Object obj)
|
||||
{
|
||||
Object wrap = _handler.wrap(scope, obj, obj.getClass());
|
||||
if (wrap instanceof Scriptable) {
|
||||
return (Scriptable)wrap;
|
||||
}
|
||||
if (wrap == null) {
|
||||
return super.wrapNewObject(cx, scope, obj);
|
||||
}
|
||||
throw new RuntimeException
|
||||
("Please upgrade from WrapHandler to WrapFactory");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see #setWrapFactory(WrapFactory)
|
||||
* @see WrapFactory
|
||||
*/
|
||||
public final void setWrapHandler(WrapHandler wrapHandler)
|
||||
{
|
||||
if (sealed) onSealedMutation();
|
||||
if (wrapHandler == null) {
|
||||
setWrapFactory(new WrapFactory());
|
||||
} else {
|
||||
setWrapFactory(new WrapHandlerProxy(wrapHandler));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see #getWrapFactory()
|
||||
* @see WrapFactory
|
||||
*/
|
||||
public final WrapHandler getWrapHandler()
|
||||
{
|
||||
WrapFactory f = getWrapFactory();
|
||||
if (f instanceof WrapHandlerProxy) {
|
||||
return ((WrapHandlerProxy)f)._handler;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a WrapFactory for this Context.
|
||||
* <p>
|
||||
|
|
Загрузка…
Ссылка в новой задаче