Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

Comments

Node >= 4 compatibility.#20

Merged
n1k0 merged 4 commits intomasterfrom
node-4+
May 2, 2016
Merged

Node >= 4 compatibility.#20
n1k0 merged 4 commits intomasterfrom
node-4+

Conversation

@n1k0
Copy link
Owner

@n1k0 n1k0 commented May 2, 2016

Promise default rejection handling strategy seems to have been updated in recent nodejs versions. This patch updates the code accordingly.

@n1k0
Copy link
Owner Author

n1k0 commented May 2, 2016

../node_modules/nan/nan.h:43:3: error: #error This version of node/NAN/v8 requires a C++11 compiler

What a freaking Travis mess.

@n1k0
Copy link
Owner Author

n1k0 commented May 2, 2016

Seems related to brianmcd/contextify#180, which is marked as resolved. What a mess.

@n1k0 n1k0 force-pushed the node-4+ branch 2 times, most recently from 534e4d7 to 976ee2d Compare May 2, 2016 08:08
scrape(url, {userAgent: userAgent})
.catch(handleError)
.then(function(result) {
res.json(sanitize ? sanitizeResult(result) : result);
Copy link
Collaborator

Choose a reason for hiding this comment

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

resullt can be undefined when the scrape() fails, since handleError() returns nothing

Copy link
Owner Author

Choose a reason for hiding this comment

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

Hence the .catch next, but yeah I do see your point.

@n1k0
Copy link
Owner Author

n1k0 commented May 2, 2016

@n1k0 n1k0 merged commit 8630652 into master May 2, 2016
@n1k0 n1k0 deleted the node-4+ branch May 2, 2016 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants