Skip to content

Commit 711267f

Browse files
committed
Remove unused codepoint code
1 parent 2937f4a commit 711267f

2 files changed

Lines changed: 0 additions & 126 deletions

File tree

dist/bcrypt.js

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -970,69 +970,6 @@
970970
return res;
971971
}
972972

973-
// ref: http://mths.be/fromcodepoint v0.1.0 by @mathias
974-
/* if (!String.fromCodePoint) {
975-
(function () {
976-
var defineProperty = (function () {
977-
// IE 8 only supports `Object.defineProperty` on DOM elements
978-
try {
979-
var object = {};
980-
var $defineProperty = Object.defineProperty;
981-
var result = $defineProperty(object, object, object) && $defineProperty;
982-
} catch (error) {
983-
}
984-
return result;
985-
}());
986-
var stringFromCharCode = String.fromCharCode;
987-
var floor = Math.floor;
988-
var fromCodePoint = function () {
989-
var MAX_SIZE = 0x4000;
990-
var codeUnits = [];
991-
var highSurrogate;
992-
var lowSurrogate;
993-
var index = -1;
994-
var length = arguments.length;
995-
if (!length)
996-
return '';
997-
var result = '';
998-
while (++index < length) {
999-
var codePoint = Number(arguments[index]);
1000-
if (
1001-
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
1002-
codePoint < 0 || // not a valid Unicode code point
1003-
codePoint > 0x10FFFF || // not a valid Unicode code point
1004-
floor(codePoint) != codePoint // not an integer
1005-
) {
1006-
throw RangeError('Invalid code point: ' + codePoint);
1007-
}
1008-
if (codePoint <= 0xFFFF) { // BMP code point
1009-
codeUnits.push(codePoint);
1010-
} else { // Astral code point; split in surrogate halves
1011-
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
1012-
codePoint -= 0x10000;
1013-
highSurrogate = (codePoint >> 10) + 0xD800;
1014-
lowSurrogate = (codePoint % 0x400) + 0xDC00;
1015-
codeUnits.push(highSurrogate, lowSurrogate);
1016-
}
1017-
if (index + 1 == length || codeUnits.length > MAX_SIZE) {
1018-
result += stringFromCharCode.apply(null, codeUnits);
1019-
codeUnits.length = 0;
1020-
}
1021-
}
1022-
return result;
1023-
};
1024-
if (defineProperty) {
1025-
defineProperty(String, 'fromCodePoint', {
1026-
'value': fromCodePoint,
1027-
'configurable': true,
1028-
'writable': true
1029-
});
1030-
} else {
1031-
String["fromCodePoint"] = fromCodePoint;
1032-
}
1033-
}());
1034-
} */
1035-
1036973
// ref: http://mths.be/codepointat v0.1.0 by @mathias
1037974
if (!String.prototype.codePointAt) {
1038975
(function() {

src/utf8/codepoint.js

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,3 @@
1-
// ref: http://mths.be/fromcodepoint v0.1.0 by @mathias
2-
/* if (!String.fromCodePoint) {
3-
(function () {
4-
var defineProperty = (function () {
5-
// IE 8 only supports `Object.defineProperty` on DOM elements
6-
try {
7-
var object = {};
8-
var $defineProperty = Object.defineProperty;
9-
var result = $defineProperty(object, object, object) && $defineProperty;
10-
} catch (error) {
11-
}
12-
return result;
13-
}());
14-
var stringFromCharCode = String.fromCharCode;
15-
var floor = Math.floor;
16-
var fromCodePoint = function () {
17-
var MAX_SIZE = 0x4000;
18-
var codeUnits = [];
19-
var highSurrogate;
20-
var lowSurrogate;
21-
var index = -1;
22-
var length = arguments.length;
23-
if (!length)
24-
return '';
25-
var result = '';
26-
while (++index < length) {
27-
var codePoint = Number(arguments[index]);
28-
if (
29-
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
30-
codePoint < 0 || // not a valid Unicode code point
31-
codePoint > 0x10FFFF || // not a valid Unicode code point
32-
floor(codePoint) != codePoint // not an integer
33-
) {
34-
throw RangeError('Invalid code point: ' + codePoint);
35-
}
36-
if (codePoint <= 0xFFFF) { // BMP code point
37-
codeUnits.push(codePoint);
38-
} else { // Astral code point; split in surrogate halves
39-
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
40-
codePoint -= 0x10000;
41-
highSurrogate = (codePoint >> 10) + 0xD800;
42-
lowSurrogate = (codePoint % 0x400) + 0xDC00;
43-
codeUnits.push(highSurrogate, lowSurrogate);
44-
}
45-
if (index + 1 == length || codeUnits.length > MAX_SIZE) {
46-
result += stringFromCharCode.apply(null, codeUnits);
47-
codeUnits.length = 0;
48-
}
49-
}
50-
return result;
51-
};
52-
if (defineProperty) {
53-
defineProperty(String, 'fromCodePoint', {
54-
'value': fromCodePoint,
55-
'configurable': true,
56-
'writable': true
57-
});
58-
} else {
59-
String["fromCodePoint"] = fromCodePoint;
60-
}
61-
}());
62-
} */
63-
641
// ref: http://mths.be/codepointat v0.1.0 by @mathias
652
if (!String.prototype.codePointAt) {
663
(function() {

0 commit comments

Comments
 (0)