Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8796 closed bug (notabug)

cannot call methods prior to initialization regression

Reported by: frediani.adrien Owned by:
Priority: minor Milestone: 1.10.0
Component: ui.widget Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

I noticed a regression, even though this look weird, calling destroy method before widget's instanciation was not breaking in 1.8 version. It does in latest 1.9.

Here a simple testcase: http://jsbin.com/iwisuj/2/edit

on 1.8 destroy method is not called, but widget is correctly created. on 1.9 following error is breaking the widget (not displayed correctly) -> Uncaught Error: cannot call methods on test prior to initialization; attempted to call method 'destroy'

Change History (4)

comment:1 Changed 7 years ago by Scott González

Component: ui.coreui.widget
Resolution: notabug
Status: newclosed

This is not a bug. If we wrote code specifically to throw an error, why would you think it was unintentional? How does calling a method on something that's not initialized make sense?

comment:2 Changed 7 years ago by Jörn Zaefferer

Throwing erros when calling invalid methods is mentioned in the upgrade guide, but calling methods on uninitialized widgets isn't: http://jqueryui.com/upgrade-guide/1.9/#calling-an-invalid-method-now-throws-an-error

comment:3 Changed 7 years ago by frediani.adrien

Of course, it doesn't make any sense but this could still cause a regression on 1.8 widgets that are doing this bad practice, even with the $.uiBackCompat = true; it still fails which should not be the expected behaviour I guess.

comment:4 Changed 7 years ago by Scott González

While this was previously a no-op, I don't believe this was ever defined behavior. Both cases (calling methods that don't exist and calling methods prior to initialization) are just wrong.

Note: See TracTickets for help on using tickets.