mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-27 07:14:36 +02:00
Add throw error for undefined method on plugins
This commit is contained in:
@@ -277,6 +277,9 @@ const ScrollSpy = (($) => {
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (data[config] === undefined) {
|
||||
throw new Error(`No method named "${config}"`)
|
||||
}
|
||||
data[config]()
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user