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

Support ECMAScript 2015 Map and Set in length filter #705

Merged
merged 1 commit into from
Apr 5, 2016
Merged

Support ECMAScript 2015 Map and Set in length filter #705

merged 1 commit into from
Apr 5, 2016

Conversation

ricordisamoa
Copy link
Contributor

They both expose a 'size' property:
http://www.ecma-international.org/ecma-262/6.0/#sec-get-map.prototype.size
http://www.ecma-international.org/ecma-262/6.0/#sec-get-set.prototype.size

Use that instead of the 'length' property.
Also added two tests that only run if the respective globals are set.

They both expose a 'size' property:
http://www.ecma-international.org/ecma-262/6.0/#sec-get-map.prototype.size
http://www.ecma-international.org/ecma-262/6.0/#sec-get-set.prototype.size

Use that instead of the 'length' property.
Also added two tests that only run if the respective globals are set.
@ricordisamoa
Copy link
Contributor Author

It isn't very clear to me to what extent ES2015 is embraced by Nunjucks, but I made the pull request anyway since they seemed roughly equivalent to Python dicts and sets.

@carljm
Copy link
Contributor

carljm commented Mar 20, 2016

This looks good to me! I don't think nunjucks currently has much ES2015 support, but that's no reason not to start improving it. Thanks for the PR! I'm on vacation for the next two weeks, but I'll merge it when I get back

@carljm carljm merged commit 7b8ebf5 into mozilla:master Apr 5, 2016
carljm added a commit that referenced this pull request Apr 5, 2016
Support ECMAScript 2015 Map and Set in length filter
@ricordisamoa ricordisamoa deleted the mapset branch April 5, 2016 23:23
carljm added a commit that referenced this pull request Apr 15, 2016
* 2.x:
  Bump version for 2.5.0 dev.
  Bump version for 2.4.2 release.
  Fix use of 'in' operator with strings. Fixes #714.
  Make a note that setting web:async:true in your config requires use of async render API.
  Fix docs build.
  Docs : Update translations in french
  Merge pull request #721 from jbmoelker/api-docs-prefix-environment
  Merge branch 'ughitsaaron-docs-add-gulp'
  Merge branch 'jbmoelker-patch-1'
  Update changelog.
  Merge pull request #705 from ricordisamoa/mapset
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.

2 participants