Commit Graph

1816 Commits

Author SHA1 Message Date
Andrew Wilcox
6873c91424 Allow CoffeeScript to set global vars when using "use strict".
Ha.  Turns out that `.call(this)` is needed after all when a
CoffeeScript file is using "use strict".
(http://es5.github.io/#x15.3.4.4)

Thanks to pipedreambomb on stackoverflow for the bug report and to
user1737909 for the documentation reference.
2013-04-15 10:52:01 -07:00
Nick Martin
93a6fafc3b Merge branch 'code-cleanup' into devel 2013-04-15 10:50:14 -07:00
Nick Martin
274f7e35b2 Comment on issue #828 2013-04-15 10:49:51 -07:00
Nick Martin
28f9061555 Oops, missed a spot. 2013-04-15 10:48:42 -07:00
Nick Martin
778afd112d Remove unused requires. 2013-04-15 10:48:42 -07:00
Nick Martin
9ca82daabb Simplify code using new reactive 'ready' function on subscription handles. 2013-04-15 10:48:42 -07:00
Nick Martin
1a340917e8 Reorganize and cleanup code.
- consistent ordering
- lots more comments
- whitespace fixups

Cleanup part 2. More comments and reordering.
2013-04-15 10:48:42 -07:00
Nick Martin
b9873f1c92 Remove partial fix for connecting back to self in environments where absoluteUrl doesn't match.
There were more places where this change would be needed, and it was kinda ugly to try to share the code. Having absoluteUrl be where we are reachable is a requirement for testing OAuth flow anyway, having it required for automated testing isn't so bad.

This is typically only a problem when testing on local windows VMs. In this case, you can work around the issue by editing `C:\Windows\System32\drivers\etc\hosts` to include '10.0.2.2  localhost`.

(And yes, I know this code was my idea in the first place. I was wrong.)
2013-04-14 23:23:47 -07:00
Nick Martin
c1f1329101 Fix templating tests on IE8 2013-04-14 23:16:15 -07:00
Avital Oliver
cbadead8c7 accounts-weibo: make sure uid indeed parses to an integer 2013-04-14 00:29:53 -07:00
Avital Oliver
17246ff23d Weibo user ids are strings again 2013-04-13 20:39:55 -07:00
Avital Oliver
a9272a6cbf Significantly improve error with misconfigured OAuth services
- We now rethrow any errors, which means we get a proper stack trace,
  rather than it seemingly coming from within a callback in the http package
- The error thrown contains the response body which typically contains
  helpful information
2013-04-13 20:16:28 -07:00
Avital Oliver
ee03cfc1f8 Remove confusing dot 2013-04-13 20:16:28 -07:00
Avital Oliver
66d4bbc428 Include HTTP error code in Meteor.http error message 2013-04-13 20:16:28 -07:00
David Greenspan
7a05b7f1a4 remove unused var 2013-04-12 13:58:01 -07:00
David Glasser
168433beac Follow-up to d098b99b: make it work. 2013-04-12 13:21:31 -07:00
David Glasser
d098b99bd8 Avoid log spam on deployed apps from websocket unless you're actually using
server-to-server DDP.
2013-04-12 10:56:52 -07:00
David Glasser
d1dd8a8e4d Refactor Avi's improved Meteor.Error to make it possible to use for other Error
subclasses.
2013-04-11 17:11:45 -07:00
Naomi Seyfer
654923abae cleaning up server to server connection tests 2013-04-11 16:03:23 -07:00
Avital Oliver
9b2b6f219d Expose Meteor.Error stack traces when thrown from method stubs in Firefox 2013-04-11 15:56:06 -07:00
Avital Oliver
8350f52b9d Improve Meteor.Error
- Capture stack traces on server (Meteor.Error objects are only created on the client, not thrown)
- Set a message
- Improve inheritence pattern

Before: (note that the stack trace shows the line in which Meteor.Error is defined, not where it got thrown)
===
- exception - message
Error
    at app/packages/livedata/livedata_common.js:143:26
    at /private/var/folders/tp/sc9b5w7n2qndz3chpmktwy_w0000gn/T/meteor-test-runikymph/.meteor/local/build/server/server.js:282:7
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/avital/meteor/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    at run (/private/var/folders/tp/sc9b5w7n2qndz3chpmktwy_w0000gn/T/meteor-test-runikymph/.meteor/local/build/server/server.js:227:7)

After:
===
- exception - message User validation failed [403]
Error: User validation failed [403]
    at app/packages/accounts-base/accounts_server.js:164:13
    at Array.forEach (native)
    at Function._.each._.forEach (app/packages/underscore/underscore.js:79:11)
    at Object.Accounts.insertUserDoc (app/packages/accounts-base/accounts_server.js:162:5)
    at Object.Accounts.updateOrCreateUserFromExternalService (app/packages/accounts-base/accounts_server.js:264:21)
    at null.func (app/packages/accounts-base/accounts_tests.js:18:28)
    at app/packages/tinytest/tinytest.js:299:16
    at app/packages/meteor/timers.js:54:36
    at _.extend.withValue (app/packages/meteor/dynamics_nodejs.js:31:17)
    at f (app/packages/meteor/timers.js:12:51)
2013-04-10 21:20:31 -07:00
Tim Haines
0ba549d403 Fix comment typo 2013-04-09 17:15:35 -07:00
David Glasser
308395da46 Spiderable.userAgentRegExps can now be modified to change what user agents are
treated as spiders by the spiderable package.
2013-04-09 16:03:57 -07:00
Joshua Conner
a3a75e3961 Bump d3 to version 3.1.4 2013-04-09 15:57:00 -07:00
Naomi Seyfer
6414dd4e6f Fixing comment about stubs not yielding to be more accurate 2013-04-09 15:51:12 -07:00
Naomi Seyfer
6ca49a6d03 glasser asked for a comment 2013-04-09 15:41:20 -07:00
Naomi Seyfer
9a9e614333 Fix console error message about unexpected add on test refresh
* Give each testMulti a context that you can store test-local information on, as
js 'this'
* Also wrap stubs on the server in _noYieldsAllowed
2013-04-09 15:38:05 -07:00
jacott
757cc15c47 Return doc._id from minimongo LocalCollection.prototype.insert. Fixes issue #906 2013-04-09 15:13:46 -07:00
andreas.karlsson
72abc7af92 Defensively copy arguments to observe callbacks 2013-04-09 14:23:52 -07:00
andreas.karlsson
eb982e7566 Added test to assert observe callbacks can't manipulate data 2013-04-09 14:23:52 -07:00
Naomi Seyfer
0a3146d88d nim comments the last 2013-04-09 11:56:22 -07:00
Naomi Seyfer
fe6f40774d Move a constant only applicable to the sockjs version 2013-04-08 18:39:17 -07:00
Naomi Seyfer
0fde3825e3 Now block on the result of a .call on the server if no callback is passed 2013-04-08 17:58:36 -07:00
Naomi Seyfer
7112a8eb4b Test for minimongo on the server 2013-04-08 17:58:36 -07:00
Naomi Seyfer
cb92684e50 All livedate_connection tests pass on the server now 2013-04-08 17:58:36 -07:00
Naomi Seyfer
272710b1a8 Cleaning up duplicated code 2013-04-08 17:58:35 -07:00
Naomi Seyfer
e2ac47b451 Share URL-munging code
Still to do:

* Share more code
* Deal with this error:
    Uncaught Error: INVALID_STATE_ERR sockjs-0.3.4.js:1054
    SockJS._didClose sockjs-0.3.4.js:1054
    (anonymous function) sockjs-0.3.4.js:1330
    xo.onfinish sockjs-0.3.4.js:1412
    EventEmitter.emit sockjs-0.3.4.js:150
    that.xhr.onreadystatechange
2013-04-08 17:58:35 -07:00
Naomi Seyfer
0fbb20e9be Meteor.connect to ourself as a server now works. Code still needs some cleaning up 2013-04-08 17:58:35 -07:00
Geoff Schmidt
993b361b17 rename _StreamServer -> _DdpStreamServer, _Stream -> DdpClientStream 2013-04-08 17:58:35 -07:00
Geoff Schmidt
07af6a4243 livedata_connection: don't assume that 'reload' package is available 2013-04-08 17:58:35 -07:00
Geoff Schmidt
2bcd692b54 livedata: if client_convenience.js is loaded "on the server" (not normally possible in the usual build scenario, but would be the case of a nodejs-based client, eg, a command-line tool), don't try to open a default DDP connection 2013-04-08 17:58:35 -07:00
Geoff Schmidt
71dd67b90d Bring over stream_client_nodejs from starseed branch. Manually merge changes that have accumulated in stream_client_sockjs since starseed forked off. 2013-04-08 17:58:35 -07:00
Geoff Schmidt
e710338a94 rename file stream_client -> stream_client_sockjs 2013-04-08 17:58:35 -07:00
Geoff Schmidt
438bd6f694 Fold stream package into livedata 2013-04-08 17:58:35 -07:00
Avital Oliver
af89ff5000 Allow ROOT_URL to not contain http:// 2013-04-08 14:47:25 -07:00
Andrew Wilcox
c786d24834 Fix routepolicy checkUrlPrefix
Found because I happened to be looking at the linker output and
thinking, "um, why is `type` being declared as a package-scope
variable?"  :-)

Added checkUrlPrefix unit test.
2013-04-05 23:10:52 -07:00
Naomi Seyfer
c44c092e39 All npm-shrinkwrap resolutions; checking them in 2013-04-04 14:22:04 -07:00
David Glasser
d87a6384e1 Merge branch 'master' into devel 2013-04-04 12:11:55 -07:00
David Glasser
643f5fac05 Ensure that tarballs do not contain hard links.
Make whitespace changes to tools and mongo-livedata so that we will build new
package versions with non-hard-linked Node plugins.
2013-04-03 21:14:25 -07:00
David Glasser
7d5c1d72cd Allow Opera's slightly-bad test result for minimongo-modify to pass. 2013-04-03 13:29:09 -07:00