Skip to content

🐛 inputmask: remove static from fn using this#29646

Merged
samouri merged 2 commits intoampproject:masterfrom
samouri:fix-strict
Aug 4, 2020
Merged

🐛 inputmask: remove static from fn using this#29646
samouri merged 2 commits intoampproject:masterfrom
samouri:fix-strict

Conversation

@samouri
Copy link
Copy Markdown
Member

@samouri samouri commented Aug 3, 2020

Fixes #29499

Causes a bug due to: google/closure-compiler#2397

@cmhokej
Copy link
Copy Markdown

cmhokej commented Aug 3, 2020

Gool

Copy link
Copy Markdown
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intention was for this to initialize the Inputmask only once, and this will create one for each element. Mind correcting this?

@samouri
Copy link
Copy Markdown
Member Author

samouri commented Aug 4, 2020

@jridgewell: I don't see how initializing only once could be correct given that element is a parameter to the constructor.

const Inputmask = inputmaskFactory(element);

In practice, the cache is never used in sloppy mode. The cache lookup is done against window, but then the assignment to this.InputMask is on a Mask instance.

@samouri samouri merged commit 6e46679 into ampproject:master Aug 4, 2020
@samouri samouri deleted the fix-strict branch August 4, 2020 22:42
calebcordry pushed a commit that referenced this pull request Aug 11, 2020
* inputmask: remove static from fn using `this`

* fix test

(cherry picked from commit 6e46679)
calebcordry pushed a commit that referenced this pull request Aug 11, 2020
* inputmask: remove static from fn using `this`

* fix test

(cherry picked from commit 6e46679)
ed-bird pushed a commit to ed-bird/amphtml that referenced this pull request Dec 10, 2020
* inputmask: remove static from fn using `this`

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚨 Error: undefined is not an object (evaluating 'this.o')

6 participants