Skip to content

Commit

Permalink
Drop official node v4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns committed Apr 9, 2018
1 parent 13cb24e commit e9437cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,6 +1,5 @@
language: node_js
node_js:
- "4"
- "6"
- "8"
- "9"
Expand Down
25 changes: 20 additions & 5 deletions testLib/sharedTestCases.js
Expand Up @@ -13,6 +13,23 @@ var expect = require("expect.js"),
__get__Src = require("../lib/__get__.js").toString(),
__with__Src = require("../lib/__with__.js").toString();

var supportsObjectSpread = (function () {
try {
eval("({...{}})");
return true;
} catch (err) {
return false;
}
})();
var supportsObjectRest = (function () {
try {
eval("const {...a} = {}");
return true;
} catch (err) {
return false;
}
})();

function checkForTypeError(err) {
expect(err.constructor).to.be(TypeError);
}
Expand Down Expand Up @@ -232,11 +249,11 @@ module.exports = function () {
rewire("./sealedObject.js"); // should not throw
});

it("should not be a problem to have a module that uses object spread operator", function () {
(supportsObjectSpread ? it : it.skip)("should not be a problem to have a module that uses object spread operator", function () {
rewire("./objectSpreadOperator.js"); // should not throw
});

it("should not be a problem to have a module that uses object rest operator", function () {
(supportsObjectRest ? it : it.skip)("should not be a problem to have a module that uses object rest operator", function () {
rewire("./objectRestOperator.js"); // should not throw
});

Expand All @@ -263,9 +280,7 @@ module.exports = function () {
try {
throwError();
} catch (err) {
if (err.stack) {
expect(err.stack.split("\n")[1]).to.match(/:6:26/);
}
expect(err.stack.split("\n")[1]).to.match(/:6:26/);
}
});

Expand Down

0 comments on commit e9437cc

Please sign in to comment.