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

core: preserve all class members #845

Merged
merged 1 commit into from
Sep 8, 2015
Merged

core: preserve all class members #845

merged 1 commit into from
Sep 8, 2015

Conversation

callmehiphop
Copy link
Contributor

Closes #844

Unit tests need to be updated to accommodate this change, but I wanted to get some feedback before I attempted to tackle that.

I ran the system tests locally and only received a single failure for an after all hook (might be unrelated) -- so this implementation should work.

// @stephenplusplus

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 2, 2015
@callmehiphop
Copy link
Contributor Author

Also might be worth mentioning that in order for this to work moving foward all our classes would have to follow the pattern..

function Class() {
  if (!(this instanceof Class)) {
    return new Class();
  }
}

@stephenplusplus
Copy link
Contributor

It looks good to me! Can we maybe wrap consistent instantiation stuff into one method? (Example to follow)

if (this.config_) {
options = util.extendGlobalConfig(this.config_, options);
}

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -96,15 +96,10 @@ var SCOPES = ['https://www.googleapis.com/auth/bigquery'];
*/
function BigQuery(options) {
if (!(this instanceof BigQuery)) {
options = util.normalizeArguments(this, options);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

stephenplusplus added a commit that referenced this pull request Sep 8, 2015
@stephenplusplus stephenplusplus merged commit d831777 into googleapis:master Sep 8, 2015
@stephenplusplus
Copy link
Contributor

Woo! Bravo on this solution :)

sofisl pushed a commit that referenced this pull request Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants