0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/mjsunit/test-byte-length.js
Felix Geisendörfer 7371fcb312 Temporary function to determine str byte length
Will need a better place later on
2009-11-11 18:42:46 +01:00

11 lines
373 B
JavaScript

process.mixin(require("./common"));
assertEquals(14, process._byteLength("Il était tué"));
assertEquals(14, process._byteLength("Il était tué", "utf8"));
assertEquals(12, process._byteLength("Il était tué", "ascii"));
assertEquals(12, process._byteLength("Il était tué", "binary"));
assertThrows('process._byteLength()');
assertThrows('process._byteLength(5)');