Skip to content

Commit

Permalink
review eslint core rules: enforce Symbol description
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Aug 18, 2023
1 parent 505f464 commit ad0c6f1
Show file tree
Hide file tree
Showing 119 changed files with 265 additions and 209 deletions.
2 changes: 1 addition & 1 deletion packages/core-js/internals/object-assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = !$assign || fails(function () {
var A = {};
var B = {};
// eslint-disable-next-line es/no-symbol -- safe
var symbol = Symbol();
var symbol = Symbol('assign detection');
var alphabet = 'abcdefghijklmnopqrst';
A[symbol] = 7;
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/symbol-constructor-detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var $String = global.String;

// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
var symbol = Symbol();
var symbol = Symbol('symbol detection');
// Chrome 38 Symbol has incorrect toString conversion
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/es.json.stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var low = /^[\uD800-\uDBFF]$/;
var hi = /^[\uDC00-\uDFFF]$/;

var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
var symbol = getBuiltIn('Symbol')();
var symbol = getBuiltIn('Symbol')('stringify detection');
// MS Edge converts symbol values to JSON as {}
return $stringify([symbol]) !== '[null]'
// WebKit converts symbol values to JSON as null
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/es.symbol.description.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy
SymbolWrapper.prototype = SymbolPrototype;
SymbolPrototype.constructor = SymbolWrapper;

var NATIVE_SYMBOL = String(NativeSymbol('test')) === 'Symbol(test)';
var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
var regexp = /^Symbol\((.*)\)[^)]+$/;
Expand Down
21 changes: 12 additions & 9 deletions tests/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var PROMISE_STATICS_ITERATION = function () {
};

var SYMBOLS_SUPPORT = function () {
return Object.getOwnPropertySymbols && String(Symbol()) && !(V8_VERSION && V8_VERSION < 41);
return Object.getOwnPropertySymbols && String(Symbol('symbol detection')) && !(V8_VERSION && V8_VERSION < 41);
};

var SYMBOL_REGISTRY = [SYMBOLS_SUPPORT, function () {
Expand Down Expand Up @@ -281,18 +281,20 @@ function TIMERS() {
GLOBAL.tests = {
// TODO: Remove this module from `core-js@4` since it's split to modules listed below
'es.symbol': [SYMBOLS_SUPPORT, function () {
var symbol = Symbol('stringify detection');
return Object.getOwnPropertySymbols('qwe')
&& Symbol['for']
&& Symbol.keyFor
&& JSON.stringify([Symbol()]) === '[null]'
&& JSON.stringify({ a: Symbol() }) === '{}'
&& JSON.stringify(Object(Symbol())) === '{}'
&& JSON.stringify([symbol]) === '[null]'
&& JSON.stringify({ a: symbol }) === '{}'
&& JSON.stringify(Object(symbol)) === '{}'
&& Symbol.prototype[Symbol.toPrimitive]
&& Symbol.prototype[Symbol.toStringTag];
}],
'es.symbol.constructor': SYMBOLS_SUPPORT,
'es.symbol.description': function () {
return Symbol('foo').description === 'foo' && Symbol().description === undefined;
// eslint-disable-next-line symbol-description -- required for testing
return Symbol('description detection').description === 'description detection' && Symbol().description === undefined;
},
'es.symbol.async-iterator': function () {
return Symbol.asyncIterator;
Expand Down Expand Up @@ -663,9 +665,10 @@ GLOBAL.tests = {
return globalThis;
},
'es.json.stringify': [SYMBOLS_SUPPORT, function () {
return JSON.stringify([Symbol()]) === '[null]'
&& JSON.stringify({ a: Symbol() }) === '{}'
&& JSON.stringify(Object(Symbol())) === '{}'
var symbol = Symbol('stringify detection');
return JSON.stringify([symbol]) === '[null]'
&& JSON.stringify({ a: symbol }) === '{}'
&& JSON.stringify(Object(symbol)) === '{}'
&& JSON.stringify('\uDF06\uD834') === '"\\udf06\\ud834"'
&& JSON.stringify('\uDEAD') === '"\\udead"';
}],
Expand Down Expand Up @@ -836,7 +839,7 @@ GLOBAL.tests = {
}), { b: 2 })).b !== 1) return false;
var A = {};
var B = {};
var symbol = Symbol();
var symbol = Symbol('assign detection');
var alphabet = 'abcdefghijklmnopqrst';
A[symbol] = 7;
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
Expand Down
2 changes: 1 addition & 1 deletion tests/entries/unit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for (PATH of ['core-js-pure', 'core-js']) {
ok(load(NS, 'object/freeze')({}));
ok(load(NS, 'object/get-own-property-descriptor')({ q: 1 }, 'q').enumerable);
ok(load(NS, 'object/get-own-property-names')({ q: 42 })[0] === 'q');
ok(load(NS, 'object/get-own-property-symbols')({ [Symbol()]: 42 }).length === 1);
ok(load(NS, 'object/get-own-property-symbols')({ [Symbol('getOwnPropertySymbols test')]: 42 }).length === 1);
ok(load(NS, 'object/get-prototype-of')([]) === Array.prototype);
ok(load(NS, 'object/has-own')({ foo: 42 }, 'foo'));
ok(load(NS, 'object/is')(NaN, NaN));
Expand Down
2 changes: 2 additions & 0 deletions tests/eslint/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ const base = {
}],
// require strict mode directives
strict: [ERROR, 'global'],
// require symbol descriptions
'symbol-description': ERROR,
// disallow "Yoda" conditions
yoda: [ERROR, NEVER],

Expand Down
2 changes: 1 addition & 1 deletion tests/unit-global/es.aggregate-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ QUnit.test('AggregateError', assert => {
assert.same(AggregateError([1], 123).message, '123');
assert.same(AggregateError([1]).message, '');
assert.deepEqual(AggregateError([1, 2, 3]).errors, [1, 2, 3]);
assert.throws(() => AggregateError([1], Symbol()), 'throws on symbol as a message');
assert.throws(() => AggregateError([1], Symbol('AggregateError test')), 'throws on symbol as a message');
assert.same(({}).toString.call(AggregateError([1])), '[object Error]', 'Object#toString');

assert.same(AggregateError.prototype.constructor, AggregateError, 'prototype constructor');
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-global/es.escape.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ QUnit.test('escape', assert => {
assert.same(escape(undefined), 'undefined');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => unescape(Symbol()), 'throws on symbol argument');
assert.throws(() => unescape(Symbol('escape test')), 'throws on symbol argument');
}
});
21 changes: 12 additions & 9 deletions tests/unit-global/es.json.stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if (GLOBAL.JSON?.stringify) {
assert.same(stringify(obj4, null), json1, 'replacer-wrong-type-4');
assert.same(stringify(obj4, ''), json1, 'replacer-wrong-type-5');
assert.same(stringify(obj4, 0), json1, 'replacer-wrong-type-6');
assert.same(stringify(obj4, Symbol()), json1, 'replacer-wrong-type-7');
assert.same(stringify(obj4, Symbol('stringify replacer test')), json1, 'replacer-wrong-type-7');
assert.same(stringify(obj4, true), json1, 'replacer-wrong-type-8');

const obj5 = {
Expand Down Expand Up @@ -208,7 +208,7 @@ if (GLOBAL.JSON?.stringify) {
assert.same(stringify(obj5), stringify(obj5, null, null), 'space-wrong-type-1');
assert.same(stringify(obj5), stringify(obj5, null, true), 'space-wrong-type-2');
assert.same(stringify(obj5), stringify(obj5, null, new Boolean(false)), 'space-wrong-type-3');
assert.same(stringify(obj5), stringify(obj5, null, Symbol()), 'space-wrong-type-4');
assert.same(stringify(obj5), stringify(obj5, null, Symbol('stringify space test')), 'space-wrong-type-4');
assert.same(stringify(obj5), stringify(obj5, null, {}), 'space-wrong-type-5');

const direct2 = [];
Expand Down Expand Up @@ -486,24 +486,27 @@ if (GLOBAL.JSON?.stringify) {
QUnit.test('Symbols & JSON.stringify', assert => {
const { stringify } = JSON;

const symbol1 = Symbol('symbol & stringify test 1');
const symbol2 = Symbol('symbol & stringify test 2');

assert.same(stringify([
1,
Symbol('foo'),
symbol1,
false,
Symbol('bar'),
symbol2,
{},
]), '[1,null,false,null,{}]', 'array value');
assert.same(stringify({
symbol: Symbol('symbol'),
symbol: symbol1,
}), '{}', 'object value');
if (DESCRIPTORS) {
const object = { bar: 2 };
object[Symbol('symbol')] = 1;
object[symbol1] = 1;
assert.same(stringify(object), '{"bar":2}', 'object key');
}
assert.same(stringify(Symbol('symbol')), undefined, 'symbol value');
if (typeof Symbol() == 'symbol') {
assert.same(stringify(Object(Symbol('symbol'))), '{}', 'boxed symbol');
assert.same(stringify(symbol1), undefined, 'symbol value');
if (typeof symbol1 == 'symbol') {
assert.same(stringify(Object(symbol1)), '{}', 'boxed symbol');
}
assert.same(stringify(undefined, () => 42), '42', 'replacer works with top-level undefined');
});
Expand Down
5 changes: 3 additions & 2 deletions tests/unit-global/es.number.constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ QUnit.test('Number constructor: regression', assert => {
}), TypeError, 'new Number assert.throws on object then valueOf and toString are not functions');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => Number(Symbol()), 'throws on symbol argument');
assert.throws(() => new Number(Symbol()), 'throws on symbol argument, new');
const symbol = Symbol('Number constructor test');
assert.throws(() => Number(symbol), 'throws on symbol argument');
assert.throws(() => new Number(symbol), 'throws on symbol argument, new');
}

number = new Number(42);
Expand Down
5 changes: 3 additions & 2 deletions tests/unit-global/es.number.parse-float.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ QUnit.test('Number.parseFloat', assert => {
assert.same(parseFloat(undefined), NaN);

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => parseFloat(Symbol()), 'throws on symbol argument');
assert.throws(() => parseFloat(Object(Symbol())), 'throws on boxed symbol argument');
const symbol = Symbol('Number.parseFloat test');
assert.throws(() => parseFloat(symbol), 'throws on symbol argument');
assert.throws(() => parseFloat(Object(symbol)), 'throws on boxed symbol argument');
}
});
5 changes: 3 additions & 2 deletions tests/unit-global/es.number.parse-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ QUnit.test('Number.parseInt', assert => {
assert.same(parseInt(undefined), NaN);

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => parseInt(Symbol()), 'throws on symbol argument');
assert.throws(() => parseInt(Object(Symbol())), 'throws on boxed symbol argument');
const symbol = Symbol('Number.parseInt test');
assert.throws(() => parseInt(symbol), 'throws on symbol argument');
assert.throws(() => parseInt(Object(symbol)), 'throws on boxed symbol argument');
}
});
6 changes: 3 additions & 3 deletions tests/unit-global/es.object.get-own-property-symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ QUnit.test('Object.getOwnPropertySymbols', assert => {
assert.name(getOwnPropertySymbols, 'getOwnPropertySymbols');
assert.looksNative(getOwnPropertySymbols);
const prototype = { q: 1, w: 2, e: 3 };
prototype[Symbol()] = 42;
prototype[Symbol()] = 43;
prototype[Symbol('getOwnPropertySymbols test 1')] = 42;
prototype[Symbol('getOwnPropertySymbols test 2')] = 43;
assert.deepEqual(getOwnPropertyNames(prototype).sort(), ['e', 'q', 'w']);
assert.same(getOwnPropertySymbols(prototype).length, 2);
const object = create(prototype);
object.a = 1;
object.s = 2;
object.d = 3;
object[Symbol()] = 44;
object[Symbol('getOwnPropertySymbols test 3')] = 44;
assert.deepEqual(getOwnPropertyNames(object).sort(), ['a', 'd', 's']);
assert.same(getOwnPropertySymbols(object).length, 1);
assert.same(getOwnPropertySymbols(Object.prototype).length, 0);
Expand Down
5 changes: 3 additions & 2 deletions tests/unit-global/es.parse-float.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ QUnit.test('parseFloat', assert => {
assert.same(parseFloat(undefined), NaN);

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => parseFloat(Symbol()), 'throws on symbol argument');
assert.throws(() => parseFloat(Object(Symbol())), 'throws on boxed symbol argument');
const symbol = Symbol('parseFloat test');
assert.throws(() => parseFloat(symbol), 'throws on symbol argument');
assert.throws(() => parseFloat(Object(symbol)), 'throws on boxed symbol argument');
}
});
5 changes: 3 additions & 2 deletions tests/unit-global/es.parse-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ QUnit.test('parseInt', assert => {
assert.same(parseInt(undefined), NaN);

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => parseInt(Symbol()), 'throws on symbol argument');
assert.throws(() => parseInt(Object(Symbol())), 'throws on boxed symbol argument');
const symbol = Symbol('parseInt test');
assert.throws(() => parseInt(symbol), 'throws on symbol argument');
assert.throws(() => parseInt(Object(symbol)), 'throws on boxed symbol argument');
}
});

2 changes: 1 addition & 1 deletion tests/unit-global/es.regexp.exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ QUnit.test('RegExp#exec capturing groups', assert => {

if (DESCRIPTORS) {
QUnit.test('RegExp#exec regression', assert => {
assert.throws(() => /l/.exec(Symbol()), 'throws on symbol argument');
assert.throws(() => /l/.exec(Symbol('RegExp#exec test')), 'throws on symbol argument');
});

QUnit.test('RegExp#exec sticky', assert => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-global/es.regexp.to-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ QUnit.test('RegExp#toString', assert => {
}

assert.throws(() => toString.call({
source: Symbol(),
source: Symbol('RegExp#toString test'),
flags: 'g',
}), 'throws on symbol');
});
5 changes: 3 additions & 2 deletions tests/unit-global/es.string.anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ QUnit.test('String#anchor', assert => {
assert.same('a'.anchor('"'), '<a name="&quot;">a</a>', 'escape quotes');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => anchor.call(Symbol(), 'b'), 'throws on symbol context');
assert.throws(() => anchor.call('a', Symbol()), 'throws on symbol argument');
const symbol = Symbol('anchor test');
assert.throws(() => anchor.call(symbol, 'b'), 'throws on symbol context');
assert.throws(() => anchor.call('a', symbol), 'throws on symbol argument');
}
});
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.at-alternative.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ QUnit.test('String#at', assert => {
// assert.same('\uD842', '𠮷'.at());
assert.same('1', at.call({ toString() { return '123'; } }, 0));

assert.throws(() => at.call(Symbol(), 0), 'throws on symbol context');
assert.throws(() => at.call(Symbol('at-alternative test'), 0), 'throws on symbol context');

if (STRICT) {
assert.throws(() => at.call(null, 0), TypeError);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.big.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ QUnit.test('String#big', assert => {
assert.same('a'.big(), '<big>a</big>', 'lower case');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => big.call(Symbol()), 'throws on symbol context');
assert.throws(() => big.call(Symbol('big test')), 'throws on symbol context');
}
});
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.blink.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ QUnit.test('String#blink', assert => {
assert.same('a'.blink(), '<blink>a</blink>', 'lower case');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => blink.call(Symbol()), 'throws on symbol context');
assert.throws(() => blink.call(Symbol('blink test')), 'throws on symbol context');
}
});
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.bold.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ QUnit.test('String#bold', assert => {
assert.same('a'.bold(), '<b>a</b>', 'lower case');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => bold.call(Symbol()), 'throws on symbol context');
assert.throws(() => bold.call(Symbol('bold test')), 'throws on symbol context');
}
});
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.code-point-at.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ QUnit.test('String#codePointAt', assert => {
assert.same('\uDF06abc'.codePointAt(undefined), 0xDF06);

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => codePointAt.call(Symbol(), 1), 'throws on symbol context');
assert.throws(() => codePointAt.call(Symbol('codePointAt test'), 1), 'throws on symbol context');
}

if (STRICT) {
Expand Down
5 changes: 3 additions & 2 deletions tests/unit-global/es.string.ends-with.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ QUnit.test('String#endsWith', assert => {
assert.false('abc'.endsWith('a', 'x'));

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => endsWith.call(Symbol(), 'b'), 'throws on symbol context');
assert.throws(() => endsWith.call('a', Symbol()), 'throws on symbol argument');
const symbol = Symbol('endsWith test');
assert.throws(() => endsWith.call(symbol, 'b'), 'throws on symbol context');
assert.throws(() => endsWith.call('a', symbol), 'throws on symbol argument');
}

if (STRICT) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.fixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ QUnit.test('String#fixed', assert => {
assert.same('a'.fixed(), '<tt>a</tt>', 'lower case');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => fixed.call(Symbol()), 'throws on symbol context');
assert.throws(() => fixed.call(Symbol('fixed test')), 'throws on symbol context');
}
});
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.fontcolor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ QUnit.test('String#fontcolor', assert => {
assert.same('a'.fontcolor('"'), '<font color="&quot;">a</font>', 'escape quotes');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => fontcolor.call(Symbol()), 'throws on symbol context');
assert.throws(() => fontcolor.call(Symbol('fontcolor test')), 'throws on symbol context');
}
});
5 changes: 3 additions & 2 deletions tests/unit-global/es.string.fontsize.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ QUnit.test('String#fontsize', assert => {
assert.same('a'.fontsize('"'), '<font size="&quot;">a</font>', 'escape quotes');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => fontsize.call(Symbol(), 'b'), 'throws on symbol context');
assert.throws(() => fontsize.call('a', Symbol()), 'throws on symbol argument');
const symbol = Symbol('fontsize test');
assert.throws(() => fontsize.call(symbol, 'b'), 'throws on symbol context');
assert.throws(() => fontsize.call('a', symbol), 'throws on symbol argument');
}
});
5 changes: 3 additions & 2 deletions tests/unit-global/es.string.includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ QUnit.test('String#includes', assert => {
assert.false('abcd'.includes('b', 2));

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => includes.call(Symbol(), 'b'), 'throws on symbol context');
assert.throws(() => includes.call('a', Symbol()), 'throws on symbol argument');
const symbol = Symbol('includes test');
assert.throws(() => includes.call(symbol, 'b'), 'throws on symbol context');
assert.throws(() => includes.call('a', symbol), 'throws on symbol argument');
}

if (STRICT) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.is-well-formed.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ QUnit.test('String#isWellFormed', assert => {
assert.throws(() => isWellFormed.call(undefined), TypeError, 'coercible #2');
}

assert.throws(() => isWellFormed.call(Symbol()), 'throws on symbol context');
assert.throws(() => isWellFormed.call(Symbol('isWellFormed test')), 'throws on symbol context');
});
2 changes: 1 addition & 1 deletion tests/unit-global/es.string.italics.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ QUnit.test('String#italics', assert => {
assert.same('a'.italics(), '<i>a</i>', 'lower case');

if (typeof Symbol == 'function' && !Symbol.sham) {
assert.throws(() => italics.call(Symbol()), 'throws on symbol context');
assert.throws(() => italics.call(Symbol('italics test')), 'throws on symbol context');
}
});

0 comments on commit ad0c6f1

Please sign in to comment.