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

Allow self referencing arrays #1

Closed
wants to merge 2 commits into from
Closed

Conversation

ssured
Copy link
Contributor

@ssured ssured commented Aug 29, 2014

@calvinmetcalf
Copy link
Member

I may be slow due to it being early but what is !/\d+/.test(name) doing? Also we should probably open an issue in ember about fucking around with globals

@ssured
Copy link
Contributor Author

ssured commented Aug 29, 2014

The regex tests for values being fully numeric.

/\d+/.test(‘1213’) === true
/\d+/.test(‘1aa3’) === false

Essentially what the code does is asserting all properties in an array must be array indices.

@ssured
Copy link
Contributor Author

ssured commented Aug 29, 2014

About Ember, I think this is not related to globals, it just sets custom properties on Arrays. which imo is valid:

a = [1,2]
a.self = a
console.log(JSON.stringify(a))

will output [1,2]

@calvinmetcalf
Copy link
Member

ah then +1

@nolanlawson
Copy link
Member

I'm going to move this to the pouchdb org. Also yeah, this PR makes sense.

nolanlawson pushed a commit that referenced this pull request Aug 29, 2014
@nolanlawson
Copy link
Member

44a5164

@nolanlawson
Copy link
Member

also I will say that I would have liked to have seen a test for this, but since we don't have any tests set up in this project, it's okay

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.

None yet

3 participants