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

[fixed] Strict mode error #29

Merged
merged 11 commits into from
Sep 14, 2015
Merged

Conversation

grncdr
Copy link
Contributor

@grncdr grncdr commented Sep 1, 2015

Function declarations inside blocks is an error in strict mode. Certain versions of V8 actually notice this and throw an error.

/cc @elblivion

Function declarations inside blocks is an error in strict mode. Certain versions of V8 actually notice this and throw an error.
@grncdr
Copy link
Contributor Author

grncdr commented Sep 1, 2015

Based on these two fixes, I think that tests are not running at all...

@grncdr grncdr force-pushed the fix/strict-mode-function-declaration branch from e8e488a to c4b9628 Compare September 1, 2015 11:53
@grncdr grncdr force-pushed the fix/strict-mode-function-declaration branch from c4b9628 to a0e9196 Compare September 1, 2015 11:55
@elblivion
Copy link

Seems happier now, thanks! Now I'm getting this which is probably unrelated - don't know where this tap function is supposed to come from:

/Users/stanton/Code/contentful-management.js/example/clone-space.js:73
      .tap(logSummary)
       ^
TypeError: undefined is not a function

https://github.com/contentful/contentful-management.js/blob/master/example/clone-space.js#L73

@sdepold
Copy link
Contributor

sdepold commented Sep 2, 2015

It would come from Bluebird which we aren't using anymore.

@elblivion
Copy link

In any case it's the getSpace doesn't seem to be working, I added some debug and it doesn't throw an error for a nonexistent space:

console.log('Getting source Space %s from %s using access token %s', sourceSpaceId, host, accessToken);
client.getSpace(sourceSpaceId)
      .catch(reportInvalidSpace);
//      .then(getDestinationSpace)
//      .tap(logSummary)
//      .spread(clone)
      //.done();
$ bash wrapper
Getting source Space obviouslyfake from api.contentful.com using access token <snip>
$ echo $?
0

The tests weren't verifying return values of the rate-limited functions. Turns
out that return values were being swallowed.
@@ -193,6 +196,9 @@ function clone (sourceSpace, destinationSpace) {
});
}

function tap$ (fn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that can be removed
On 2 Sep 2015 12:26 pm, "Sascha Depold" notifications@github.com wrote:

In example/clone-space.js
#29 (comment)
:

@@ -193,6 +196,9 @@ function clone (sourceSpace, destinationSpace) {
});
}

+function tap$ (fn) {

not needed I guess?


Reply to this email directly or view it on GitHub
https://github.com/contentful/contentful-management.js/pull/29/files#r38517615
.

@grncdr grncdr force-pushed the fix/strict-mode-function-declaration branch from c6c9439 to 5e21191 Compare September 2, 2015 12:12
The CI config for testem was only running buster-test for Node testing.
Unfortunately, that arrangement masks errors in the test setup, so that
you get green builds even when the tests fail to start.
@grncdr grncdr force-pushed the fix/strict-mode-function-declaration branch from 1e47bff to 763535c Compare September 11, 2015 12:41
@grncdr
Copy link
Contributor Author

grncdr commented Sep 14, 2015

The last test run was an actual test run. There are still some issues with the test running (builds may not fail correctly) so be careful when merging PRs in the future.

trodrigues added a commit that referenced this pull request Sep 14, 2015
@trodrigues trodrigues merged commit 35867cb into master Sep 14, 2015
@trodrigues trodrigues deleted the fix/strict-mode-function-declaration branch September 14, 2015 10:53
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.

None yet

5 participants