Skip to content

Commit 31c8e30

Browse files
committed
Adding test matrix entry using core-js/modules/es.error.cause
1 parent b6cced7 commit 31c8e30

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- io.js 3.x
1919
- Node.js 4.x
2020
- Node.js 5.x
21+
- Node.js 5.x with core-js polyfill
2122
- Node.js 6.x
2223
- Node.js 7.x
2324
- Node.js 8.x
@@ -63,6 +64,11 @@ jobs:
6364
node-version: "5.12"
6465
6566

67+
- name: Node.js 5.x with core-js polyfill
68+
node-version: "5.12"
69+
npm-i: browserify@15 [email protected] [email protected] core-js@3
70+
ENABLE_COREJS_ERROR_POLYFILL: true
71+
6672
- name: Node.js 6.x
6773
node-version: "6.17"
6874
@@ -158,6 +164,8 @@ jobs:
158164
159165
- name: Run tests
160166
shell: bash
167+
env:
168+
ENABLE_COREJS_ERROR_POLYFILL: ${{ matrix.ENABLE_COREJS_ERROR_POLYFILL }}
161169
run: |
162170
if npm -ps ls nyc | grep -q nyc; then
163171
npm run test-ci

index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,25 +265,23 @@ function log (message, site) {
265265
*/
266266

267267
function callSiteLocation (callSite) {
268-
var functionName, site
268+
var site
269269
if (callSite) {
270-
functionName = callSite.getFunctionName()
271270
var file = callSite.getFileName() || '<anonymous>'
272271
var line = callSite.getLineNumber()
273272
var colm = callSite.getColumnNumber()
274273
if (callSite.isEval()) {
275274
file = callSite.getEvalOrigin() + ', ' + file
276275
}
277276
site = [file, line, colm]
277+
site.callSite = callSite
278+
site.name = callSite.getFunctionName()
278279
} else {
279-
// eslint-disable-next-line no-param-reassign
280-
callSite = {}
281-
callSite.getThis = function () { return null }
282-
functionName = '<unknown function>'
283280
site = ['<unknown file>', '<unknown line>', '<unknown column>']
281+
site.callSite = {}
282+
site.callSite.getThis = function () { return null }
283+
site.name = '<unknown function>'
284284
}
285-
site.callSite = callSite
286-
site.name = functionName
287285
return site
288286
}
289287

test/test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ var script = path.join(__dirname, 'fixtures', 'script.js')
1010
var spawn = require('child_process').spawn
1111
var strictlib = libs.strict
1212

13+
if (process.env.ENABLE_COREJS_ERROR_POLYFILL) { // cf. PR #48
14+
require('core-js/modules/es.error.cause')
15+
}
16+
1317
describe('depd(namespace)', function () {
1418
it('creates deprecated function', function () {
1519
assert.strictEqual(typeof depd('test'), 'function')

0 commit comments

Comments
 (0)