File: es.escape.js

package info (click to toggle)
node-core-js 3.33.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,828 kB
  • sloc: javascript: 87,204; makefile: 13
file content (13 lines) | stat: -rw-r--r-- 432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
QUnit.test('escape', assert => {
  assert.isFunction(escape);
  assert.name(escape, 'escape');
  assert.arity(escape, 1);
  assert.looksNative(escape);
  assert.same(escape('!q2ф'), '%21q2%u0444');
  assert.same(escape(null), 'null');
  assert.same(escape(undefined), 'undefined');

  if (typeof Symbol == 'function' && !Symbol.sham) {
    assert.throws(() => unescape(Symbol('escape test')), 'throws on symbol argument');
  }
});