mirror of
https://github.com/robertkrimen/otto
synced 2025-10-26 20:28:49 +08:00
ast: ThisExpression.Idx1() should point to the end of this (#251)
This commit is contained in:
committed by
Steven Hartland
parent
21ec96599b
commit
bc4cd51799
@@ -1009,6 +1009,12 @@ func TestPosition(t *testing.T) {
|
||||
is(err, nil)
|
||||
node = program.Body[0].(*ast.ExpressionStatement).Expression.(*ast.FunctionLiteral)
|
||||
is(node.(*ast.FunctionLiteral).Source, "function(){ return abc; }")
|
||||
|
||||
parser = _newParser("", "this.style", 1, nil)
|
||||
program, err = parser.parse()
|
||||
node = program.Body[0].(*ast.ExpressionStatement).Expression.(*ast.DotExpression).Left.(*ast.ThisExpression)
|
||||
is(node.Idx0(), file.Idx(1))
|
||||
is(node.Idx1(), file.Idx(5))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user