NAME

JS::SourceMap::Token - One entry in a source map index

SYNOPSIS

$map = JS::SourceMap::load($mapfile);
$token = $map->lookup($minified_line,$minified_col);
print $token->src, ":", $token->src_line, " column ", $token->src_col, "\n";

DESCRIPTION

Instances of this class represent an element in a sourcemap. Tokens map a line/column in the minfied code to the real source file, line and column number in the unminified/combined JS code. Tokens may also have a name associated with them if e.g. they happen to be at the beginning of a function definition, etc.

  • dst_line

  • dst_col

  • src

  • src_line

  • src_col

  • name

    Accessors for the properties of a token, respectively: the minified line and column, source file name (can be undef), original source line and column and the name of the entity in the source file (is frequently undef).

  • as_string

    Return a string representation of the data contained in the Token.

SEE ALSO

JS::SourceMap::Index, JS::SourceMap::Decoder

AUTHOR

attila <attila@stalphonsos.com>

LICENSE

ISC/BSD c.f. LICENSE in the source distribution.