예제 #1
0
        public override void Visit(FunctionObject node)
        {
            base.Visit(node);
            var bindings = GetBindings(node);

            if (bindings != null)
            {
                FunctionMapEntry functionMapEntry = new FunctionMapEntry(
                    bindings: bindings,
                    deminifiedMethodName: SourceMap.GetDeminifiedMethodName(bindings),
                    startSourcePosition: new SourcePosition(
                        zeroBasedLineNumber: node.Body.Context.StartLineNumber - 1,                         // Souce maps work with zero based line and column numbers, the AST works with one based line numbers. We want to use zero-based everywhere.
                        zeroBasedColumnNumber: node.Body.Context.StartColumn),
                    endSourcePosition: new SourcePosition(
                        zeroBasedLineNumber: node.Body.Context.EndLineNumber - 1,                         // Souce maps work with zero based line and column numbers, the AST works with one based line numbers. We want to use zero-based everywhere.
                        zeroBasedColumnNumber: node.Body.Context.EndColumn));

                FunctionMap.Add(functionMapEntry);
            }
        }