tokens7.add(new Token(mode, TokenType.NULL, ")"));
tokens7.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens7.add(new Token(mode, TokenType.NULL, "{"));
tokens7.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsIndexUpdater indexUpdater = new JsIndexUpdater();
indexUpdater.onBeforeParse();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens1);
JsCodeScope aScope = line.getTag(JsIndexUpdater.TAG_SCOPE);
assertNotNull(aScope);
assertEquals("a", aScope.getName());
line = line.getNextLine();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens2);
JsCodeScope dProtoScope = line.getTag(JsIndexUpdater.TAG_SCOPE);
assertNotNull(dProtoScope);
assertEquals("d.prototype", dProtoScope.getName());
assertTrue(dProtoScope.getParent() == aScope);
assertEquals("a-d-prototype", JsCodeScope.buildPrefix(dProtoScope).join("-"));
line = line.getNextLine();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens3);
assertTrue(line.getTag(JsIndexUpdater.TAG_SCOPE) == aScope);
line = line.getNextLine();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens4);
assertFalse(line.getTag(JsIndexUpdater.TAG_SCOPE) == aScope);
line = line.getNextLine();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens5);
JsCodeScope eScope = line.getTag(JsIndexUpdater.TAG_SCOPE);
assertNotNull(eScope);
assertEquals("e", eScope.getName());
assertFalse(eScope.getParent() == aScope);
line = line.getNextLine();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens6);
JsCodeScope fScope = line.getTag(JsIndexUpdater.TAG_SCOPE);
assertNotNull(fScope);
assertEquals("f", fScope.getName());
assertTrue(fScope.getParent() == eScope);
line = line.getNextLine();
previousLine = TaggableLineUtil.getPreviousLine(line);
indexUpdater.onParseLine(previousLine, line, tokens7);
JsCodeScope namelessScope = line.getTag(JsIndexUpdater.TAG_SCOPE);
assertNotNull(namelessScope);
assertNull(namelessScope.getName());
assertTrue(namelessScope.getParent() == fScope);
indexUpdater.onAfterParse();
}