Code Monkey home page Code Monkey logo

sourcemap's Introduction

Source maps

Cross platform source map parser for Haxe programming language.

Usage

import sourcemap.SourcePos;

class Main {

	static public function main() {
		var data = "Contents of some .js.map file";
		var map = new SourceMap(data);

		var pos : SourcePos = map.originalPositionFor(1, 3);
		trace(pos);
		/*
			Outputs:
			{
				generatedLine:1,
				generatedColumn:3,
				originalColumn:10,
				originalLine:3,
				source:"/path/to/Test.hx",
				name:"methodName"
			}
		*/

		map.eachMapping(function (pos:SourcePos) {
			trace(pos);
		});
	}
}

sourcemap's People

Contributors

realyuniquename avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

beeblerox

sourcemap's Issues

Position error

Hej Aleksandr,

I don't know if the lib is up to date but, when I use it to parse .js.map file, there is sometimes an offset with the real position throw in the chrome debug console.
I don't know if it's linked to this issue, maybe do you remember : HaxeFoundation/haxe#10585
This is what sourcemap gives me :

Error: test

at new haxe_ValueException (file:////usr/local/share/haxe/std/haxe/ValueException.hx:23:71)
at haxe_Exception.thrown (file:////usr/local/share/haxe/std/js/_std/haxe/Exception.hx:33:9)
at com_bgds_office_web_HomeApi.doDefault (file:////media/filt3rek/common/work/bgds/git/office/src/com/bgds/office/web/HomeApi.hx:25:21)
at haxe_web_Dispatch.runtimeDispatch (file:////media/filt3rek/common/work/lib/ftk/git/haxe/web/Dispatch.hx:132:3)
at com_bgds_office_web_Api.doHome (file:////media/filt3rek/common/work/bgds/git/office/src/com/bgds/office/web/Api.hx:253:32)
at haxe_web_Dispatch.runtimeDispatch (file:////media/filt3rek/common/work/lib/ftk/git/haxe/web/Dispatch.hx:132:3)
at next (file:////media/filt3rek/common/work/lib/ftk/git/ftk/web/Client.hx:61:4)
at com_bgds_office_Client.run (file:////media/filt3rek/common/work/lib/ftk/git/ftk/web/Client.hx:80:3)
at run (file:////media/filt3rek/common/work/bgds/git/office/src/com/bgds/office/Client.hx:37:16)
at anonymous function (file:////media/filt3rek/common/work/bgds/git/office/src/com/bgds/office/Client.hx:45:64)

And this is the Chrome dev console output :

ValueException.hx:24 Uncaught Error: test
    at new haxe_ValueException (ValueException.hx:24:3)
    at haxe_Exception.thrown (Exception.hx:34:12)
    at com_bgds_office_web_HomeApi.doDefault (HomeApi.hx:45:3)
    at haxe_web_Dispatch.runtimeDispatch (Dispatch.hx:132:55)
    at com_bgds_office_web_Api.doHome (Api.hx:254:3)
    at haxe_web_Dispatch.runtimeDispatch (Dispatch.hx:132:55)
    at next (Client.hx:61:5)
    at com_bgds_office_Client.run (Client.hx:80:4)
    at run (Client.hx:39:4)
    at Client.hx:49:5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.