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

Throw TypeError when trying to serialize native built-in functions #7

Merged
merged 1 commit into from
Aug 13, 2013

Conversation

ericf
Copy link
Collaborator

@ericf ericf commented Aug 6, 2013

This changes the serialization process of functions to throw when a native built-in function is trying to be serialized.

This changes the serialization process of functions to throw when a
native built-in function is trying to be serialized.
@caridy
Copy link
Contributor

caridy commented Aug 7, 2013

+1

@clarle
Copy link

clarle commented Aug 7, 2013

Weird edge case, but might also want to check for function Empty() {} too in case someone decides to try to serialize Function.prototype.

@ericf
Copy link
Collaborator Author

ericf commented Aug 7, 2013

@clarle I'm not worried about that one since it's valid JavaScript. But in the future the prototypes of built-ins may get tricky to deal with as they will stop being instances of their own constructors.

The reason I wrap everything in an IIFE is to keep any named function declarations from hoisting out into another (global) scope.

@ericf ericf merged commit 63ca698 into master Aug 13, 2013
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

Successfully merging this pull request may close these issues.

3 participants