Skip to content

Core:Ajax: Align nonce & global with master, fix an AMD issue #4612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

mgol
Copy link
Member

@mgol mgol commented Feb 24, 2020

Summary

This PR aligns the 3.x-stable branch with master in two aspects:

  1. It migrates the nonce module to return an object instead of a primitive
    variable. This had to be changed on master as in ES modules you export
    live read-only bindings to variables, meaning you can't increment the nonce
    directly. Also, the way it was done so far was working differently in AMD & the
    single built file - in the built file one nonce variable was declared, accessed
    and incremented. In AMD mode separate instances were create for each module
    that depend on the nonce module, creating unintended nonce clashes.
  2. Whether the noGlobal parameter was set to true is now checked using the
    typeof operator to align with master.

+8 bytes

Checklist

Sorry, something went wrong.

This commit aligns the `3.x-stable` branch with `master` in two aspects:
1. It migrates the nonce module to return an object instead of a primitive
variable. This had to be changed on `master` as in ES modules you export
live read-only bindings to variables, meaning you can't increment the nonce
directly. Also, the way it was done so far was working differently in AMD & the
single built file - in the built file one nonce variable was declared, accessed
and incremented. In AMD mode separate instances were create for each module
that depend on the nonce module, creating unintended nonce clashes.
2. Whether the `noGlobal` parameter was set to `true` is now checked using the
typeof operator to align with `master`.

Ref jquerygh-4541
Ref d0ce00c
@mgol mgol removed the Needs review label Feb 24, 2020
@mgol mgol added this to the 3.5.0 milestone Feb 24, 2020
@mgol mgol merged commit 22bf701 into jquery:3.x-stable Feb 24, 2020
@mgol mgol deleted the 3.x-align-with-master branch February 24, 2020 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants