Skip to content

Commit 9bb99ed

Browse files
committed
Revert "Implement a guessing nqp::isttyfh on the JVM (the JVM doesn't allow us to implement a fully correct version)."
This reverts commit bbf2eaf. It breaks the build on the JVM
1 parent cb57d0d commit 9bb99ed

File tree

4 files changed

+2
-27
lines changed

4 files changed

+2
-27
lines changed

src/vm/jvm/QAST/Compiler.nqp

-2
Original file line numberDiff line numberDiff line change
@@ -2077,8 +2077,6 @@ QAST::OperationsJAST.map_classlib_core_op('eoffh', $TYPE_OPS, 'eoffh', [$RT_OBJ]
20772077
QAST::OperationsJAST.map_classlib_core_op('closefh', $TYPE_OPS, 'closefh', [$RT_OBJ], $RT_OBJ, :tc);
20782078
QAST::OperationsJAST.map_classlib_core_op('closefh_i', $TYPE_OPS, 'closefhi', [$RT_OBJ], $RT_INT, :tc);
20792079

2080-
QAST::OperationsJAST.map_classlib_core_op('isttyfh', $TYPE_OPS, 'isttyfh', [$RT_OBJ], $RT_INT, :tc);
2081-
20822080
QAST::OperationsJAST.map_classlib_core_op('chmod', $TYPE_OPS, 'chmod', [$RT_STR, $RT_INT], $RT_INT, :tc);
20832081
QAST::OperationsJAST.map_classlib_core_op('unlink', $TYPE_OPS, 'unlink', [$RT_STR], $RT_INT, :tc);
20842082
QAST::OperationsJAST.map_classlib_core_op('rmdir', $TYPE_OPS, 'rmdir', [$RT_STR], $RT_INT, :tc);

src/vm/jvm/runtime/org/perl6/nqp/io/StandardReadHandle.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.perl6.nqp.runtime.ExceptionHandling;
1313
import org.perl6.nqp.runtime.ThreadContext;
1414

15-
public class StandardReadHandle implements IIOClosable, IIOEncodable, IIOSyncReadable, IIOInteractive, IIOPossiblyTTY {
15+
public class StandardReadHandle implements IIOClosable, IIOEncodable, IIOSyncReadable, IIOInteractive {
1616
private InputStream is;
1717
private BufferedReader br;
1818
private ConsoleReader cr;
@@ -118,8 +118,4 @@ public synchronized String readlineInteractive(ThreadContext tc, String prompt)
118118
public boolean eof(ThreadContext tc) {
119119
return eof;
120120
}
121-
122-
public boolean isTTY(ThreadContext tc) {
123-
return System.console() != null;
124-
}
125121
}

src/vm/jvm/runtime/org/perl6/nqp/io/StandardWriteHandle.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.perl6.nqp.runtime.ExceptionHandling;
1212
import org.perl6.nqp.runtime.ThreadContext;
1313

14-
public class StandardWriteHandle implements IIOClosable, IIOSeekable, IIOEncodable, IIOSyncWritable, IIOPossiblyTTY {
14+
public class StandardWriteHandle implements IIOClosable, IIOSeekable, IIOEncodable, IIOSyncWritable {
1515
private PrintStream ps;
1616
private CharsetEncoder enc;
1717
private CharsetDecoder dec;
@@ -65,8 +65,4 @@ public long say(ThreadContext tc, String s) {
6565
public void flush(ThreadContext tc) {
6666
ps.flush();
6767
}
68-
69-
public boolean isTTY(ThreadContext tc) {
70-
return System.console() != null;
71-
}
7268
}

src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java

-15
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
import org.perl6.nqp.io.IIOSeekable;
6161
import org.perl6.nqp.io.IIOSyncReadable;
6262
import org.perl6.nqp.io.IIOSyncWritable;
63-
import org.perl6.nqp.io.IIOPossiblyTTY;
6463
import org.perl6.nqp.io.ProcessHandle;
6564
import org.perl6.nqp.io.ProcessChannel;
6665
import org.perl6.nqp.io.ServerSocketHandle;
@@ -814,20 +813,6 @@ public static long closefhi(SixModelObject obj, ThreadContext tc) {
814813
return -1;
815814
}
816815

817-
public static long isttyfh(SixModelObject obj, ThreadContext tc) {
818-
if (obj instanceof IOHandleInstance) {
819-
IOHandleInstance h = (IOHandleInstance)obj;
820-
if (h.handle instanceof IIOPossiblyTTY)
821-
return ((IIOPossiblyTTY)h.handle).isTTY(tc) ? 1 : 0;
822-
else
823-
return 0;
824-
}
825-
else {
826-
die_s("isttyfh requires an object with the IOHandle REPR", tc);
827-
}
828-
return -1;
829-
}
830-
831816
public static Set<PosixFilePermission> modeToPosixFilePermission(long mode) {
832817
Set<PosixFilePermission> perms = EnumSet.noneOf(PosixFilePermission.class);
833818
if ((mode & 0001) != 0) perms.add(PosixFilePermission.OTHERS_EXECUTE);

0 commit comments

Comments
 (0)