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

TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context, when using addTrack() method #1023

Closed
3 tasks done
dimitrisniras opened this issue Feb 26, 2020 · 4 comments

Comments

@dimitrisniras
Copy link
Contributor

Please read first!

Please use discuss-webrtc for general technical discussions and questions.

  • I have provided steps to reproduce (e.g. a link to a jsfiddle)
  • I have provided browser name, version and adapter.js version
  • This issue only happens when adapter.js is used

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.

Versions affected

Browser name including version (e.g. Chrome 64.0.3282.119)

Safari Version: 13.0.5 and all 13.x.x versions

adapter.js (e.g. 6.1.0)

Version 7.5.0

Description

When trying to use the RTCPeerConnection.addTrack(track) method, I am receiving this error

 TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.

image

Steps to reproduce

  1. Create a new RTCPeerConnection
  2. Get the localStream from getUserMedia()
  3. Execute RTCPeerConnection.addTrack(track) for every tack in the localStream

Expected results

No errors

Actual results

TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.

@fippo
Copy link
Member

fippo commented Feb 27, 2020

This one is going to get ugly. It looks like strict mode is forbidding that:
https://whereswalden.com/2010/09/08/new-es5-strict-mode-support-now-with-poison-pills/
We want to not specify stream here since this would modify the function signature.

From what I can tell the right approach would be something like this:

const f = function(one, ...arguments) {}

which retains the mandatory argument but gives us access to the optional ones, without modifying the signature. Can you give that a try in the PR?
This probably happens in a number of places...

@fippo fippo closed this as completed in beed221 Feb 28, 2020
@fippo
Copy link
Member

fippo commented Feb 28, 2020

I wonder if there is more here... the "legacy" createOffer stuff might be affected as well, did you test that?

@dimitrisniras
Copy link
Contributor Author

I wonder if there is more here... the "legacy" createOffer stuff might be affected as well, did you test that?

I didn't have the chance to test this, but probably will have the same problem for every function in Safari is using arguments, or caller/callee, while using strict. So, I could open a new issue and a PR fixing the others as well.

@fippo
Copy link
Member

fippo commented Mar 3, 2020

opened #1025 for tracking more work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants