Skip to content

When augmenting Array.prototype, make the functions non-enumerable by de... #1022

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 3 commits into from
Nov 1, 2014

Conversation

CyrusNajmabadi
Copy link
Contributor

...fault so as to not affect clients that call for-in

… default so as to not affect clients that call for-in
@@ -25,22 +25,44 @@ module TypeScript.Syntax {
// Debug.assert(!separators || separators.length === 0);
}

Array.prototype.kind = function () {
return this.separators === undefined ? SyntaxKind.List : SyntaxKind.SeparatedList;
function addArrayFunction(name: string, func: Function) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just make this a defineProperty utility function.

@DanielRosenwasser
Copy link
Member

👍

@CyrusNajmabadi
Copy link
Contributor Author

Would actaully prefer to not make this functionality general. We don't really want to be mucking with properties most of the time.

CyrusNajmabadi added a commit that referenced this pull request Nov 1, 2014
When augmenting Array.prototype, make the functions non-enumerable by de...
@CyrusNajmabadi CyrusNajmabadi merged commit 5d7cb7a into master Nov 1, 2014
@CyrusNajmabadi CyrusNajmabadi deleted the defineProperty branch November 1, 2014 01:55
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants