Skip to content

Conversation

@sokra
Copy link
Contributor

@sokra sokra commented Mar 20, 2013

This pull request is based on #46 and #47.

It added a method SourceNode.fromStringWithSourceMap.

It converts a SourceMap into a SourceNode. It's useful if embedding other files that already bring a SourceMap.

This is an optional step 3 for composing SourceMaps.

@sokra
Copy link
Contributor Author

sokra commented Mar 20, 2013

This is not ready to be merged....

@fitzgen
Copy link
Contributor

fitzgen commented Mar 20, 2013

This looks great, remember to add documentation in the readme for the new method!

Let me know when it is ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please add a space between if and (, as well as while and ( below and in the rest of the file. Thanks!

@sokra
Copy link
Contributor Author

sokra commented Mar 21, 2013

rebased, style fixed and documentation added.

@sokra
Copy link
Contributor Author

sokra commented Mar 21, 2013

I only thought it wasn't ready because I tried with coffee-script SourceMap und the result was weird. But it was only weird, because coffee-script SourceMaps are weird. I've written a little visulization tool to view SourceMaps

uglify-js produces nice mappings, but file property is missing.

TypeScript has the best mappings.

coffee-script has weird mappings.

CoffeeScriptRedux has weird mappings and a original column offset of 1. @michaelficarra

There is a "Minimize" button, which minimizes the source with uglify-js and combines the SourceMaps. (best to test it with TypeScript).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I know you authored this before it existed, but can you use util.assertEqualMaps here instead of all of these separate asserts? Also, for if you write more tests in the future, we can't use deepEqual in the tests because we haven't shimmed it for Firefox's xpcshell tests. If you haven't seen it, I added a list of the methods you can use in the README under the tests section.

@fitzgen
Copy link
Contributor

fitzgen commented Mar 22, 2013

Thanks a lot! Will merge this in as soon as the one thing is taken care of.

@sokra
Copy link
Contributor Author

sokra commented Mar 24, 2013

done

@fitzgen
Copy link
Contributor

fitzgen commented Mar 25, 2013

ec0f21d

Thanks!

@fitzgen fitzgen closed this Mar 25, 2013
@sokra
Copy link
Contributor Author

sokra commented Mar 25, 2013

You didn't merged sokra/source-map@8e7d033...

@fitzgen
Copy link
Contributor

fitzgen commented Mar 25, 2013

Argh I was wondering why github wasn't marking it merged. Forgot to fetch before I merged. Thanks again!

@sokra sokra deleted the source-node-from-string-with-map branch March 25, 2013 20:55
@sokra
Copy link
Contributor Author

sokra commented Mar 25, 2013

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants