MCPcopy Create free account
hub / github.com/nodejs/node / assert_decode

Function assert_decode

test/fixtures/wpt/encoding/single-byte-decoder.window.js:49–61  ·  view source on GitHub ↗
(data, encoding)

Source from the content-addressed store, hash-verified

47
48// For XMLHttpRequest and TextDecoder tests
49function assert_decode(data, encoding) {
50 if(encoding == "ISO-8859-8-I") {
51 encoding = "ISO-8859-8"
52 }
53 for(var i = 0, l = data.length; i < l; i++) {
54 var cp = data.charCodeAt(i),
55 expectedCp = (i < 0x80) ? i : singleByteIndexes[encoding][i-0x80]
56 if(expectedCp == null) {
57 expectedCp = 0xFFFD
58 }
59 assert_equals(cp, expectedCp, encoding + ":" + i)
60 }
61}
62
63var subsetTest = "";
64if (location.search) {

Callers 1

Calls 1

assert_equalsFunction · 0.50

Tested by

no test coverage detected