initial commit
This commit is contained in:
8
node_modules/es5-ext/test/string/#/code-point-at/implement.js
generated
vendored
Normal file
8
node_modules/es5-ext/test/string/#/code-point-at/implement.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var isImplemented =
|
||||
require("../../../../string/#/code-point-at/is-implemented");
|
||||
|
||||
module.exports = function (a) {
|
||||
a(isImplemented(), true);
|
||||
};
|
||||
3
node_modules/es5-ext/test/string/#/code-point-at/index.js
generated
vendored
Normal file
3
node_modules/es5-ext/test/string/#/code-point-at/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./shim");
|
||||
5
node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
generated
vendored
Normal file
5
node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (t, a) {
|
||||
a(typeof t(), "boolean");
|
||||
};
|
||||
119
node_modules/es5-ext/test/string/#/code-point-at/shim.js
generated
vendored
Normal file
119
node_modules/es5-ext/test/string/#/code-point-at/shim.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
/* eslint no-useless-call: "off" */
|
||||
|
||||
// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt
|
||||
// /blob/master/tests/tests.js
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports = function (t, a) {
|
||||
a(t.length, 1, "Length");
|
||||
|
||||
// String that starts with a BMP symbol
|
||||
a(t.call("abc\uD834\uDF06def", ""), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", "_"), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def"), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", -Infinity), undefined);
|
||||
a(t.call("abc\uD834\uDF06def", -1), undefined);
|
||||
a(t.call("abc\uD834\uDF06def", -0), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", 0), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", 3), 0x1d306);
|
||||
a(t.call("abc\uD834\uDF06def", 4), 0xdf06);
|
||||
a(t.call("abc\uD834\uDF06def", 5), 0x64);
|
||||
a(t.call("abc\uD834\uDF06def", 42), undefined);
|
||||
a(t.call("abc\uD834\uDF06def", Infinity), undefined);
|
||||
a(t.call("abc\uD834\uDF06def", Infinity), undefined);
|
||||
a(t.call("abc\uD834\uDF06def", NaN), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", false), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", null), 0x61);
|
||||
a(t.call("abc\uD834\uDF06def", undefined), 0x61);
|
||||
|
||||
// String that starts with an astral symbol
|
||||
a(t.call("\uD834\uDF06def", ""), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def", "1"), 0xdf06);
|
||||
a(t.call("\uD834\uDF06def", "_"), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def"), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def", -1), undefined);
|
||||
a(t.call("\uD834\uDF06def", -0), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def", 0), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def", 1), 0xdf06);
|
||||
a(t.call("\uD834\uDF06def", 42), undefined);
|
||||
a(t.call("\uD834\uDF06def", false), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def", null), 0x1d306);
|
||||
a(t.call("\uD834\uDF06def", undefined), 0x1d306);
|
||||
|
||||
// Lone high surrogates
|
||||
a(t.call("\uD834abc", ""), 0xd834);
|
||||
a(t.call("\uD834abc", "_"), 0xd834);
|
||||
a(t.call("\uD834abc"), 0xd834);
|
||||
a(t.call("\uD834abc", -1), undefined);
|
||||
a(t.call("\uD834abc", -0), 0xd834);
|
||||
a(t.call("\uD834abc", 0), 0xd834);
|
||||
a(t.call("\uD834abc", false), 0xd834);
|
||||
a(t.call("\uD834abc", NaN), 0xd834);
|
||||
a(t.call("\uD834abc", null), 0xd834);
|
||||
a(t.call("\uD834abc", undefined), 0xd834);
|
||||
|
||||
// Lone low surrogates
|
||||
a(t.call("\uDF06abc", ""), 0xdf06);
|
||||
a(t.call("\uDF06abc", "_"), 0xdf06);
|
||||
a(t.call("\uDF06abc"), 0xdf06);
|
||||
a(t.call("\uDF06abc", -1), undefined);
|
||||
a(t.call("\uDF06abc", -0), 0xdf06);
|
||||
a(t.call("\uDF06abc", 0), 0xdf06);
|
||||
a(t.call("\uDF06abc", false), 0xdf06);
|
||||
a(t.call("\uDF06abc", NaN), 0xdf06);
|
||||
a(t.call("\uDF06abc", null), 0xdf06);
|
||||
a(t.call("\uDF06abc", undefined), 0xdf06);
|
||||
|
||||
a.throws(function () {
|
||||
t.call(undefined);
|
||||
}, TypeError);
|
||||
a.throws(function () {
|
||||
t.call(undefined, 4);
|
||||
}, TypeError);
|
||||
a.throws(function () {
|
||||
t.call(null);
|
||||
}, TypeError);
|
||||
a.throws(function () {
|
||||
t.call(null, 4);
|
||||
}, TypeError);
|
||||
a(t.call(42, 0), 0x34);
|
||||
a(t.call(42, 1), 0x32);
|
||||
a(
|
||||
t.call(
|
||||
{
|
||||
toString: function () {
|
||||
return "abc";
|
||||
}
|
||||
},
|
||||
2
|
||||
),
|
||||
0x63
|
||||
);
|
||||
|
||||
a.throws(function () {
|
||||
t.apply(undefined);
|
||||
}, TypeError);
|
||||
a.throws(function () {
|
||||
t.apply(undefined, [4]);
|
||||
}, TypeError);
|
||||
a.throws(function () {
|
||||
t.apply(null);
|
||||
}, TypeError);
|
||||
a.throws(function () {
|
||||
t.apply(null, [4]);
|
||||
}, TypeError);
|
||||
a(t.apply(42, [0]), 0x34);
|
||||
a(t.apply(42, [1]), 0x32);
|
||||
a(
|
||||
t.apply(
|
||||
{
|
||||
toString: function () {
|
||||
return "abc";
|
||||
}
|
||||
},
|
||||
[2]
|
||||
),
|
||||
0x63
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user