Skip to content

Surprising callbacks.lock() behavior vs what is documented about it #1013

@callaingit

Description

@callaingit

callbacks.lock() seems to behave differently than what is documented at https://api.jquery.com/callbacks.lock/ in more recent versions of jQuery

Specifically, the second example does produce what it says it should produce, but not in more recent jQuery versions.

With jQuery 1.9.1 and 2.1.3 for example, the output is

foo: hello
foo: hello
bar: hello

But in version 2.2.0 and 3.1.1, I am getting this output

foo: hello
foo: hello
foo: silentArgument
foo: silentArgument
bar: silentArgument
foo: youHadMeAtHello
foo: youHadMeAtHello
bar: youHadMeAtHello

I am not sure if it is the documentation that is outdated and the lock() function has change behavior over time or if there is a bug in the versions of jQuery not producing the expected outout.

P.S. I ran the example code in IE 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions