Skip to content
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

fix(cmcd): Fix Symbol usage in CMCD on Xbox One #4073

Merged
merged 2 commits into from Mar 29, 2022

Conversation

avelad
Copy link
Collaborator

@avelad avelad commented Mar 29, 2022

Close #4072

@avelad
Copy link
Collaborator Author

avelad commented Mar 29, 2022

@joeyparrish can you test it in the Xbox? Thanks!

if (!('description' in proto)) {
Object.defineProperty(proto, 'description', {
get: () => {
const m = /\((.*)\)/.exec(this.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Using this in an arrow function refers to the enclosing scope, here meaning the this of install(), which I believe is shaka.polyfill.Symbol.

I think you'll need to replace this arrow function with a function or method.

I have tested toString() and the regex on Xbox, and it should work otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

I took the liberty of making an edit to resolve this. I then tested it on Xbox, and the tests are passing.

This resolves both the use of `this` in an arrow function and compiler issues with the type of `this`.
@joeyparrish joeyparrish changed the title fix(cmcd): Add Symbol.prototype.description polyfill fix(cmcd): Fix Symbol usage in CMCD on Xbox One Mar 29, 2022
@joeyparrish joeyparrish merged commit 4005754 into shaka-project:main Mar 29, 2022
@avelad avelad deleted the symbol-polyfill branch March 30, 2022 05:29
joeyparrish added a commit that referenced this pull request Apr 21, 2022
Close #4072

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
@avelad avelad added this to the v4.0 milestone May 4, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMCD tests failing on Xbox One
2 participants