tests-always-included / pretty-js

Beautify and pretty print JavaScript and JSON
Other
21 stars 4 forks source link

Not all "catch"es are "catch" #6

Closed fidian closed 10 years ago

fidian commented 10 years ago

Before:

// catch
expect(typeof result.catch).toBe('function');  // $q

// default
this.value = schema.default;

After:

// catch
expect(typeof result.
catch).toBe('function');  // $q

// default
this.value = schema.
default;

Unfortunately this also messes up subsequent lines because they are all indented over once more.

Also, be wary of object properties:

schema = {
    default: 'some value'
}

vs

schema = {
default: 'some value'
}
fidian commented 10 years ago

This is related to half of the problem plaguing #7. Keywords might not be keywords in certain contexts.

fidian commented 10 years ago

When used as an identifier, keywords are now converted to identifiers and processed properly.