зеркало из https://github.com/mozilla/gecko-dev.git
Removal of Token.TONUMBER: it had exactly the same semantics as Token.POS, that is to convert its argument to number.
This commit is contained in:
Родитель
9f10aae4a5
Коммит
9a1fbf3def
|
@ -839,10 +839,6 @@ public class IRFactory {
|
|||
}
|
||||
}
|
||||
|
||||
private Node createToNumber(Node expr) {
|
||||
return new Node(Token.TONUMBER, expr);
|
||||
}
|
||||
|
||||
private Node createSetName(int assignOp, Node left, Node right,
|
||||
boolean tonumber, boolean postfix)
|
||||
{
|
||||
|
@ -861,7 +857,7 @@ public class IRFactory {
|
|||
|
||||
Node opLeft = Node.newString(Token.NAME, s);
|
||||
if (tonumber)
|
||||
opLeft = createToNumber(opLeft);
|
||||
opLeft = new Node(Token.POS, opLeft);
|
||||
if (postfix)
|
||||
opLeft = createNewTemp(opLeft);
|
||||
Node op = new Node(assignOp, opLeft, right);
|
||||
|
@ -985,7 +981,7 @@ public class IRFactory {
|
|||
}
|
||||
|
||||
if (tonumber)
|
||||
opLeft = createToNumber(opLeft);
|
||||
opLeft = new Node(Token.POS, opLeft);
|
||||
if (postfix)
|
||||
opLeft = createNewTemp(opLeft);
|
||||
Node op = new Node(assignOp, opLeft, expr);
|
||||
|
|
|
@ -600,7 +600,7 @@ public class Interpreter
|
|||
itsStackDepth--;
|
||||
break;
|
||||
|
||||
case Token.TONUMBER:
|
||||
case Token.POS:
|
||||
iCodeTop = generateICode(child, iCodeTop);
|
||||
iCodeTop = addToken(Token.POS, iCodeTop);
|
||||
break;
|
||||
|
|
|
@ -214,13 +214,12 @@ public class Token
|
|||
ENUMDONE = 115,
|
||||
EXPRSTMT = 116,
|
||||
PARENT = 117,
|
||||
TONUMBER = 118,
|
||||
JSR = 119,
|
||||
NEWLOCAL = 120,
|
||||
USELOCAL = 121,
|
||||
SCRIPT = 122, // top-level node for entire script
|
||||
JSR = 118,
|
||||
NEWLOCAL = 119,
|
||||
USELOCAL = 120,
|
||||
SCRIPT = 121, // top-level node for entire script
|
||||
|
||||
LAST_TOKEN = 122;
|
||||
LAST_TOKEN = 121;
|
||||
|
||||
public static String name(int token)
|
||||
{
|
||||
|
@ -345,7 +344,6 @@ public class Token
|
|||
case ENUMDONE: return "enumdone";
|
||||
case EXPRSTMT: return "exprstmt";
|
||||
case PARENT: return "parent";
|
||||
case TONUMBER: return "tonumber";
|
||||
case JSR: return "jsr";
|
||||
case NEWLOCAL: return "newlocal";
|
||||
case USELOCAL: return "uselocal";
|
||||
|
|
|
@ -1280,7 +1280,7 @@ public class Codegen extends Interpreter {
|
|||
visitBitOp(node, type, child);
|
||||
break;
|
||||
|
||||
case Token.TONUMBER:
|
||||
case Token.POS:
|
||||
addByteCode(ByteCode.NEW, "java/lang/Double");
|
||||
addByteCode(ByteCode.DUP);
|
||||
generateCodeFromNode(child, node);
|
||||
|
|
Загрузка…
Ссылка в новой задаче