tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
180 stars 13 forks source link

File mode specification error: (args-out-of-range 0 1) on a new file/buffer #56

Closed skumagai closed 12 years ago

skumagai commented 12 years ago

A call to js3-reparse causes this error on a new file/buffer. Upon inspection, this error is originated from (buffer-string-no-properties 1 (buffer-size)) in js3-do-parse, as (buffer-size) of an empty buffer is 0.

Because there is nothing to parse in this case, I worked around this problem by not calling (js3-reparse) inside js3-mode when opening an empty file/buffer.

tamzinblake commented 12 years ago

@skumagai Thanks! Also used this method to fix #57

skumagai commented 12 years ago

no problem, and thanks too for this great work!