summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/String/prototype/normalize/form-is-not-valid-throws.js
blob: 85db8ba7688859882f135132b4a36446b84f85c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.1.3.12
description: >
  Throws a RangeError if ToString(form) value is not a valid form name.
info: |
  21.1.3.12 String.prototype.normalize ( [ form ] )

  ...
  7. If f is not one of "NFC", "NFD", "NFKC", or "NFKD", throw a RangeError
  exception.
---*/

assert.throws(RangeError, function() {
  'foo'.normalize('bar');
});

assert.throws(RangeError, function() {
  'foo'.normalize('NFC1');
});

assert.throws(RangeError, function() {
  'foo'.normalize(null);
});

reportCompare(0, 0);