зеркало из https://github.com/mozilla/gecko-dev.git
Removal of deprecated features including WrapHandler
This commit is contained in:
Родитель
3d7261604c
Коммит
4e4d678dc2
|
@ -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>
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Rhino code, released
|
||||
* May 6, 1999.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1997-2000 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Marshall Cline
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the NPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the NPL or the GPL.
|
||||
*/
|
||||
|
||||
// API class
|
||||
|
||||
package org.mozilla.javascript;
|
||||
|
||||
/**
|
||||
@deprecated As of Rhino 1.5 Release 4, use {@link WrapFactory}.
|
||||
Note that when extending {@link WrapFactory} you should call
|
||||
<code>super.wrap(...)</code> instead of returning null to get default behavior.
|
||||
You should also take into account that
|
||||
{@link WrapFactory#wrap(Context cx, Scriptable scope, Object obj, Class cls)}
|
||||
can be called when <code>obj == null</code>
|
||||
*/
|
||||
public interface WrapHandler {
|
||||
|
||||
public Object wrap(Scriptable scope, Object obj, Class staticType);
|
||||
|
||||
}
|
Загрузка…
Ссылка в новой задаче