diff options
Diffstat (limited to 'src/jdk/nashorn/internal/ir/LexicalContext.java')
-rw-r--r-- | src/jdk/nashorn/internal/ir/LexicalContext.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/jdk/nashorn/internal/ir/LexicalContext.java b/src/jdk/nashorn/internal/ir/LexicalContext.java index c3f096f5..13eb0aa8 100644 --- a/src/jdk/nashorn/internal/ir/LexicalContext.java +++ b/src/jdk/nashorn/internal/ir/LexicalContext.java @@ -64,7 +64,6 @@ public class LexicalContext { for (int i = sp - 1; i >= 0; i--) { if (stack[i] == node) { flags[i] |= flag; - //System.err.println("Setting flag " + node + " " + flag); return; } } @@ -117,8 +116,6 @@ public class LexicalContext { return (FunctionNode)stack[0]; } - - /** * Pushes a new block on top of the context, making it the innermost open block. * @param node the new node @@ -395,8 +392,7 @@ public class LexicalContext { */ public boolean isFunctionDefinedInCurrentCall(FunctionNode functionNode) { final LexicalContextNode parent = stack[sp - 2]; - if(parent instanceof CallNode && ((CallNode)parent).getFunction() == functionNode) { - assert functionNode.getSource() == peek().getSource(); + if (parent instanceof CallNode && ((CallNode)parent).getFunction() == functionNode) { return true; } return false; @@ -543,13 +539,16 @@ public class LexicalContext { sb.append('@'); sb.append(Debug.id(node)); sb.append(':'); - final Source source = node.getSource(); - String src = source.toString(); - if (src.indexOf(File.pathSeparator) != -1) { - src = src.substring(src.lastIndexOf(File.pathSeparator)); + if (node instanceof FunctionNode) { + final Source source = ((FunctionNode)node).getSource(); + String src = source.toString(); + if (src.indexOf(File.pathSeparator) != -1) { + src = src.substring(src.lastIndexOf(File.pathSeparator)); + } + src += ' '; + src += source.getLine(node.getStart()); + sb.append(src); } - src += ' '; - src += source.getLine(node.getStart()); sb.append(' '); } sb.append(" ==> ]"); |