removed unecessary files
OBS-URL: https://build.opensuse.org/package/show/Java:packages/rhino?expand=0&rev=13
This commit is contained in:
parent
96fdbfba50
commit
8f8ad35b61
@ -1,101 +0,0 @@
|
||||
Index: toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java
|
||||
===================================================================
|
||||
--- toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java.orig 2009-11-16 15:55:50.086562039 +0100
|
||||
+++ toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java 2009-11-16 15:56:47.018560292 +0100
|
||||
@@ -40,12 +40,17 @@
|
||||
package org.mozilla.javascript.tools.shell;
|
||||
|
||||
import java.io.InputStream;
|
||||
+import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
+import jline.ConsoleReader;
|
||||
+import jline.Completor;
|
||||
+import jline.ConsoleReaderInputStream;
|
||||
+
|
||||
import org.mozilla.javascript.Kit;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
import org.mozilla.javascript.ScriptableObject;
|
||||
@@ -59,39 +64,13 @@
|
||||
public class ShellLine {
|
||||
|
||||
public static InputStream getStream(Scriptable scope) {
|
||||
- // We don't want a compile-time dependency on the JLine jar, so use
|
||||
- // reflection to load and reference the JLine classes.
|
||||
- ClassLoader classLoader = ShellLine.class.getClassLoader();
|
||||
- Class<?> readerClass = Kit.classOrNull(classLoader, "jline.ConsoleReader");
|
||||
- if (readerClass == null)
|
||||
- return null;
|
||||
try {
|
||||
- // ConsoleReader reader = new ConsoleReader();
|
||||
- Constructor<?> c = readerClass.getConstructor();
|
||||
- Object reader = c.newInstance();
|
||||
-
|
||||
- // reader.setBellEnabled(false);
|
||||
- Method m = readerClass.getMethod("setBellEnabled", Boolean.TYPE);
|
||||
- m.invoke(reader, Boolean.FALSE);
|
||||
-
|
||||
- // reader.addCompletor(new FlexibleCompletor(prefixes));
|
||||
- Class<?> completorClass = Kit.classOrNull(classLoader,
|
||||
- "jline.Completor");
|
||||
- m = readerClass.getMethod("addCompletor", completorClass);
|
||||
- Object completor = Proxy.newProxyInstance(classLoader,
|
||||
- new Class[] { completorClass },
|
||||
- new FlexibleCompletor(completorClass, scope));
|
||||
- m.invoke(reader, completor);
|
||||
-
|
||||
- // return new ConsoleReaderInputStream(reader);
|
||||
- Class<?> inputStreamClass = Kit.classOrNull(classLoader,
|
||||
- "jline.ConsoleReaderInputStream");
|
||||
- c = inputStreamClass.getConstructor(readerClass);
|
||||
- return (InputStream) c.newInstance(reader);
|
||||
+ ConsoleReader reader = new ConsoleReader();
|
||||
+ reader.setBellEnabled(false);
|
||||
+ reader.addCompletor(new FlexibleCompletor(scope));
|
||||
+ return new ConsoleReaderInputStream(reader);
|
||||
+ } catch (IOException e) {
|
||||
} catch (NoSuchMethodException e) {
|
||||
- } catch (InstantiationException e) {
|
||||
- } catch (IllegalAccessException e) {
|
||||
- } catch (InvocationTargetException e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -102,29 +81,17 @@
|
||||
* complete on a line that it can fully recognize (only composed of
|
||||
* completed strings). This one completes whatever came before.
|
||||
*/
|
||||
-class FlexibleCompletor implements java.lang.reflect.InvocationHandler {
|
||||
- private Method completeMethod;
|
||||
+class FlexibleCompletor implements Completor {
|
||||
private Scriptable global;
|
||||
|
||||
- FlexibleCompletor(Class<?> completorClass, Scriptable global)
|
||||
+ FlexibleCompletor(Scriptable global)
|
||||
throws NoSuchMethodException
|
||||
{
|
||||
this.global = global;
|
||||
- this.completeMethod = completorClass.getMethod("complete", String.class,
|
||||
- Integer.TYPE, List.class);
|
||||
- }
|
||||
-
|
||||
- @SuppressWarnings({"unchecked"})
|
||||
- public Object invoke(Object proxy, Method method, Object[] args) {
|
||||
- if (method.equals(this.completeMethod)) {
|
||||
- int result = complete((String)args[0], ((Integer) args[1]).intValue(),
|
||||
- (List<String>) args[2]);
|
||||
- return Integer.valueOf(result);
|
||||
- }
|
||||
- throw new NoSuchMethodError(method.toString());
|
||||
}
|
||||
|
||||
- public int complete(String buffer, int cursor, List<String> candidates) {
|
||||
+ @SuppressWarnings({"unchecked"})
|
||||
+ public int complete(String buffer, int cursor, List candidates) {
|
||||
// Starting from "cursor" at the end of the buffer, look backward
|
||||
// and collect a list of identifiers separated by (possibly zero)
|
||||
// dots. Then look up each identifier in turn until getting to the
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:afe2824349af04ed9b36787e3c2f35e57f09d0bab82b2ad632887c90a9711dd9
|
||||
size 219739
|
1729
rhino-dojo.patch
1729
rhino-dojo.patch
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user