Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

rename loggedInEmail to loggedInUser with backcompat support. issue #18... #1806

Merged
merged 2 commits into from

4 participants

@lloyd

...05

resources/static/include_js/include.js
@@ -1027,13 +1027,25 @@
_open_hidden_iframe();
+ // back compat support for loggedInEmail
+ if (typeof options.loggedInEmail !== 'undefined' &&
+ typeof options.loggedInUser !== 'undefined')
+ {
+ throw "you cannot supply *both* loggedInEmail and loggedInUser";
+ }
+ else if(typeof options.loggedInEmail !== 'undefined')
+ {
+ options.loggedInUser = options.loggedInEmail;
+ delete options.loggedInEmail;
+ }
@callahad Owner

Looks good! Pedantry -- shouldn't this be using same-line curly braces to match the rest of this file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@callahad
Owner

Should we add a unit test for this? Otherwise, r+.

@benadida

@callahad is right, we need tests, I guess this means we wait until early next week to merge, that's probably ok.

@lloyd

oh damn. This means we can't really call the .watch() api stable when we roll 2012.06.22 on july 4th.

@shane-tomlinson shane-tomlinson merged commit d3b9a1f into dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 2 deletions.
  1. +18 −2 resources/static/include_js/include.js
View
20 resources/static/include_js/include.js
@@ -1027,13 +1027,29 @@
_open_hidden_iframe();
+ // back compat support for loggedInEmail
+ if (typeof options.loggedInEmail !== 'undefined' &&
+ typeof options.loggedInUser !== 'undefined') {
+ throw "you cannot supply *both* loggedInEmail and loggedInUser";
+ }
+ else if(typeof options.loggedInEmail !== 'undefined') {
+ try {
+ console.log("loggedInEmail has been deprecated");
+ } catch(e) {
+ /* ignore error */
+ }
+
+ options.loggedInUser = options.loggedInEmail;
+ delete options.loggedInEmail;
+ }
+
// check that the commChan was properly initialized before interacting with it.
// on unsupported browsers commChan might still be undefined, in which case
// we let the dialog display the "unsupported browser" message upon spawning.
- if (typeof options.loggedInEmail !== 'undefined' && commChan) {
+ if (typeof options.loggedInUser !== 'undefined' && commChan) {
commChan.notify({
method: 'loggedInUser',
- params: options.loggedInEmail
+ params: options.loggedInUser
});
}
}
Something went wrong with that request. Please try again.