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

Make cursor.map/forEach follow the ECMAScript APIs #63

Closed
wants to merge 8 commits into from
Closed

Make cursor.map/forEach follow the ECMAScript APIs #63

wants to merge 8 commits into from

Conversation

@iwoj
Copy link

@iwoj iwoj commented Apr 19, 2012

...as per convention in Javascript. This makes for much more elegant code.

…ntion. Makes for much nicer application code.
@@ -20,7 +20,7 @@ if [ "$UNAME" = "Darwin" ] ; then
fi
ARCH="x86_64"
elif [ "$UNAME" = "Linux" ] ; then
ARCH=$(uname -m)
ARCH="$(uname -m)"

This comment has been minimized.

@iwoj

iwoj Apr 19, 2012
Author

This may not be necessary.

@@ -36,7 +36,7 @@ if [ -L "$(basename $0)" ] ; then
cd $(dirname $(readlink $(basename "$0") ) )
fi
SCRIPT_DIR=$(pwd -P)
cd $ORIG_DIR
cd "$ORIG_DIR"

This comment has been minimized.

@iwoj

iwoj Apr 19, 2012
Author

This is crucial for installing in directories with spaces.

Ian Wojtowicz added 3 commits Apr 19, 2012
…MAScript Array.forEach and Array.map functions. Their callbacks now both have optional index and traversal object parameters.
…assed to the callback function. It shouldn't affect the self variable.
@AndyMoreland
Copy link

@AndyMoreland AndyMoreland commented Apr 19, 2012

I'm not sure how strict the maintainers of this project are, but personally I'd prefer to see the patches to environment variables separated from the change to forEach.

@iwoj
Copy link
Author

@iwoj iwoj commented Apr 20, 2012

Good point. It's not clear how to submit them separately. How do I do that?

@AndyMoreland
Copy link

@AndyMoreland AndyMoreland commented Apr 20, 2012

My mistake -- I meant the bash variable changes.

edit: also, I completely agree with those changes being applied somehow.

@debergalis
Copy link
Member

@debergalis debergalis commented Apr 24, 2012

I think this is a good idea, with some changes.

1: The API should follow the full ECMA 5 spec for map and forEach:

  • in addition to callback they should both take a second, optional thisArg.
  • they should call callback with three arguments: the document, the index of that document, and the Cursor.
  • inside the callback, this should be bound to thisArg, if provided, otherwise the global object associated w/ callback.

2: The same API should be on the server, as implemented in packages/mongo-livedata/mongo_driver.js.

3: Tests for client and server APIs. (packages/minimongo/minimongo_tests.js and packages/mongo-livedata/mongo_livedata_tests.js).

@debergalis
Copy link
Member

@debergalis debergalis commented Apr 24, 2012

(The patch should be based against devel, not master. When you rebase against devel the diffs to the meteor script will go away -- they've been fixed.)

@iwoj
Copy link
Author

@iwoj iwoj commented Apr 25, 2012

Matt: I attended to #1 and #2. I also rebased my branch, but I'm not sure if I did this correctly.

As for the tests, I'm not sure how your unit test framework functions. Can you point me in the right direction?

@debergalis
Copy link
Member

@debergalis debergalis commented Apr 25, 2012

@holmsand what non-standard behavior do you mean?

@holmsand
Copy link

@holmsand holmsand commented Apr 25, 2012

@debergalis Sorry I was unclear...

But it seems to be quite fundamental in Coffeescript to protect you from accidentally creating global variables (see http://coffeescript.org/#lexical_scope). As far as I know, the "bare" option is mainly aimed at e.g. Node's module loader, that provides it own wrapper anyway.

@debergalis
Copy link
Member

@debergalis debergalis commented Apr 25, 2012

@holmsand I see, you're commenting on a separate change that got added to the pull request from the rebase. #85 (and #33) is a better place for the discussion.

@ghost ghost assigned glasser Sep 7, 2012
@TaraWij
Copy link
Contributor

@TaraWij TaraWij commented Sep 18, 2012

@iwoj: It might help a lot if you were to do the changes again against the current devel branch (not against master), this way you can squash the few amount of changes you have into a single commit as well as making it easier for them to pull in. So, in short:

  1. Pull meteor's devel branch into a new feature branch on your repo.
  2. Manually bring over the changes from this pull request.
  3. Do a pull request against meteor's devel branch.

@debergalis: Why did you refer to those two issues, was that by accident? I don't see how they are relevant.

@debergalis
Copy link
Member

@debergalis debergalis commented Sep 19, 2012

They're not -- I was referring to an earlier comment.

We'd take something close to the rebased patch if the API is tested on both client and server. I didn't see that in the earlier diff.

@n1mmy n1mmy mentioned this pull request Aug 19, 2013
glasser added a commit that referenced this pull request Sep 24, 2013
Fixes #63.

Based on iwoj's PR.

Needs tests and docs.
@glasser glasser closed this in d4d7ebb Sep 28, 2013
matheusccastroo added a commit to matheusccastroo/meteor that referenced this pull request May 17, 2021
This commit adds the "--platforms" flag to meteor build command. This allows the user to specify which platforms he want to build and build it only. For example, if we pass only android to it, we will build only android and web.cordova.

Related to issue meteor#63 (meteor/meteor-feature-requests#63)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants