Skip to content

Commit cc94786

Browse files
committed
[Tests] use has-strict-mode
1 parent c81457f commit cc94786

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"define-properties": "^1.2.1",
4545
"function-bind": "^1.1.2",
4646
"functions-have-names": "^1.2.3",
47+
"has-strict-mode": "^1.0.1",
4748
"istanbul": "^0.4.5",
4849
"tape": "^5.9.0"
4950
}

tests/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var supportsStrictMode = require('has-strict-mode')();
4+
35
module.exports = function (codePointAt, t) {
46
t.test('String that starts with a BMP symbol', function (st) {
57
st.equal(codePointAt('abc\uD834\uDF06def', -1), undefined);
@@ -82,8 +84,6 @@ module.exports = function (codePointAt, t) {
8284
st.end();
8385
});
8486

85-
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
86-
8787
t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) {
8888
st['throws'](function () { return codePointAt(undefined, 'a'); }, TypeError, 'undefined is not an object');
8989
st['throws'](function () { return codePointAt(null, 'a'); }, TypeError, 'null is not an object');

0 commit comments

Comments
 (0)