mikeric / rivets

Lightweight and powerful data binding.
http://rivetsjs.com
MIT License
3.23k stars 310 forks source link

Uncaught SyntaxError: Invalid regular expression: /^on-.+$/: Stack overflow #85

Closed yocontra closed 12 years ago

yocontra commented 12 years ago
Uncaught SyntaxError: Invalid regular expression: /^on-.+$/: Stack overflow
Rivets.View.View.build.parseNode
Rivets.View.View.build
__bind
View
rivets.bind
Rivets.binders.each-*.routine
Rivets.Binding.Binding.set
__bind
Rivets.Binding.Binding.sync
__bind
Rivets.Binding.Binding.bind
__bind
Rivets.View.View.bind
__bind
rivets.bind
Rivets.binders.each-*.routine
Rivets.Binding.Binding.set
__bind
Rivets.Binding.Binding.sync
__bind
Rivets.Binding.Binding.bind
__bind
Rivets.View.View.bind
__bind
rivets.bind
Rivets.binders.each-*.routine
Rivets.Binding.Binding.set
__bind
Rivets.Binding.Binding.sync
__bind
Rivets.Binding.Binding.bind
__bind
Rivets.View.View.bind
__bind
rivets.bind
Rivets.binders.each-*.routine

(repeats like this for a long time)
mikeric commented 12 years ago

Can you provide a contrived example to reproduce this?

yocontra commented 12 years ago

It's difficult to see which part of the application the error is coming from without a stack trace so I can't tell which binding or adapter is causing the issue - will look into it and see if I can get a test for it later today

yocontra commented 12 years ago

Browser is Chromium Version 20.0.1132.47 Ubuntu 12.04 (144678)

ghost commented 12 years ago

I can reproduce this. I modified the stapes todo sample to isolate the issue. Here is a fiddle:

http://jsfiddle.net/dheeraj_kumar/py4gD/

I don't get the regular expression error, but the stack trace is exactly the same.

ghost commented 12 years ago

This seems to occur only when the loop is bound to data returned from a method, not to data itself.

Thoughts, @Contra ?

ghost commented 12 years ago

The same todo list, which works perfectly when the loop is bound to actual data, not returned from a method. http://jsfiddle.net/dheeraj_kumar/qNKht/

ghost commented 12 years ago

Found it! forking...