diff --git a/tests/es.js b/tests/es.js
index 6b7e06001499..2521beddf46d 100644
--- a/tests/es.js
+++ b/tests/es.js
@@ -1,15 +1,12 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, toString$ = {}.toString;
+ var module, test, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('ES5');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
test('Object.getOwnPropertyDescriptor', function(assert){
var getOwnPropertyDescriptor;
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- assert.ok(isFunction(getOwnPropertyDescriptor), 'is function');
+ assert.isFunction(getOwnPropertyDescriptor);
assert.deepEqual(getOwnPropertyDescriptor({
q: 42
}, 'q'), {
@@ -23,7 +20,7 @@
test('Object.defineProperty', function(assert){
var defineProperty, rez, src;
defineProperty = Object.defineProperty;
- assert.ok(isFunction(defineProperty), 'is function');
+ assert.isFunction(defineProperty);
assert.ok((rez = defineProperty(src = {}, 'q', {
value: 42
})) === src);
@@ -32,7 +29,7 @@
test('Object.defineProperties', function(assert){
var defineProperties, rez, src;
defineProperties = Object.defineProperties;
- assert.ok(isFunction(defineProperties), 'is function');
+ assert.isFunction(defineProperties);
assert.ok((rez = defineProperties(src = {}, {
q: {
value: 42
@@ -46,7 +43,7 @@
test('Object.getPrototypeOf', function(assert){
var create, getPrototypeOf, fn, obj, foo, bar;
create = Object.create, getPrototypeOf = Object.getPrototypeOf;
- assert.ok(isFunction(getPrototypeOf), 'is function');
+ assert.isFunction(getPrototypeOf);
assert.ok(getPrototypeOf({}) === Object.prototype);
assert.ok(getPrototypeOf([]) === Array.prototype);
assert.ok(getPrototypeOf(new (fn = (function(){
@@ -70,7 +67,7 @@
test('Object.getOwnPropertyNames', function(assert){
var getOwnPropertyNames, fn1, fn2, names;
getOwnPropertyNames = Object.getOwnPropertyNames;
- assert.ok(isFunction(getOwnPropertyNames), 'is function');
+ assert.isFunction(getOwnPropertyNames);
fn1 = function(w){
this.w = w != null ? w : 2;
};
@@ -110,7 +107,7 @@
}
return result;
};
- assert.ok(isFunction(create), 'is function');
+ assert.isFunction(create);
assert.ok(isPrototype(obj = {
q: 1
}, create(obj)));
@@ -138,7 +135,7 @@
test('Object.keys', function(assert){
var keys, fn1, fn2;
keys = Object.keys;
- assert.ok(isFunction(keys), 'is function');
+ assert.isFunction(keys);
fn1 = function(w){
this.w = w != null ? w : 2;
};
@@ -154,42 +151,42 @@
test('Object.seal', function(assert){
var seal, a;
seal = Object.seal;
- assert.ok(isFunction(seal), 'is function');
+ assert.isFunction(seal);
return assert.strictEqual(seal(a = {}), a);
});
test('Object.freeze', function(assert){
var freeze, a;
freeze = Object.freeze;
- assert.ok(isFunction(freeze), 'is function');
+ assert.isFunction(freeze);
return assert.strictEqual(freeze(a = {}), a);
});
test('Object.preventExtensions', function(assert){
var preventExtensions, a;
preventExtensions = Object.preventExtensions;
- assert.ok(isFunction(preventExtensions), 'is function');
+ assert.isFunction(preventExtensions);
return assert.strictEqual(preventExtensions(a = {}), a);
});
test('Object.isSealed', function(assert){
var isSealed;
isSealed = Object.isSealed;
- assert.ok(isFunction(isSealed), 'is function');
+ assert.isFunction(isSealed);
return assert.strictEqual(isSealed({}), false);
});
test('Object.isFrozen', function(assert){
var isFrozen;
isFrozen = Object.isFrozen;
- assert.ok(isFunction(isFrozen), 'is function');
+ assert.isFunction(isFrozen);
return assert.strictEqual(isFrozen({}), false);
});
test('Object.isExtensible', function(assert){
var isExtensible;
isExtensible = Object.isExtensible;
- assert.ok(isFunction(isExtensible), 'is function');
+ assert.isFunction(isExtensible);
return assert.strictEqual(isExtensible({}), true);
});
test('Function#bind', function(assert){
var obj, fn, inst, F, date;
- assert.ok(isFunction(Function.prototype.bind), 'is function');
+ assert.isFunction(Function.prototype.bind);
obj = {
a: 42
};
@@ -219,7 +216,7 @@
test('Array.isArray', function(assert){
var isArray;
isArray = Array.isArray;
- assert.ok(isFunction(isArray), 'is function');
+ assert.isFunction(isArray);
assert.ok(!isArray({}));
assert.ok(!isArray(function(){
return arguments;
@@ -230,7 +227,7 @@
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = ['indexOf', 'lastIndexOf', 'every', 'some', 'forEach', 'map', 'filter', 'reduce', 'reduceRight']).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(Array.prototype[x$]), "Array::" + x$ + " is function"));
+ results$.push(assert.isFunction(Array.prototype[x$], "Array::" + x$ + " is function"));
}
return results$;
});
@@ -443,12 +440,12 @@
test('Date.now', function(assert){
var now;
now = Date.now;
- assert.ok(isFunction(now), 'is function');
+ assert.isFunction(now);
return assert.ok(+new Date - now() < 10, 'Date.now() ~ +new Date');
});
test('Date#toISOString', function(assert){
var ft, bc;
- assert.ok(isFunction(Date.prototype.toISOString), 'is function');
+ assert.isFunction(Date.prototype.toISOString);
assert.strictEqual(new Date(0).toISOString(), '1970-01-01T00:00:00.000Z');
assert.strictEqual(new Date(1e12 + 1).toISOString(), '2001-09-09T01:46:40.001Z');
assert.strictEqual(new Date(-5e13 - 1).toISOString(), '0385-07-25T07:06:39.999Z');
@@ -483,15 +480,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#copyWithin', function(assert){
var a;
- assert.ok(toString$.call(Array.prototype.copyWithin).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.copyWithin.length, 2, 'arity is 2');
- assert.ok(/native code/.test(Array.prototype.copyWithin), 'looks like native');
- assert.strictEqual(Array.prototype.copyWithin.name, 'copyWithin', 'name is "copyWithin"');
+ assert.isFunction(Array.prototype.copyWithin);
+ assert.arity(Array.prototype.copyWithin, 2);
+ assert.name(Array.prototype.copyWithin, 'copyWithin');
+ assert.looksNative(Array.prototype.copyWithin);
assert.strictEqual(a = [1].copyWithin(0), a);
assert.deepEqual([1, 2, 3, 4, 5].copyWithin(0, 3), [4, 5, 3, 4, 5]);
assert.deepEqual([1, 2, 3, 4, 5].copyWithin(1, 3), [1, 4, 5, 4, 5]);
@@ -522,15 +519,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#fill', function(assert){
var a;
- assert.ok(toString$.call(Array.prototype.fill).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.fill.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.fill), 'looks like native');
- assert.strictEqual(Array.prototype.fill.name, 'fill', 'name is "fill"');
+ assert.isFunction(Array.prototype.fill);
+ assert.arity(Array.prototype.fill, 1);
+ assert.name(Array.prototype.fill, 'fill');
+ assert.looksNative(Array.prototype.fill);
assert.strictEqual(a = Array(5).fill(5), a);
assert.deepEqual(Array(5).fill(5), [5, 5, 5, 5, 5]);
assert.deepEqual(Array(5).fill(5, 1), [void 8, 5, 5, 5, 5]);
@@ -554,15 +551,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#findIndex', function(assert){
var arr, ctx;
- assert.ok(toString$.call(Array.prototype.findIndex).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.findIndex.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.findIndex), 'looks like native');
- assert.strictEqual(Array.prototype.findIndex.name, 'findIndex', 'name is "findIndex"');
+ assert.isFunction(Array.prototype.findIndex);
+ assert.arity(Array.prototype.findIndex, 1);
+ assert.name(Array.prototype.findIndex, 'findIndex');
+ assert.looksNative(Array.prototype.findIndex);
(arr = [1]).findIndex(function(val, key, that){
assert.strictEqual(this, ctx);
assert.strictEqual(val, 1);
@@ -589,15 +586,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#find', function(assert){
var arr, ctx;
- assert.ok(toString$.call(Array.prototype.find).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.find.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.find), 'looks like native');
- assert.strictEqual(Array.prototype.find.name, 'find', 'name is "find"');
+ assert.isFunction(Array.prototype.find);
+ assert.arity(Array.prototype.find, 1);
+ assert.name(Array.prototype.find, 'find');
+ assert.looksNative(Array.prototype.find);
(arr = [1]).find(function(val, key, that){
assert.strictEqual(this, ctx);
assert.strictEqual(val, 1);
@@ -626,17 +623,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array.from', function(assert){
var from, iterator, al, ctx, done, iter, F, inst, a;
from = Array.from;
iterator = Symbol.iterator;
- assert.ok(toString$.call(from).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.from.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.from), 'looks like native');
- assert.strictEqual(Array.from.name, 'from', 'name is "from"');
+ assert.isFunction(from);
+ assert.arity(from, 1);
+ assert.name(from, 'from');
+ assert.looksNative(from);
assert.deepEqual(from('123'), ['1', '2', '3']);
assert.deepEqual(from({
length: 3,
@@ -719,21 +716,18 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, toString$ = {}.toString;
+ var module, test, isIterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
test('Array#keys', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype.keys), 'is function');
- assert.strictEqual(Array.prototype.keys.length, 0, 'arity is 0');
- assert.strictEqual(Array.prototype.keys.name, 'keys', 'name is "keys"');
- assert.ok(/native code/.test(Array.prototype.keys), 'looks like native');
+ assert.isFunction(Array.prototype.keys);
+ assert.arity(Array.prototype.keys, 0);
+ assert.name(Array.prototype.keys, 'keys');
+ assert.looksNative(Array.prototype.keys);
iter = ['q', 'w', 'e'].keys();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -757,9 +751,9 @@
});
test('Array#values', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype.values), 'is function');
- assert.strictEqual(Array.prototype.values.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Array.prototype.values), 'looks like native');
+ assert.isFunction(Array.prototype.values);
+ assert.arity(Array.prototype.values, 0);
+ assert.looksNative(Array.prototype.values);
iter = ['q', 'w', 'e'].values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -783,10 +777,10 @@
});
test('Array#entries', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype.entries), 'is function');
- assert.strictEqual(Array.prototype.entries.length, 0, 'arity is 0');
- assert.strictEqual(Array.prototype.entries.name, 'entries', 'name is "entries"');
- assert.ok(/native code/.test(Array.prototype.entries), 'looks like native');
+ assert.isFunction(Array.prototype.entries);
+ assert.arity(Array.prototype.entries, 0);
+ assert.name(Array.prototype.entries, 'entries');
+ assert.looksNative(Array.prototype.entries);
iter = ['q', 'w', 'e'].entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -810,9 +804,9 @@
});
test('Array#@@iterator', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'is function');
- assert.strictEqual(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8].length, 0, 'arity is 0');
- assert.ok(/native code/.test(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'looks like native');
+ assert.isFunction(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
+ assert.arity(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], 0);
+ assert.looksNative(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
assert.strictEqual(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], Array.prototype.values);
iter = ['q', 'w', 'e'][typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
@@ -838,15 +832,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array.of', function(assert){
var F, inst;
- assert.ok(toString$.call(Array.of).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.of.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Array.of), 'looks like native');
- assert.strictEqual(Array.of.name, 'of', 'name is "of"');
+ assert.isFunction(Array.of);
+ assert.arity(Array.of, 0);
+ assert.name(Array.of, 'of');
+ assert.looksNative(Array.of);
assert.deepEqual(Array.of(1), [1]);
assert.deepEqual(Array.of(1, 2, 3), [1, 2, 3]);
F = function(){};
@@ -899,14 +893,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, same, getOwnPropertyDescriptor, freeze, iterator, toString$ = {}.toString;
+ var module, test, isIterator, same, getOwnPropertyDescriptor, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
same = function(a, b){
if (a === b) {
@@ -919,10 +910,10 @@
iterator = Symbol.iterator;
test('Map', function(assert){
var done, iter, a;
- assert.ok(isFunction(Map), 'is function');
- assert.ok(/native code/.test(Map), 'looks like native');
- assert.strictEqual(Map.name, 'Map', 'name is "Map"');
- assert.strictEqual(Map.length, 0, 'arity is 0');
+ assert.isFunction(Map);
+ assert.arity(Map, 0);
+ assert.name(Map, 'Map');
+ assert.looksNative(Map);
assert.ok('clear' in Map.prototype, 'clear in Map.prototype');
assert.ok('delete' in Map.prototype, 'delete in Map.prototype');
assert.ok('forEach' in Map.prototype, 'forEach in Map.prototype');
@@ -953,10 +944,10 @@
});
test('Map#clear', function(assert){
var M, f;
- assert.ok(isFunction(Map.prototype.clear), 'is function');
- assert.strictEqual(Map.prototype.clear.name, 'clear', 'name is "clear"');
- assert.strictEqual(Map.prototype.clear.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.clear), 'looks like native');
+ assert.isFunction(Map.prototype.clear);
+ assert.arity(Map.prototype.clear, 0);
+ assert.name(Map.prototype.clear, 'clear');
+ assert.looksNative(Map.prototype.clear);
M = new Map;
M.clear();
assert.strictEqual(M.size, 0);
@@ -973,9 +964,9 @@
});
test('Map#delete', function(assert){
var a, M, f;
- assert.ok(isFunction(Map.prototype['delete']), 'is function');
- assert.strictEqual(Map.prototype['delete'].length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype['delete']), 'looks like native');
+ assert.isFunction(Map.prototype['delete']);
+ assert.arity(Map.prototype['delete'], 1);
+ assert.looksNative(Map.prototype['delete']);
a = [];
M = new Map().set(NaN, 1).set(2, 1).set(3, 1).set(2, 5).set(1, 4).set(a, {});
assert.strictEqual(M.size, 5);
@@ -994,10 +985,10 @@
});
test('Map#forEach', function(assert){
var r, T, count, M, a, map, s;
- assert.ok(isFunction(Map.prototype.forEach), 'is function');
- assert.strictEqual(Map.prototype.forEach.name, 'forEach', 'name is "forEach"');
- assert.strictEqual(Map.prototype.forEach.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype.forEach), 'looks like native');
+ assert.isFunction(Map.prototype.forEach);
+ assert.arity(Map.prototype.forEach, 1);
+ assert.name(Map.prototype.forEach, 'forEach');
+ assert.looksNative(Map.prototype.forEach);
r = {};
count = 0;
M = new Map().set(NaN, 1).set(2, 1).set(3, 7).set(2, 5).set(1, 4).set(a = {}, 9);
@@ -1038,10 +1029,10 @@
});
test('Map#get', function(assert){
var o, f, M;
- assert.ok(isFunction(Map.prototype.get), 'is function');
- assert.strictEqual(Map.prototype.get.name, 'get', 'name is "get"');
- assert.strictEqual(Map.prototype.get.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype.get), 'looks like native');
+ assert.isFunction(Map.prototype.get);
+ assert.name(Map.prototype.get, 'get');
+ assert.arity(Map.prototype.get, 1);
+ assert.looksNative(Map.prototype.get);
o = {};
f = freeze({});
M = new Map([[NaN, 1], [2, 1], [3, 1], [2, 5], [1, 4], [f, 42], [o, o]]);
@@ -1054,10 +1045,10 @@
});
test('Map#has', function(assert){
var o, f, M;
- assert.ok(isFunction(Map.prototype.has), 'is function');
- assert.strictEqual(Map.prototype.has.name, 'has', 'name is "has"');
- assert.strictEqual(Map.prototype.has.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype.has), 'looks like native');
+ assert.isFunction(Map.prototype.has);
+ assert.name(Map.prototype.has, 'has');
+ assert.arity(Map.prototype.has, 1);
+ assert.looksNative(Map.prototype.has);
o = {};
f = freeze({});
M = new Map([[NaN, 1], [2, 1], [3, 1], [2, 5], [1, 4], [f, 42], [o, o]]);
@@ -1070,10 +1061,10 @@
});
test('Map#set', function(assert){
var o, M, chain, f;
- assert.ok(isFunction(Map.prototype.set), 'is function');
- assert.strictEqual(Map.prototype.set.name, 'set', 'name is "set"');
- assert.strictEqual(Map.prototype.set.length, 2, 'arity is 2');
- assert.ok(/native code/.test(Map.prototype.set), 'looks like native');
+ assert.isFunction(Map.prototype.set);
+ assert.name(Map.prototype.set, 'set');
+ assert.arity(Map.prototype.set, 2);
+ assert.looksNative(Map.prototype.set);
o = {};
M = new Map().set(NaN, 1).set(2, 1).set(3, 1).set(2, 5).set(1, 4).set(o, o);
assert.ok(M.size === 5);
@@ -1159,10 +1150,10 @@
});
test('Map#keys', function(assert){
var iter;
- assert.ok(typeof Map.prototype.keys === 'function', 'is function');
- assert.strictEqual(Map.prototype.keys.name, 'keys', 'name is "keys"');
- assert.strictEqual(Map.prototype.keys.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.keys), 'looks like native');
+ assert.isFunction(Map.prototype.keys);
+ assert.name(Map.prototype.keys, 'keys');
+ assert.arity(Map.prototype.keys, 0);
+ assert.looksNative(Map.prototype.keys);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).keys();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -1185,10 +1176,10 @@
});
test('Map#values', function(assert){
var iter;
- assert.ok(typeof Map.prototype.values === 'function', 'is function');
- assert.strictEqual(Map.prototype.values.name, 'values', 'name is "values"');
- assert.strictEqual(Map.prototype.values.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.values), 'looks like native');
+ assert.isFunction(Map.prototype.values);
+ assert.name(Map.prototype.values, 'values');
+ assert.arity(Map.prototype.values, 0);
+ assert.looksNative(Map.prototype.values);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -1211,10 +1202,10 @@
});
test('Map#entries', function(assert){
var iter;
- assert.ok(typeof Map.prototype.entries === 'function', 'is function');
- assert.strictEqual(Map.prototype.entries.name, 'entries', 'name is "entries"');
- assert.strictEqual(Map.prototype.entries.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.entries), 'looks like native');
+ assert.isFunction(Map.prototype.entries);
+ assert.name(Map.prototype.entries, 'entries');
+ assert.arity(Map.prototype.entries, 0);
+ assert.looksNative(Map.prototype.entries);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -1237,10 +1228,10 @@
});
test('Map#@@iterator', function(assert){
var iter;
- assert.ok(typeof Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8] === 'function', 'is function');
- assert.strictEqual(Map.prototype.entries.name, 'entries', 'name is "entries"');
- assert.strictEqual(Map.prototype.entries.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'looks like native');
+ assert.isFunction(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
+ assert.name(Map.prototype.entries, 'entries');
+ assert.arity(Map.prototype.entries, 0);
+ assert.looksNative(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
assert.strictEqual(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], Map.prototype.entries);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']])[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
@@ -1266,16 +1257,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.acosh', function(assert){
var acosh;
acosh = Math.acosh;
- assert.ok(toString$.call(acosh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(acosh.name, 'acosh', 'name is "acosh"');
- assert.strictEqual(acosh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(acosh), 'looks like native');
+ assert.isFunction(acosh);
+ assert.name(acosh, 'acosh');
+ assert.arity(acosh, 1);
+ assert.looksNative(acosh);
assert.same(acosh(NaN), NaN);
assert.same(acosh(0.5), NaN);
assert.same(acosh(-1), NaN);
@@ -1292,16 +1283,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.asinh', function(assert){
var asinh;
asinh = Math.asinh;
- assert.ok(toString$.call(asinh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(asinh.name, 'asinh', 'name is "asinh"');
- assert.strictEqual(asinh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(asinh), 'looks like native');
+ assert.isFunction(asinh);
+ assert.name(asinh, 'asinh');
+ assert.arity(asinh, 1);
+ assert.looksNative(asinh);
assert.same(asinh(NaN), NaN);
assert.same(asinh(0), 0);
assert.same(asinh(-0), -0);
@@ -1317,16 +1308,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.atanh', function(assert){
var atanh;
atanh = Math.atanh;
- assert.ok(toString$.call(atanh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(atanh.name, 'atanh', 'name is "atanh"');
- assert.strictEqual(atanh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(atanh), 'looks like native');
+ assert.isFunction(atanh);
+ assert.name(atanh, 'atanh');
+ assert.arity(atanh, 1);
+ assert.looksNative(atanh);
assert.same(atanh(NaN), NaN);
assert.same(atanh(-2), NaN);
assert.same(atanh(-1.5), NaN);
@@ -1346,16 +1337,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.cbrt', function(assert){
var cbrt;
cbrt = Math.cbrt;
- assert.ok(toString$.call(cbrt).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(cbrt.name, 'cbrt', 'name is "cbrt"');
- assert.strictEqual(cbrt.length, 1, 'arity is 1');
- assert.ok(/native code/.test(cbrt), 'looks like native');
+ assert.isFunction(cbrt);
+ assert.name(cbrt, 'cbrt');
+ assert.arity(cbrt, 1);
+ assert.looksNative(cbrt);
assert.same(cbrt(NaN), NaN);
assert.same(cbrt(0), 0);
assert.same(cbrt(-0), -0);
@@ -1370,16 +1361,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.clz32', function(assert){
var clz32;
clz32 = Math.clz32;
- assert.ok(toString$.call(clz32).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(clz32.name, 'clz32', 'name is "clz32"');
- assert.strictEqual(clz32.length, 1, 'arity is 1');
- assert.ok(/native code/.test(clz32), 'looks like native');
+ assert.isFunction(clz32);
+ assert.name(clz32, 'clz32');
+ assert.arity(clz32, 1);
+ assert.looksNative(clz32);
assert.strictEqual(clz32(0), 32);
assert.strictEqual(clz32(1), 31);
assert.same(clz32(-1), 0);
@@ -1391,16 +1382,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.cosh', function(assert){
var cosh;
cosh = Math.cosh;
- assert.ok(toString$.call(cosh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(cosh.name, 'cosh', 'name is "cosh"');
- assert.strictEqual(cosh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(cosh), 'looks like native');
+ assert.isFunction(cosh);
+ assert.name(cosh, 'cosh');
+ assert.arity(cosh, 1);
+ assert.looksNative(cosh);
assert.same(cosh(NaN), NaN);
assert.strictEqual(cosh(0), 1);
assert.strictEqual(cosh(-0), 1);
@@ -1415,16 +1406,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.expm1', function(assert){
var expm1;
expm1 = Math.expm1;
- assert.ok(toString$.call(expm1).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(expm1.name, 'expm1', 'name is "expm1"');
- assert.strictEqual(expm1.length, 1, 'arity is 1');
- assert.ok(/native code/.test(expm1), 'looks like native');
+ assert.isFunction(expm1);
+ assert.name(expm1, 'expm1');
+ assert.arity(expm1, 1);
+ assert.looksNative(expm1);
assert.same(expm1(NaN), NaN);
assert.same(expm1(0), 0);
assert.same(expm1(-0), -0);
@@ -1436,16 +1427,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.fround', function(assert){
var fround, maxFloat32, minFloat32;
fround = Math.fround;
- assert.ok(toString$.call(fround).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(fround.name, 'fround', 'name is "fround"');
- assert.strictEqual(fround.length, 1, 'arity is 1');
- assert.ok(/native code/.test(fround), 'looks like native');
+ assert.isFunction(fround);
+ assert.name(fround, 'fround');
+ assert.arity(fround, 1);
+ assert.looksNative(fround);
assert.same(fround(void 8), NaN);
assert.same(fround(NaN), NaN);
assert.same(fround(0), 0);
@@ -1475,16 +1466,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.hypot', function(assert){
var hypot, sqrt;
hypot = Math.hypot, sqrt = Math.sqrt;
- assert.ok(toString$.call(hypot).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(hypot.name, 'hypot', 'name is "hypot"');
- assert.strictEqual(hypot.length, 2, 'arity is 2');
- assert.ok(/native code/.test(hypot), 'looks like native');
+ assert.isFunction(hypot);
+ assert.name(hypot, 'hypot');
+ assert.arity(hypot, 2);
+ assert.looksNative(hypot);
assert.strictEqual(hypot(), 0);
assert.strictEqual(hypot(1), 1);
assert.same(hypot('', 0), 0);
@@ -1525,16 +1516,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.imul', function(assert){
var imul;
imul = Math.imul;
- assert.ok(toString$.call(imul).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(imul.name, 'imul', 'name is "imul"');
- assert.strictEqual(imul.length, 2, 'arity is 2');
- assert.ok(/native code/.test(imul), 'looks like native');
+ assert.isFunction(imul);
+ assert.name(imul, 'imul');
+ assert.arity(imul, 2);
+ assert.looksNative(imul);
assert.same(imul(0, 0), 0);
assert.strictEqual(imul(123, 456), 56088);
assert.strictEqual(imul(-123, 456), -56088);
@@ -1575,16 +1566,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log10', function(assert){
var log10;
log10 = Math.log10;
- assert.ok(toString$.call(log10).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(log10.name, 'log10', 'name is "log10"');
- assert.strictEqual(log10.length, 1, 'arity is 1');
- assert.ok(/native code/.test(log10), 'looks like native');
+ assert.isFunction(log10);
+ assert.name(log10, 'log10');
+ assert.arity(log10, 1);
+ assert.looksNative(log10);
assert.same(log10(''), log10(0));
assert.same(log10(NaN), NaN);
assert.same(log10(-1), NaN);
@@ -1602,16 +1593,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log1p', function(assert){
var log1p;
log1p = Math.log1p;
- assert.ok(toString$.call(log1p).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(log1p.name, 'log1p', 'name is "log1p"');
- assert.strictEqual(log1p.length, 1, 'arity is 1');
- assert.ok(/native code/.test(log1p), 'looks like native');
+ assert.isFunction(log1p);
+ assert.name(log1p, 'log1p');
+ assert.arity(log1p, 1);
+ assert.looksNative(log1p);
assert.same(log1p(''), log1p(0));
assert.same(log1p(NaN), NaN);
assert.same(log1p(-2), NaN);
@@ -1626,16 +1617,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log2', function(assert){
var log2;
log2 = Math.log2;
- assert.ok(toString$.call(log2).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(log2.name, 'log2', 'name is "log2"');
- assert.strictEqual(log2.length, 1, 'arity is 1');
- assert.ok(/native code/.test(log2), 'looks like native');
+ assert.isFunction(log2);
+ assert.name(log2, 'log2');
+ assert.arity(log2, 1);
+ assert.looksNative(log2);
assert.same(log2(''), log2(0));
assert.same(log2(NaN), NaN);
assert.same(log2(-1), NaN);
@@ -1651,16 +1642,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.sign', function(assert){
var sign;
sign = Math.sign;
- assert.ok(toString$.call(sign).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(sign.name, 'sign', 'name is "sign"');
- assert.strictEqual(sign.length, 1, 'arity is 1');
- assert.ok(/native code/.test(sign), 'looks like native');
+ assert.isFunction(sign);
+ assert.name(sign, 'sign');
+ assert.arity(sign, 1);
+ assert.looksNative(sign);
assert.same(sign(NaN), NaN);
assert.same(sign(), NaN);
assert.same(sign(-0), -0);
@@ -1676,16 +1667,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.sinh', function(assert){
var sinh;
sinh = Math.sinh;
- assert.ok(toString$.call(sinh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(sinh.name, 'sinh', 'name is "sinh"');
- assert.strictEqual(sinh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(sinh), 'looks like native');
+ assert.isFunction(sinh);
+ assert.name(sinh, 'sinh');
+ assert.arity(sinh, 1);
+ assert.looksNative(sinh);
assert.same(sinh(NaN), NaN);
assert.same(sinh(0), 0);
assert.same(sinh(-0), -0);
@@ -1699,16 +1690,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.tanh', function(assert){
var tanh;
tanh = Math.tanh;
- assert.ok(toString$.call(tanh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(tanh.name, 'tanh', 'name is "tanh"');
- assert.strictEqual(tanh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(tanh), 'looks like native');
+ assert.isFunction(tanh);
+ assert.name(tanh, 'tanh');
+ assert.arity(tanh, 1);
+ assert.looksNative(tanh);
assert.same(tanh(NaN), NaN);
assert.same(tanh(0), 0);
assert.same(tanh(-0), -0);
@@ -1720,16 +1711,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.trunc', function(assert){
var trunc;
trunc = Math.trunc;
- assert.ok(toString$.call(trunc).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(trunc.name, 'trunc', 'name is "trunc"');
- assert.strictEqual(trunc.length, 1, 'arity is 1');
- assert.ok(/native code/.test(trunc), 'looks like native');
+ assert.isFunction(trunc);
+ assert.name(trunc, 'trunc');
+ assert.arity(trunc, 1);
+ assert.looksNative(trunc);
assert.same(trunc(NaN), NaN, 'NaN -> NaN');
assert.same(trunc(-0), -0, '-0 -> -0');
assert.same(trunc(0), 0, '0 -> 0');
@@ -1766,10 +1757,10 @@
test('Number constructor: regression', function(assert){
var check, i, i$, x$, ref$, len$, n;
check = $check(assert);
- assert.ok(toString$.call(Number).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Number.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Number), 'looks like native');
- assert.strictEqual(Number.name, 'Number', 'name is "Number"');
+ assert.isFunction(Number);
+ assert.arity(Number, 1);
+ assert.name(Number, 'Number');
+ assert.looksNative(Number);
check(42, 42);
check(42.42, 42.42);
check(new Number(42), 42);
@@ -1933,17 +1924,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isFinite', function(assert){
var isFinite, create, i$, x$, ref$, len$, y$, e, results$ = [];
isFinite = Number.isFinite;
create = Object.create;
- assert.ok(toString$.call(isFinite).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isFinite.name, 'isFinite', 'name is "isFinite"');
- assert.strictEqual(isFinite.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isFinite), 'looks like native');
+ assert.isFunction(isFinite);
+ assert.name(isFinite, 'isFinite');
+ assert.arity(isFinite, 1);
+ assert.looksNative(isFinite);
for (i$ = 0, len$ = (ref$ = [1, 0.1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isFinite(x$), "isFinite " + typeof x$ + " " + x$);
@@ -1967,17 +1958,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isInteger', function(assert){
var isInteger, create, i$, x$, ref$, len$, y$, e, results$ = [];
isInteger = Number.isInteger;
create = Object.create;
- assert.ok(toString$.call(isInteger).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isInteger.name, 'isInteger', 'name is "isInteger"');
- assert.strictEqual(isInteger.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isInteger), 'looks like native');
+ assert.isFunction(isInteger);
+ assert.name(isInteger, 'isInteger');
+ assert.arity(isInteger, 1);
+ assert.looksNative(isInteger);
for (i$ = 0, len$ = (ref$ = [1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isInteger(x$), "isInteger " + typeof x$ + " " + x$);
@@ -2001,17 +1992,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isNaN', function(assert){
var isNaN, create, i$, x$, ref$, len$, e, results$ = [];
isNaN = Number.isNaN;
create = Object.create;
- assert.ok(toString$.call(isNaN).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isNaN.name, 'isNaN', 'name is "isNaN"');
- assert.strictEqual(isNaN.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isNaN), 'looks like native');
+ assert.isFunction(isNaN);
+ assert.name(isNaN, 'isNaN');
+ assert.arity(isNaN, 1);
+ assert.looksNative(isNaN);
assert.ok(isNaN(NaN), 'Number.isNaN NaN');
for (i$ = 0, len$ = (ref$ = [1, 0.1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0, Infinity, 'NaN', '5', false, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void 8, null, {}, fn$, create(null)]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
@@ -2032,17 +2023,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isSafeInteger', function(assert){
var isSafeInteger, create, i$, x$, ref$, len$, y$, e, results$ = [];
isSafeInteger = Number.isSafeInteger;
create = Object.create;
- assert.ok(toString$.call(isSafeInteger).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isSafeInteger.name, 'isSafeInteger', 'name is "isSafeInteger"');
- assert.strictEqual(isSafeInteger.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isSafeInteger), 'looks like native');
+ assert.isFunction(isSafeInteger);
+ assert.name(isSafeInteger, 'isSafeInteger');
+ assert.arity(isSafeInteger, 1);
+ assert.looksNative(isSafeInteger);
for (i$ = 0, len$ = (ref$ = [1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0, 9007199254740991, -9007199254740991]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isSafeInteger(x$), "isSafeInteger " + typeof x$ + " " + x$);
@@ -2086,33 +2077,33 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.parseFloat', function(assert){
- assert.ok(toString$.call(Number.parseFloat).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Number.parseFloat.name, 'parseFloat', 'name is "parseFloat"');
- assert.strictEqual(Number.parseFloat.length, 1, 'arity is 1');
- return assert.ok(/native code/.test(Number.parseFloat), 'looks like native');
+ assert.isFunction(Number.parseFloat);
+ assert.name(Number.parseFloat, 'parseFloat');
+ assert.arity(Number.parseFloat, 1);
+ return assert.looksNative(Number.parseFloat);
});
}).call(this);
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.parseInt', function(assert){
- assert.ok(toString$.call(Number.parseInt).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Number.parseInt.name, 'parseInt', 'name is "parseInt"');
- assert.strictEqual(Number.parseInt.length, 2, 'arity is 2');
- return assert.ok(/native code/.test(Number.parseInt), 'looks like native');
+ assert.isFunction(Number.parseInt);
+ assert.name(Number.parseInt, 'parseInt');
+ assert.arity(Number.parseInt, 2);
+ return assert.looksNative(Number.parseInt);
});
}).call(this);
// Generated by LiveScript 1.3.1
(function(){
- var module, test, descriptors, toString$ = {}.toString;
+ var module, test, descriptors;
module = QUnit.module, test = QUnit.test;
module('ES6');
descriptors = function(){
@@ -2127,10 +2118,10 @@
test('Object.assign', function(assert){
var assign, keys, defineProperty, foo, str, c, d, D, ref$, O, string, i$, x$, len$;
assign = Object.assign, keys = Object.keys, defineProperty = Object.defineProperty;
- assert.ok(toString$.call(assign).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(assign.length, 2, 'arity is 2');
- assert.strictEqual(assign.name, 'assign', 'name is "assign"');
- assert.ok(/native code/.test(assign), 'looks like native');
+ assert.isFunction(assign);
+ assert.arity(assign, 2);
+ assert.name(assign, 'assign');
+ assert.looksNative(assign);
foo = {
q: 1
};
@@ -2209,16 +2200,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Object.is', function(assert){
var same;
same = Object.is;
- assert.ok(toString$.call(same).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(same.length, 2, 'arity is 2');
- assert.strictEqual(same.name, 'is', 'name is "is"');
- assert.ok(/native code/.test(same), 'looks like native');
+ assert.isFunction(same);
+ assert.arity(same, 2);
+ assert.name(same, 'is');
+ assert.looksNative(same);
assert.ok(same(1, 1), '1 is 1');
assert.ok(same(NaN, NaN), '1 is 1');
assert.ok(!same(0, -0), '0 isnt -0');
@@ -2228,17 +2219,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
if (Object.setPrototypeOf || '__proto__' in Object.prototype) {
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Object.setPrototypeOf', function(assert){
var setPrototypeOf, tmp;
setPrototypeOf = Object.setPrototypeOf;
- assert.ok(toString$.call(setPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(setPrototypeOf.length, 2, 'arity is 2');
- assert.strictEqual(setPrototypeOf.name, 'setPrototypeOf', 'name is "setPrototypeOf"');
- assert.ok(/native code/.test(setPrototypeOf), 'looks like native');
+ assert.isFunction(setPrototypeOf);
+ assert.arity(setPrototypeOf, 2);
+ assert.name(setPrototypeOf, 'setPrototypeOf');
+ assert.looksNative(setPrototypeOf);
assert.ok('apply' in setPrototypeOf({}, Function.prototype), 'Parent properties in target');
assert.strictEqual(setPrototypeOf({
a: 2
@@ -2316,9 +2307,9 @@
module('ES6');
test('Object#toString', function(assert){
var toString, Class;
- assert.strictEqual(Object.prototype.toString.length, 0, 'arity is 0');
- assert.strictEqual(Object.prototype.toString.name, 'toString', 'name is "toString"');
- assert.ok(/native code/.test(Object.prototype.toString), 'looks like native');
+ assert.arity(Object.prototype.toString, 0);
+ assert.name(Object.prototype.toString, 'toString');
+ assert.looksNative(Object.prototype.toString);
toString = Object.prototype.toString;
if (!function(){
return this;
@@ -2367,39 +2358,36 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, iterator, toString$ = {}.toString;
+ var module, test, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
iterator = Symbol.iterator;
test('Promise', function(assert){
- assert.ok(isFunction(((typeof global != 'undefined' && global !== null) && global || window).Promise), 'is function');
- assert.strictEqual(Promise.length, 1, 'arity is 1');
- assert.strictEqual(Promise.name, 'Promise', 'name is "Promise"');
- return assert.ok(/native code/.test(Promise), 'looks like native');
+ assert.isFunction(Promise);
+ assert.arity(Promise, 1);
+ assert.name(Promise, 'Promise');
+ return assert.looksNative(Promise);
});
test('Promise#then', function(assert){
- assert.ok(isFunction(Promise.prototype.then), 'is function');
- assert.strictEqual(Promise.prototype.then.length, 2, 'arity is 2');
- assert.strictEqual(Promise.prototype.then.name, 'then', 'name is "then"');
- return assert.ok(/native code/.test(Promise.prototype.then), 'looks like native');
+ assert.isFunction(Promise.prototype.then);
+ assert.arity(Promise.prototype.then, 2);
+ assert.name(Promise.prototype.then, 'then');
+ return assert.looksNative(Promise.prototype.then);
});
test('Promise#catch', function(assert){
- assert.ok(isFunction(Promise.prototype['catch']), 'is function');
- assert.strictEqual(Promise.prototype['catch'].length, 1, 'arity is 1');
- return assert.ok(/native code/.test(Promise.prototype.then), 'looks like native');
+ assert.isFunction(Promise.prototype['catch']);
+ assert.arity(Promise.prototype['catch'], 1);
+ return assert.looksNative(Promise.prototype.then);
});
test('Promise#@@toStringTag', function(assert){
return assert.ok(Promise.prototype[Symbol.toStringTag] === 'Promise', 'Promise::@@toStringTag is `Promise`');
});
test('Promise.all', function(assert){
var passed, iter, next, a, done;
- assert.ok(isFunction(Promise.all), 'is function');
- assert.strictEqual(Promise.all.length, 1, 'arity is 1');
- assert.strictEqual(Promise.all.name, 'all', 'name is "all"');
- assert.ok(/native code/.test(Promise.all), 'looks like native');
+ assert.isFunction(Promise.all);
+ assert.arity(Promise.all, 1);
+ assert.name(Promise.all, 'all');
+ assert.looksNative(Promise.all);
passed = false;
iter = [1, 2, 3].values();
next = bind$(iter, 'next');
@@ -2420,10 +2408,10 @@
});
test('Promise.race', function(assert){
var passed, iter, next, a, done;
- assert.ok(isFunction(Promise.race), 'is function');
- assert.strictEqual(Promise.race.length, 1, 'arity is 1');
- assert.strictEqual(Promise.race.name, 'race', 'name is "race"');
- assert.ok(/native code/.test(Promise.race), 'looks like native');
+ assert.isFunction(Promise.race);
+ assert.arity(Promise.race, 1);
+ assert.name(Promise.race, 'race');
+ assert.looksNative(Promise.race);
passed = false;
iter = [1, 2, 3].values();
next = bind$(iter, 'next');
@@ -2443,16 +2431,16 @@
return assert.ok(done);
});
test('Promise.resolve', function(assert){
- assert.ok(isFunction(Promise.resolve), 'is function');
- assert.strictEqual(Promise.resolve.length, 1, 'arity is 1');
- assert.strictEqual(Promise.resolve.name, 'resolve', 'name is "resolve"');
- return assert.ok(/native code/.test(Promise.resolve), 'looks like native');
+ assert.isFunction(Promise.resolve);
+ assert.arity(Promise.resolve, 1);
+ assert.name(Promise.resolve, 'resolve');
+ return assert.looksNative(Promise.resolve);
});
test('Promise.reject', function(assert){
- assert.ok(isFunction(Promise.reject), 'is function');
- assert.strictEqual(Promise.reject.length, 1, 'arity is 1');
- assert.strictEqual(Promise.reject.name, 'reject', 'name is "reject"');
- return assert.ok(/native code/.test(Promise.reject), 'looks like native');
+ assert.isFunction(Promise.reject);
+ assert.arity(Promise.reject, 1);
+ assert.name(Promise.reject, 'reject');
+ return assert.looksNative(Promise.reject);
});
if (Object.setPrototypeOf) {
test('Promise subclassing', function(assert){
@@ -2497,16 +2485,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.apply', function(assert){
var apply, C;
apply = Reflect.apply;
- assert.ok(toString$.call(apply).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(apply.length, 3, 'arity is 3');
- assert.ok(/native code/.test(apply), 'looks like native');
- assert.strictEqual(apply.name, 'apply', 'name is "apply"');
+ assert.isFunction(apply);
+ assert.arity(apply, 3);
+ assert.name(apply, 'apply');
+ assert.looksNative(apply);
assert.strictEqual(apply(Array.prototype.push, [1, 2], [3, 4, 5]), 5);
C = function(a, b, c){
return a + b + c;
@@ -2521,17 +2509,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, getPrototypeOf, toString$ = {}.toString;
+ var module, test, getPrototypeOf;
module = QUnit.module, test = QUnit.test;
module('ES6');
getPrototypeOf = Object.getPrototypeOf;
test('Reflect.construct', function(assert){
var construct, C, inst, f, e;
construct = Reflect.construct;
- assert.ok(toString$.call(construct).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(construct.length, 2, 'arity is 2');
- assert.ok(/native code/.test(construct), 'looks like native');
- assert.strictEqual(construct.name, 'construct', 'name is "construct"');
+ assert.isFunction(construct);
+ assert.arity(construct, 2);
+ assert.name(construct, 'construct');
+ assert.looksNative(construct);
C = function(a, b, c){
return this.qux = a + b + c;
};
@@ -2562,7 +2550,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, getOwnPropertyDescriptor, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, getOwnPropertyDescriptor, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
@@ -2578,10 +2566,10 @@
test('Reflect.defineProperty', function(assert){
var defineProperty, O;
defineProperty = Reflect.defineProperty;
- assert.ok(toString$.call(defineProperty).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(defineProperty.length, 3, 'arity is 3');
- assert.ok(/native code/.test(defineProperty), 'looks like native');
- assert.strictEqual(defineProperty.name, 'defineProperty', 'name is "defineProperty"');
+ assert.isFunction(defineProperty);
+ assert.arity(defineProperty, 3);
+ assert.name(defineProperty, 'defineProperty');
+ assert.looksNative(defineProperty);
O = {};
assert.strictEqual(defineProperty(O, 'foo', {
value: 123
@@ -2613,7 +2601,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty;
@@ -2629,10 +2617,10 @@
test('Reflect.deleteProperty', function(assert){
var deleteProperty, O;
deleteProperty = Reflect.deleteProperty;
- assert.ok(toString$.call(deleteProperty).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(deleteProperty.length, 2, 'arity is 2');
- assert.ok(/native code/.test(deleteProperty), 'looks like native');
- assert.strictEqual(deleteProperty.name, 'deleteProperty', 'name is "deleteProperty"');
+ assert.isFunction(deleteProperty);
+ assert.arity(deleteProperty, 2);
+ assert.name(deleteProperty, 'deleteProperty');
+ assert.looksNative(deleteProperty);
O = {
bar: 456
};
@@ -2656,7 +2644,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, from, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, from, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty;
@@ -2674,10 +2662,10 @@
var enumerate, iterator, obj, i, ref$;
enumerate = Reflect.enumerate;
iterator = Symbol.iterator;
- assert.ok(toString$.call(enumerate).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(enumerate.length, 1, 'arity is 1');
- assert.ok(/native code/.test(enumerate), 'looks like native');
- assert.strictEqual(enumerate.name, 'enumerate', 'name is "enumerate"');
+ assert.isFunction(enumerate);
+ assert.arity(enumerate, 1);
+ assert.name(enumerate, 'enumerate');
+ assert.looksNative(enumerate);
obj = {
foo: 1,
bar: 2
@@ -2711,16 +2699,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.getOwnPropertyDescriptor', function(assert){
var getOwnPropertyDescriptor, obj, desc;
getOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
- assert.ok(toString$.call(getOwnPropertyDescriptor).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getOwnPropertyDescriptor.length, 2, 'arity is 2');
- assert.ok(/native code/.test(getOwnPropertyDescriptor), 'looks like native');
- assert.strictEqual(getOwnPropertyDescriptor.name, 'getOwnPropertyDescriptor', 'name is "getOwnPropertyDescriptor"');
+ assert.isFunction(getOwnPropertyDescriptor);
+ assert.arity(getOwnPropertyDescriptor, 2);
+ assert.name(getOwnPropertyDescriptor, 'getOwnPropertyDescriptor');
+ assert.looksNative(getOwnPropertyDescriptor);
obj = {
baz: 789
};
@@ -2734,16 +2722,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.getPrototypeOf', function(assert){
var getPrototypeOf;
getPrototypeOf = Reflect.getPrototypeOf;
- assert.ok(toString$.call(getPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getPrototypeOf.length, 1, 'arity is 1');
- assert.ok(/native code/.test(getPrototypeOf), 'looks like native');
- assert.strictEqual(getPrototypeOf.name, 'getPrototypeOf', 'name is "getPrototypeOf"');
+ assert.isFunction(getPrototypeOf);
+ assert.arity(getPrototypeOf, 1);
+ assert.name(getPrototypeOf, 'getPrototypeOf');
+ assert.looksNative(getPrototypeOf);
assert.strictEqual(getPrototypeOf([]), Array.prototype);
return assert.throws(function(){
return getPrototypeOf(42);
@@ -2753,7 +2741,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, create, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, create, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, create = Object.create;
@@ -2769,9 +2757,9 @@
test('Reflect.get', function(assert){
var get, target, receiver;
get = Reflect.get;
- assert.ok(toString$.call(get).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(get), 'looks like native');
- assert.strictEqual(get.name, 'get', 'name is "get"');
+ assert.isFunction(get);
+ assert.name(get, 'get');
+ assert.looksNative(get);
assert.strictEqual(get({
qux: 987
}, 'qux'), 987);
@@ -2807,16 +2795,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.has', function(assert){
var has, O;
has = Reflect.has;
- assert.ok(toString$.call(has).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(has.length, 2, 'arity is 2');
- assert.ok(/native code/.test(has), 'looks like native');
- assert.strictEqual(has.name, 'has', 'name is "has"');
+ assert.isFunction(has);
+ assert.arity(has, 2);
+ assert.name(has, 'has');
+ assert.looksNative(has);
O = {
qux: 987
};
@@ -2831,7 +2819,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, preventExtensions, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, preventExtensions, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, preventExtensions = Object.preventExtensions;
@@ -2847,10 +2835,10 @@
test('Reflect.isExtensible', function(assert){
var isExtensible;
isExtensible = Reflect.isExtensible;
- assert.ok(toString$.call(isExtensible).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isExtensible.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isExtensible), 'looks like native');
- assert.strictEqual(isExtensible.name, 'isExtensible', 'name is "isExtensible"');
+ assert.isFunction(isExtensible);
+ assert.arity(isExtensible, 1);
+ assert.name(isExtensible, 'isExtensible');
+ assert.looksNative(isExtensible);
assert.ok(isExtensible({}));
if (MODERN) {
assert.ok(!isExtensible(preventExtensions({})));
@@ -2863,7 +2851,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, toString$ = {}.toString;
+ var module, test, defineProperty;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty;
@@ -2871,10 +2859,10 @@
var ownKeys, sym, O1, keys, O2;
ownKeys = Reflect.ownKeys;
sym = Symbol('c');
- assert.ok(toString$.call(ownKeys).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(ownKeys.length, 1, 'arity is 1');
- assert.ok(/native code/.test(ownKeys), 'looks like native');
- assert.strictEqual(ownKeys.name, 'ownKeys', 'name is "ownKeys"');
+ assert.isFunction(ownKeys);
+ assert.arity(ownKeys, 1);
+ assert.name(ownKeys, 'ownKeys');
+ assert.looksNative(ownKeys);
O1 = {
a: 1
};
@@ -2907,7 +2895,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, isExtensible, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, isExtensible, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, isExtensible = Object.isExtensible;
@@ -2923,10 +2911,10 @@
test('Reflect.preventExtensions', function(assert){
var preventExtensions, obj;
preventExtensions = Reflect.preventExtensions;
- assert.ok(toString$.call(preventExtensions).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(preventExtensions.length, 1, 'arity is 1');
- assert.ok(/native code/.test(preventExtensions), 'looks like native');
- assert.strictEqual(preventExtensions.name, 'preventExtensions', 'name is "preventExtensions"');
+ assert.isFunction(preventExtensions);
+ assert.arity(preventExtensions, 1);
+ assert.name(preventExtensions, 'preventExtensions');
+ assert.looksNative(preventExtensions);
obj = {};
assert.ok(preventExtensions(obj), true);
if (MODERN) {
@@ -2940,16 +2928,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
if (Object.setPrototypeOf || '__proto__' in {}) {
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.setPrototypeOf', function(assert){
var setPrototypeOf, obj, o;
setPrototypeOf = Reflect.setPrototypeOf;
- assert.ok(toString$.call(setPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(setPrototypeOf), 'looks like native');
- assert.strictEqual(setPrototypeOf.name, 'setPrototypeOf', 'name is "setPrototypeOf"');
+ assert.isFunction(setPrototypeOf);
+ assert.name(setPrototypeOf, 'setPrototypeOf');
+ assert.looksNative(setPrototypeOf);
obj = {};
assert.ok(setPrototypeOf(obj, Array.prototype), true);
assert.ok(obj instanceof Array);
@@ -2966,7 +2954,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, getOwnPropertyDescriptor, create, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, getOwnPropertyDescriptor, create, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, create = Object.create;
@@ -2982,9 +2970,9 @@
test('Reflect.set', function(assert){
var set, obj, target, receiver, out;
set = Reflect.set;
- assert.ok(toString$.call(set).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(set), 'looks like native');
- assert.strictEqual(set.name, 'set', 'name is "set"');
+ assert.isFunction(set);
+ assert.name(set, 'set');
+ assert.looksNative(set);
obj = {};
assert.ok(set(obj, 'quux', 654), true);
assert.strictEqual(obj.quux, 654);
@@ -3063,10 +3051,10 @@
}()) {
test('RegExp constructor', function(assert){
var re, O, i$, len$, index, val, results$ = [];
- assert.strictEqual(toString$.call(RegExp).slice(8, -1), 'Function', 'is function');
- assert.strictEqual(RegExp.length, 2, 'arity is 2');
- assert.ok(/native code/.test(RegExp), 'looks like native');
- assert.strictEqual(RegExp.name, 'RegExp', 'name is "RegExp"');
+ assert.isFunction(RegExp);
+ assert.arity(RegExp, 2);
+ assert.name(RegExp, 'RegExp');
+ assert.looksNative(RegExp);
assert.strictEqual(toString$.call(RegExp()).slice(8, -1), 'RegExp');
assert.strictEqual(toString$.call(new RegExp()).slice(8, -1), 'RegExp');
re = /a/g;
@@ -3123,16 +3111,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, global, toString$ = {}.toString;
+ var module, test, global;
module = QUnit.module, test = QUnit.test;
module('ES6');
global = Function('return this')();
test('String#match regression', function(assert){
var instance, matched, expected, obj, str, x, e, reg, string, matches, i$, len$, i, re, num;
- assert.ok(toString$.call(''.match).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.match.length, 1, 'arity is 1');
- assert.ok(/native code/.test(''.match), 'looks like native');
- assert.strictEqual(''.match.name, 'match', 'name is "match"');
+ assert.isFunction(''.match);
+ assert.arity(''.match, 1);
+ assert.name(''.match, 'match');
+ assert.looksNative(''.match);
instance = Object(true);
instance.match = String.prototype.match;
assert.strictEqual(instance.match(true)[0], 'true', 'S15.5.4.10_A1_T1');
@@ -3335,8 +3323,8 @@
});
test('RegExp#@@match', function(assert){
var string, matches, i$, len$, i, results$ = [];
- assert.ok(toString$.call(/./[Symbol.match]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.match].length, 1, 'arity is 1');
+ assert.isFunction(/./[Symbol.match]);
+ assert.arity(/./[Symbol.match], 1);
string = "Boston, MA 02134";
matches = ['02134', '02134', void 8];
assert.strictEqual(/([\d]{5})([-\ ]?[\d]{4})?$/[Symbol.match](string).length, 3);
@@ -3379,15 +3367,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#replace regression', function(assert){
var instance, e;
- assert.ok(toString$.call(''.replace).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.replace.length, 2, 'arity is 2');
- assert.ok(/native code/.test(''.replace), 'looks like native');
- assert.strictEqual(''.replace.name, 'replace', 'name is "replace"');
+ assert.isFunction(''.replace);
+ assert.arity(''.replace, 2);
+ assert.name(''.replace, 'replace');
+ assert.looksNative(''.replace);
instance = Object(true);
instance.replace = String.prototype.replace;
assert.strictEqual(instance.replace(true, 1), '1', 'S15.5.4.11_A1_T1');
@@ -3494,8 +3482,8 @@
return assert.strictEqual('aaaaaaaaaa,aaaaaaaaaaaaaaa'.replace(/^(a+)\1*,\1+$/, '$1'), 'aaaaa', 'S15.5.4.11_A5_T1');
});
test('RegExp#@@replace', function(assert){
- assert.ok(toString$.call(/./[Symbol.replace]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.replace].length, 2, 'arity is 2');
+ assert.isFunction(/./[Symbol.replace]);
+ assert.arity(/./[Symbol.replace], 2);
return assert.strictEqual(/([a-z]+)([0-9]+)/[Symbol.replace]('abc12 def34', function(){
return arguments[2] + arguments[1];
}), '12abc def34');
@@ -3538,15 +3526,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#search regression', function(assert){
var instance, e, aString;
- assert.ok(toString$.call(''.search).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.search.length, 1, 'arity is 1');
- assert.ok(/native code/.test(''.search), 'looks like native');
- assert.strictEqual(''.search.name, 'search', 'name is "search"');
+ assert.isFunction(''.search);
+ assert.arity(''.search, 1);
+ assert.name(''.search, 'search');
+ assert.looksNative(''.search);
instance = Object(true);
instance.search = String.prototype.search;
assert.strictEqual(instance.search(true), 0, 'S15.5.4.12_A1_T1');
@@ -3613,8 +3601,8 @@
return assert.strictEqual(aString.search(/of/), aString.search(/of/g), 'S15.5.4.12_A3_T2');
});
test('RegExp#@@search', function(assert){
- assert.ok(toString$.call(/./[Symbol.search]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.search].length, 1, 'arity is 1');
+ assert.isFunction(/./[Symbol.search]);
+ assert.arity(/./[Symbol.search], 1);
assert.strictEqual(/four/[Symbol.search]('one two three four five'), 14);
return assert.strictEqual(/Four/[Symbol.search]('one two three four five'), -1);
});
@@ -3650,15 +3638,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#split regression', function(assert){
var instance, split, e, string, i$, to$, i, expected, results$ = [];
- assert.ok(toString$.call(''.split).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.split.length, 2, 'arity is 2');
- assert.ok(/native code/.test(''.split), 'looks like native');
- assert.strictEqual(''.split.name, 'split', 'name is "split"');
+ assert.isFunction(''.split);
+ assert.arity(''.split, 2);
+ assert.name(''.split, 'split');
+ assert.looksNative(''.split);
instance = Object(true);
instance.split = String.prototype.split;
split = instance.split(true, false);
@@ -4249,8 +4237,8 @@
return results$;
});
test('RegExp#@@split', function(assert){
- assert.ok(toString$.call(/./[Symbol.split]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.split].length, 2, 'arity is 2');
+ assert.isFunction(/./[Symbol.split]);
+ assert.arity(/./[Symbol.split], 2);
assert.strictEqual(/\s/[Symbol.split]('a b c de f').length, 5);
assert.strictEqual(/\s/[Symbol.split]('a b c de f', void 8).length, 5);
assert.strictEqual(/\s/[Symbol.split]('a b c de f', 1).length, 1);
@@ -4294,14 +4282,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, same, getOwnPropertyDescriptor, freeze, iterator, toString$ = {}.toString;
+ var module, test, isIterator, same, getOwnPropertyDescriptor, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
same = function(a, b){
if (a === b) {
@@ -4314,10 +4299,10 @@
iterator = Symbol.iterator;
test('Set', function(assert){
var S, r, done, iter, _add, a;
- assert.ok(isFunction(Set), 'is function');
- assert.ok(/native code/.test(Set), 'looks like native');
- assert.strictEqual(Set.name, 'Set', 'name is "Set"');
- assert.strictEqual(Set.length, 0, 'arity is 0');
+ assert.isFunction(Set);
+ assert.name(Set, 'Set');
+ assert.arity(Set, 0);
+ assert.looksNative(Set);
assert.ok('add' in Set.prototype, 'add in Set.prototype');
assert.ok('clear' in Set.prototype, 'clear in Set.prototype');
assert.ok('delete' in Set.prototype, 'delete in Set.prototype');
@@ -4363,10 +4348,10 @@
});
test('Set#add', function(assert){
var a, S, chain, f;
- assert.ok(isFunction(Set.prototype.add), 'is function');
- assert.strictEqual(Set.prototype.add.name, 'add', 'name is "add"');
- assert.strictEqual(Set.prototype.add.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype.add), 'looks like native');
+ assert.isFunction(Set.prototype.add);
+ assert.name(Set.prototype.add, 'add');
+ assert.arity(Set.prototype.add, 1);
+ assert.looksNative(Set.prototype.add);
a = [];
S = new Set([NaN, 2, 3, 2, 1, a]);
assert.strictEqual(S.size, 5);
@@ -4386,10 +4371,10 @@
});
test('Set#clear', function(assert){
var S, f;
- assert.ok(isFunction(Set.prototype.clear), 'is function');
- assert.strictEqual(Set.prototype.clear.name, 'clear', 'name is "clear"');
- assert.strictEqual(Set.prototype.clear.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.clear), 'looks like native');
+ assert.isFunction(Set.prototype.clear);
+ assert.name(Set.prototype.clear, 'clear');
+ assert.arity(Set.prototype.clear, 0);
+ assert.looksNative(Set.prototype.clear);
S = new Set;
S.clear();
assert.strictEqual(S.size, 0);
@@ -4407,9 +4392,9 @@
});
test('Set#delete', function(assert){
var a, S, f;
- assert.ok(isFunction(Set.prototype['delete']), 'is function');
- assert.strictEqual(Set.prototype['delete'].length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype['delete']), 'looks like native');
+ assert.isFunction(Set.prototype['delete']);
+ assert.arity(Set.prototype['delete'], 1);
+ assert.looksNative(Set.prototype['delete']);
a = [];
S = new Set([NaN, 2, 3, 2, 1, a]);
assert.strictEqual(S.size, 5);
@@ -4428,10 +4413,10 @@
});
test('Set#forEach', function(assert){
var r, count, S, set, s;
- assert.ok(isFunction(Set.prototype.forEach), 'is function');
- assert.strictEqual(Set.prototype.forEach.name, 'forEach', 'name is "forEach"');
- assert.strictEqual(Set.prototype.forEach.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype.forEach), 'looks like native');
+ assert.isFunction(Set.prototype.forEach);
+ assert.name(Set.prototype.forEach, 'forEach');
+ assert.arity(Set.prototype.forEach, 1);
+ assert.looksNative(Set.prototype.forEach);
r = [];
count = 0;
S = new Set([1, 2, 3, 2, 1]);
@@ -4466,10 +4451,10 @@
});
test('Set#has', function(assert){
var a, f, S;
- assert.ok(isFunction(Set.prototype.has), 'is function');
- assert.strictEqual(Set.prototype.has.name, 'has', 'name is "has"');
- assert.strictEqual(Set.prototype.has.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype.has), 'looks like native');
+ assert.isFunction(Set.prototype.has);
+ assert.name(Set.prototype.has, 'has');
+ assert.arity(Set.prototype.has, 1);
+ assert.looksNative(Set.prototype.has);
a = [];
f = freeze({});
S = new Set([NaN, 2, 3, 2, 1, f, a]);
@@ -4542,9 +4527,9 @@
test('Set#keys', function(assert){
var iter;
assert.ok(typeof Set.prototype.keys === 'function', 'is function');
- assert.strictEqual(Set.prototype.keys.name, 'values', 'name is "values"');
- assert.strictEqual(Set.prototype.keys.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.keys), 'looks like native');
+ assert.name(Set.prototype.keys, 'values');
+ assert.arity(Set.prototype.keys, 0);
+ assert.looksNative(Set.prototype.keys);
assert.strictEqual(Set.prototype.keys, Set.prototype.values);
iter = new Set(['q', 'w', 'e']).keys();
assert.ok(isIterator(iter), 'Return iterator');
@@ -4569,9 +4554,9 @@
test('Set#values', function(assert){
var iter;
assert.ok(typeof Set.prototype.values === 'function', 'is function');
- assert.strictEqual(Set.prototype.values.name, 'values', 'name is "values"');
- assert.strictEqual(Set.prototype.values.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.values), 'looks like native');
+ assert.name(Set.prototype.values, 'values');
+ assert.arity(Set.prototype.values, 0);
+ assert.looksNative(Set.prototype.values);
iter = new Set(['q', 'w', 'e']).values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -4595,9 +4580,9 @@
test('Set#entries', function(assert){
var iter;
assert.ok(typeof Set.prototype.entries === 'function', 'is function');
- assert.strictEqual(Set.prototype.entries.name, 'entries', 'name is "entries"');
- assert.strictEqual(Set.prototype.entries.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.entries), 'looks like native');
+ assert.name(Set.prototype.entries, 'entries');
+ assert.arity(Set.prototype.entries, 0);
+ assert.looksNative(Set.prototype.entries);
iter = new Set(['q', 'w', 'e']).entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -4621,9 +4606,9 @@
test('Set#@@iterator', function(assert){
var iter;
assert.ok(typeof Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8] === 'function', 'is function');
- assert.strictEqual(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8].name, 'values', 'name is "values"');
- assert.strictEqual(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8].length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'looks like native');
+ assert.name(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], 'values');
+ assert.arity(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], 0);
+ assert.looksNative(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
assert.strictEqual(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], Set.prototype.values);
iter = new Set(['q', 'w', 'e'])[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
@@ -4650,14 +4635,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#codePointAt', function(assert){
- assert.ok(toString$.call(String.prototype.codePointAt).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.codePointAt.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.codePointAt), 'looks like native');
- assert.strictEqual(String.prototype.codePointAt.name, 'codePointAt', 'name is "codePointAt"');
+ assert.isFunction(String.prototype.codePointAt);
+ assert.arity(String.prototype.codePointAt, 1);
+ assert.name(String.prototype.codePointAt, 'codePointAt');
+ assert.looksNative(String.prototype.codePointAt);
assert.strictEqual('abc\uD834\uDF06def'.codePointAt(''), 0x61);
assert.strictEqual('abc\uD834\uDF06def'.codePointAt('_'), 0x61);
assert.strictEqual('abc\uD834\uDF06def'.codePointAt(), 0x61);
@@ -4723,15 +4708,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#endsWith', function(assert){
var re, e, O;
- assert.ok(toString$.call(String.prototype.endsWith).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.endsWith.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.endsWith), 'looks like native');
- assert.strictEqual(String.prototype.endsWith.name, 'endsWith', 'name is "endsWith"');
+ assert.isFunction(String.prototype.endsWith);
+ assert.arity(String.prototype.endsWith, 1);
+ assert.name(String.prototype.endsWith, 'endsWith');
+ assert.looksNative(String.prototype.endsWith);
assert.ok('undefined'.endsWith());
assert.ok(!'undefined'.endsWith(null));
assert.ok('abc'.endsWith(''));
@@ -4786,16 +4771,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String.fromCodePoint', function(assert){
var fromCodePoint, tmp, counter, result;
fromCodePoint = String.fromCodePoint;
- assert.ok(toString$.call(fromCodePoint).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(fromCodePoint.length, 1, 'arity is 1');
- assert.ok(/native code/.test(fromCodePoint), 'looks like native');
- assert.strictEqual(fromCodePoint.name, 'fromCodePoint', 'name is "fromCodePoint"');
+ assert.isFunction(fromCodePoint);
+ assert.arity(fromCodePoint, 1);
+ assert.name(fromCodePoint, 'fromCodePoint');
+ assert.looksNative(fromCodePoint);
assert.strictEqual(fromCodePoint(''), '\0');
assert.strictEqual(fromCodePoint(), '');
assert.strictEqual(fromCodePoint(-0), '\0');
@@ -4869,15 +4854,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#includes', function(assert){
var re, e, O;
- assert.ok(toString$.call(String.prototype.includes).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.includes.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.includes), 'looks like native');
- assert.strictEqual(String.prototype.includes.name, 'includes', 'name is "includes"');
+ assert.isFunction(String.prototype.includes);
+ assert.arity(String.prototype.includes, 1);
+ assert.name(String.prototype.includes, 'includes');
+ assert.looksNative(String.prototype.includes);
assert.ok(!'abc'.includes());
assert.ok('aundefinedb'.includes());
assert.ok('abcd'.includes('b', 1));
@@ -4923,18 +4908,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, toString$ = {}.toString;
+ var module, test, isIterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
test('String#@@iterator', function(assert){
var iter;
- assert.ok(isFunction(String.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'is function');
+ assert.isFunction(String.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
iter = 'qwe'[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'String Iterator');
@@ -4977,16 +4959,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String.raw', function(assert){
var raw;
raw = String.raw;
- assert.ok(toString$.call(raw).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(raw.length, 1, 'arity is 1');
- assert.ok(/native code/.test(raw), 'looks like native');
- assert.strictEqual(raw.name, 'raw', 'name is "raw"');
+ assert.isFunction(raw);
+ assert.arity(raw, 1);
+ assert.name(raw, 'raw');
+ assert.looksNative(raw);
assert.strictEqual(raw({
raw: ['Hi\\n', '!']
}, 'Bob'), 'Hi\\nBob!', 'raw is array');
@@ -5010,14 +4992,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#repeat', function(assert){
- assert.ok(toString$.call(String.prototype.repeat).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.repeat.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.repeat), 'looks like native');
- assert.strictEqual(String.prototype.repeat.name, 'repeat', 'name is "repeat"');
+ assert.isFunction(String.prototype.repeat);
+ assert.arity(String.prototype.repeat, 1);
+ assert.name(String.prototype.repeat, 'repeat');
+ assert.looksNative(String.prototype.repeat);
assert.strictEqual('qwe'.repeat(3), 'qweqweqwe');
assert.strictEqual('qwe'.repeat(2.5), 'qweqwe');
assert.throws(function(){
@@ -5042,15 +5024,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#startsWith', function(assert){
var re, e, O;
- assert.ok(toString$.call(String.prototype.startsWith).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.startsWith.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.startsWith), 'looks like native');
- assert.strictEqual(String.prototype.startsWith.name, 'startsWith', 'name is "startsWith"');
+ assert.isFunction(String.prototype.startsWith);
+ assert.arity(String.prototype.startsWith, 1);
+ assert.name(String.prototype.startsWith, 'startsWith');
+ assert.looksNative(String.prototype.startsWith);
assert.ok('undefined'.startsWith());
assert.ok(!'undefined'.startsWith(null));
assert.ok('abc'.startsWith(''));
@@ -5105,14 +5087,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#trim', function(assert){
- assert.ok(toString$.call(''.trim).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.trim.length, 0, 'arity is 0');
- assert.ok(/native code/.test(String.prototype.trim), 'looks like native');
- assert.strictEqual(String.prototype.trim.name, 'trim', 'name is "trim"');
+ assert.isFunction(''.trim);
+ assert.arity(String.prototype.trim, 0);
+ assert.name(String.prototype.trim, 'trim');
+ assert.looksNative(String.prototype.trim);
assert.strictEqual(' \n q w e \n '.trim(), 'q w e', 'removes whitespaces at left & right side of string');
assert.strictEqual('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'.trim(), '', 'removes all whitespaces');
assert.strictEqual('\u200b\u0085'.trim(), '\u200b\u0085', "shouldn't remove this symbols");
@@ -5131,16 +5113,10 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, getOwnPropertyDescriptor, create, isFunction, isNative, descriptors, G, i$, ref$, len$, key, toString$ = {}.toString;
+ var module, test, defineProperty, getOwnPropertyDescriptor, create, descriptors, G, i$, ref$, len$, key;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, create = Object.create;
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
- isNative = function(it){
- return /\[native code\]\s*\}\s*$/.test(it);
- };
descriptors = function(){
try {
return 2 === Object.defineProperty({}, 'a', {
@@ -5153,9 +5129,9 @@
G = (typeof global != 'undefined' && global !== null) && global || window;
test('Symbol', function(assert){
var s1, s2, O, count, i;
- assert.ok(isFunction(Symbol), 'is function');
- assert.strictEqual(Symbol.name, 'Symbol', 'name is "Symbol"');
- assert.ok(/native code/.test(Symbol), 'looks like native');
+ assert.isFunction(Symbol);
+ assert.name(Symbol, 'Symbol');
+ assert.looksNative(Symbol);
s1 = Symbol('foo');
s2 = Symbol('foo');
assert.ok(s1 !== s2, 'Symbol("foo") !== Symbol("foo")');
@@ -5182,10 +5158,10 @@
});
test('Global symbol registry', function(assert){
var symbol;
- assert.ok(isFunction(Symbol['for']), 'Symbol.for is function');
+ assert.isFunction(Symbol['for'], 'Symbol.for is function');
assert.strictEqual(Symbol['for'].length, 1, 'Symbol.for arity is 1');
assert.ok(/native code/.test(Symbol['for']), 'Symbol.for looks like native');
- assert.ok(isFunction(Symbol.keyFor), 'Symbol.keyFor is function');
+ assert.isFunction(Symbol.keyFor, 'Symbol.keyFor is function');
assert.strictEqual(Symbol.keyFor.length, 1, 'Symbol.keyFor arity is 1');
assert.strictEqual(Symbol.keyFor.name, 'keyFor', 'Symbol.keyFor.name is "keyFor"');
assert.ok(/native code/.test(Symbol.keyFor), 'Symbol.keyFor looks like native');
@@ -5199,10 +5175,10 @@
test('Object.getOwnPropertySymbols', function(assert){
var getOwnPropertySymbols, getOwnPropertyNames, obj, foo, ref$;
getOwnPropertySymbols = Object.getOwnPropertySymbols, getOwnPropertyNames = Object.getOwnPropertyNames;
- assert.ok(isFunction(getOwnPropertySymbols), 'is function');
+ assert.isFunction(getOwnPropertySymbols);
assert.strictEqual(getOwnPropertySymbols.length, 1, 'arity is 1');
- assert.strictEqual(getOwnPropertySymbols.name, 'getOwnPropertySymbols', 'name is "getOwnPropertySymbols"');
- assert.ok(/native code/.test(getOwnPropertySymbols), 'looks like native');
+ assert.name(getOwnPropertySymbols, 'getOwnPropertySymbols');
+ assert.looksNative(getOwnPropertySymbols);
obj = {
q: 1,
w: 2,
@@ -5412,20 +5388,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, freeze, iterator, toString$ = {}.toString;
+ var module, test, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
freeze = Object.freeze;
iterator = Symbol.iterator;
test('WeakMap', function(assert){
var a, b, f, M, done, iter;
- assert.ok(isFunction(WeakMap), 'is function');
- assert.ok(/native code/.test(WeakMap), 'looks like native');
- assert.strictEqual(WeakMap.name, 'WeakMap', 'name is "WeakMap"');
- assert.strictEqual(WeakMap.length, 0, 'arity is 0');
+ assert.isFunction(WeakMap);
+ assert.name(WeakMap, 'WeakMap');
+ assert.arity(WeakMap, 0);
+ assert.looksNative(WeakMap);
assert.ok('delete' in WeakMap.prototype, 'delete in WeakMap.prototype');
assert.ok('get' in WeakMap.prototype, 'get in WeakMap.prototype');
assert.ok('has' in WeakMap.prototype, 'has in WeakMap.prototype');
@@ -5462,8 +5435,8 @@
});
test('WeakMap#delete', function(assert){
var M, a, b;
- assert.ok(isFunction(WeakMap.prototype['delete']), 'is function');
- assert.ok(/native code/.test(WeakMap.prototype['delete']), 'looks like native');
+ assert.isFunction(WeakMap.prototype['delete']);
+ assert.looksNative(WeakMap.prototype['delete']);
M = new WeakMap().set(a = {}, 42).set(b = {}, 21);
assert.ok(M.has(a) && M.has(b), 'WeakMap has values before .delete()');
M['delete'](a);
@@ -5471,9 +5444,9 @@
});
test('WeakMap#get', function(assert){
var M, a;
- assert.ok(isFunction(WeakMap.prototype.get), 'is function');
- assert.strictEqual(WeakMap.prototype.get.name, 'get', 'name is "get"');
- assert.ok(/native code/.test(WeakMap.prototype.get), 'looks like native');
+ assert.isFunction(WeakMap.prototype.get);
+ assert.name(WeakMap.prototype.get, 'get');
+ assert.looksNative(WeakMap.prototype.get);
M = new WeakMap();
assert.strictEqual(M.get({}), void 8, 'WeakMap .get() before .set() return undefined');
M.set(a = {}, 42);
@@ -5483,9 +5456,9 @@
});
test('WeakMap#has', function(assert){
var M, a;
- assert.ok(isFunction(WeakMap.prototype.has), 'is function');
- assert.strictEqual(WeakMap.prototype.has.name, 'has', 'name is "has"');
- assert.ok(/native code/.test(WeakMap.prototype.has), 'looks like native');
+ assert.isFunction(WeakMap.prototype.has);
+ assert.name(WeakMap.prototype.has, 'has');
+ assert.looksNative(WeakMap.prototype.has);
M = new WeakMap();
assert.ok(!M.has({}), 'WeakMap .has() before .set() return false');
M.set(a = {}, 42);
@@ -5495,10 +5468,10 @@
});
test('WeakMap#set', function(assert){
var a, e;
- assert.ok(isFunction(WeakMap.prototype.set), 'is function');
- assert.strictEqual(WeakMap.prototype.set.name, 'set', 'name is "set"');
- assert.strictEqual(WeakMap.prototype.set.length, 2, 'arity is 2');
- assert.ok(/native code/.test(WeakMap.prototype.set), 'looks like native');
+ assert.isFunction(WeakMap.prototype.set);
+ assert.name(WeakMap.prototype.set, 'set');
+ assert.arity(WeakMap.prototype.set, 2);
+ assert.looksNative(WeakMap.prototype.set);
assert.ok(new WeakMap().set(a = {}, 42), 'WeakMap.prototype.set works with object as keys');
return assert.ok((function(){
try {
@@ -5517,20 +5490,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, freeze, iterator, toString$ = {}.toString;
+ var module, test, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
freeze = Object.freeze;
iterator = Symbol.iterator;
test('WeakSet', function(assert){
var a, f, S, done, iter;
- assert.ok(isFunction(WeakSet), 'is function');
- assert.ok(/native code/.test(WeakSet), 'looks like native');
- assert.strictEqual(WeakSet.name, 'WeakSet', 'name is "WeakSet"');
- assert.strictEqual(WeakSet.length, 0, 'arity is 0');
+ assert.isFunction(WeakSet);
+ assert.name(WeakSet, 'WeakSet');
+ assert.arity(WeakSet, 0);
+ assert.looksNative(WeakSet);
assert.ok('add' in WeakSet.prototype, 'add in WeakSet.prototype');
assert.ok('delete' in WeakSet.prototype, 'delete in WeakSet.prototype');
assert.ok('has' in WeakSet.prototype, 'has in WeakSet.prototype');
@@ -5564,10 +5534,10 @@
});
test('WeakSet#add', function(assert){
var a, e;
- assert.ok(isFunction(WeakSet.prototype.add), 'is function');
- assert.strictEqual(WeakSet.prototype.add.name, 'add', 'name is "add"');
- assert.strictEqual(WeakSet.prototype.add.length, 1, 'arity is 1');
- assert.ok(/native code/.test(WeakSet.prototype.add), 'looks like native');
+ assert.isFunction(WeakSet.prototype.add);
+ assert.name(WeakSet.prototype.add, 'add');
+ assert.arity(WeakSet.prototype.add, 1);
+ assert.looksNative(WeakSet.prototype.add);
assert.ok(new WeakSet().add(a = {}), 'WeakSet.prototype.add works with object as keys');
return assert.ok((function(){
try {
@@ -5581,9 +5551,9 @@
});
test('WeakSet#delete', function(assert){
var S, a, b;
- assert.ok(isFunction(WeakSet.prototype['delete']), 'is function');
- assert.strictEqual(WeakSet.prototype['delete'].length, 1, 'arity is 1');
- assert.ok(/native code/.test(WeakSet.prototype['delete']), 'looks like native');
+ assert.isFunction(WeakSet.prototype['delete']);
+ assert.arity(WeakSet.prototype['delete'], 1);
+ assert.looksNative(WeakSet.prototype['delete']);
S = new WeakSet().add(a = {}).add(b = {});
assert.ok(S.has(a) && S.has(b), 'WeakSet has values before .delete()');
S['delete'](a);
@@ -5591,10 +5561,10 @@
});
test('WeakSet#has', function(assert){
var M, a;
- assert.ok(isFunction(WeakSet.prototype.has), 'is function');
- assert.strictEqual(WeakSet.prototype.has.name, 'has', 'name is "has"');
- assert.strictEqual(WeakSet.prototype.has.length, 1, 'arity is 1');
- assert.ok(/native code/.test(WeakSet.prototype.has), 'looks like native');
+ assert.isFunction(WeakSet.prototype.has);
+ assert.name(WeakSet.prototype.has, 'has');
+ assert.arity(WeakSet.prototype.has, 1);
+ assert.looksNative(WeakSet.prototype.has);
M = new WeakSet();
assert.ok(!M.has({}), 'WeakSet has`nt value');
M.add(a = {});
@@ -5610,15 +5580,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Array#includes', function(assert){
var arr, o;
- assert.ok(toString$.call(Array.prototype.includes).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.includes.name, 'includes', 'name is "includes"');
- assert.strictEqual(Array.prototype.includes.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.includes), 'looks like native');
+ assert.isFunction(Array.prototype.includes);
+ assert.name(Array.prototype.includes, 'includes');
+ assert.arity(Array.prototype.includes, 1);
+ assert.looksNative(Array.prototype.includes);
arr = [1, 2, 3, -0, o = {}];
assert.ok(arr.includes(1));
assert.ok(arr.includes(-0));
@@ -5645,14 +5615,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Map#toJSON', function(assert){
- assert.ok(toString$.call(Map.prototype.toJSON).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Map.prototype.toJSON.name, 'toJSON', 'name is "toJSON"');
- assert.strictEqual(Map.prototype.toJSON.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.toJSON), 'looks like native');
+ assert.isFunction(Map.prototype.toJSON);
+ assert.name(Map.prototype.toJSON, 'toJSON');
+ assert.arity(Map.prototype.toJSON, 0);
+ assert.looksNative(Map.prototype.toJSON);
if (typeof JSON != 'undefined' && JSON !== null) {
return assert.strictEqual(JSON.stringify(new Map([['a', 'b'], ['c', 'd']])), '[["a","b"],["c","d"]]', 'Works');
}
@@ -5661,16 +5631,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Object.entries', function(assert){
var entries, create, assign;
entries = Object.entries, create = Object.create, assign = Object.assign;
- assert.ok(toString$.call(entries).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(entries), 'looks like native');
- assert.strictEqual(entries.length, 1, 'arity is 1');
- assert.strictEqual(entries.name, 'entries', 'name is "entries"');
+ assert.isFunction(entries);
+ assert.arity(entries, 1);
+ assert.name(entries, 'entries');
+ assert.looksNative(entries);
assert.deepEqual(entries({
q: 1,
w: 2,
@@ -5694,7 +5664,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, descriptors, create, toString$ = {}.toString;
+ var module, test, descriptors, create;
module = QUnit.module, test = QUnit.test;
module('ES7');
descriptors = function(){
@@ -5710,10 +5680,10 @@
test('Object.getOwnPropertyDescriptors', function(assert){
var getOwnPropertyDescriptors, O, s, descs;
getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
- assert.ok(toString$.call(getOwnPropertyDescriptors).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getOwnPropertyDescriptors.length, 1, 'arity is 1');
- assert.strictEqual(getOwnPropertyDescriptors.name, 'getOwnPropertyDescriptors', 'name is "getOwnPropertyDescriptors"');
- assert.ok(/native code/.test(getOwnPropertyDescriptors), 'looks like native');
+ assert.isFunction(getOwnPropertyDescriptors);
+ assert.arity(getOwnPropertyDescriptors, 1);
+ assert.name(getOwnPropertyDescriptors, 'getOwnPropertyDescriptors');
+ assert.looksNative(getOwnPropertyDescriptors);
O = create({
q: 1
}, {
@@ -5753,16 +5723,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Object.values', function(assert){
var values, create, assign;
values = Object.values, create = Object.create, assign = Object.assign;
- assert.ok(toString$.call(values).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(values), 'looks like native');
- assert.strictEqual(values.length, 1, 'arity is 1');
- assert.strictEqual(values.name, 'values', 'name is "values"');
+ assert.isFunction(values);
+ assert.arity(values, 1);
+ assert.name(values, 'values');
+ assert.looksNative(values);
assert.deepEqual(values({
q: 1,
w: 2,
@@ -5786,16 +5756,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('RegExp.escape', function(assert){
var escape;
escape = RegExp.escape;
- assert.ok(toString$.call(escape).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(escape), 'looks like native');
- assert.strictEqual(escape.length, 1, 'arity is 1');
- assert.strictEqual(escape.name, 'escape', 'name is "escape"');
+ assert.isFunction(escape);
+ assert.arity(escape, 1);
+ assert.name(escape, 'escape');
+ assert.looksNative(escape);
assert.strictEqual(escape('qwe asd'), 'qwe asd', "Don't change simple string");
return assert.strictEqual(escape('\\[]{}()*+?.^$|'), '\\\\\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\^\\$\\|', 'Escape all RegExp special chars');
});
@@ -5803,14 +5773,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Set#toJSON', function(assert){
- assert.ok(toString$.call(Set.prototype.toJSON).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Set.prototype.toJSON.name, 'toJSON', 'name is "toJSON"');
- assert.strictEqual(Set.prototype.toJSON.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.toJSON), 'looks like native');
+ assert.isFunction(Set.prototype.toJSON);
+ assert.name(Set.prototype.toJSON, 'toJSON');
+ assert.arity(Set.prototype.toJSON, 0);
+ assert.looksNative(Set.prototype.toJSON);
if (typeof JSON != 'undefined' && JSON !== null) {
return assert.strictEqual(JSON.stringify(new Set([1, 2, 3, 2, 1])), '[1,2,3]', 'Works');
}
@@ -5820,15 +5790,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#at', function(assert){
var at;
- assert.ok(toString$.call(String.prototype.at).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.at.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.at), 'looks like native');
- assert.strictEqual(String.prototype.at.name, 'at', 'name is "at"');
+ assert.isFunction(String.prototype.at);
+ assert.arity(String.prototype.at, 1);
+ assert.name(String.prototype.at, 'at');
+ assert.looksNative(String.prototype.at);
assert.strictEqual('abc\uD834\uDF06def'.at(-Infinity), '');
assert.strictEqual('abc\uD834\uDF06def'.at(-1), '');
assert.strictEqual('abc\uD834\uDF06def'.at(-0), 'a');
@@ -5925,14 +5895,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#padLeft', function(assert){
- assert.ok(toString$.call(String.prototype.padLeft).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.padLeft.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.padLeft), 'looks like native');
- assert.strictEqual(String.prototype.padLeft.name, 'padLeft', 'name is "padLeft"');
+ assert.isFunction(String.prototype.padLeft);
+ assert.arity(String.prototype.padLeft, 1);
+ assert.name(String.prototype.padLeft, 'padLeft');
+ assert.looksNative(String.prototype.padLeft);
assert.strictEqual('abc'.padLeft(5), ' abc');
assert.strictEqual('abc'.padLeft(4, 'de'), 'dabc');
assert.strictEqual('abc'.padLeft(), 'abc');
@@ -5955,14 +5925,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#padRight', function(assert){
- assert.ok(toString$.call(String.prototype.padRight).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.padRight.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.padRight), 'looks like native');
- assert.strictEqual(String.prototype.padRight.name, 'padRight', 'name is "padRight"');
+ assert.isFunction(String.prototype.padRight);
+ assert.arity(String.prototype.padRight, 1);
+ assert.name(String.prototype.padRight, 'padRight');
+ assert.looksNative(String.prototype.padRight);
assert.strictEqual('abc'.padRight(5), 'abc ');
assert.strictEqual('abc'.padRight(4, 'de'), 'abcd');
assert.strictEqual('abc'.padRight(), 'abc');
@@ -5985,14 +5955,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#trimLeft', function(assert){
- assert.ok(toString$.call(''.trimLeft).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.trimLeft.length, 0, 'arity is 0');
- assert.ok(/native code/.test(String.prototype.trimLeft), 'looks like native');
- assert.strictEqual(String.prototype.trimLeft.name, 'trimLeft', 'name is "trimLeft"');
+ assert.isFunction(''.trimLeft);
+ assert.arity(String.prototype.trimLeft, 0);
+ assert.name(String.prototype.trimLeft, 'trimLeft');
+ assert.looksNative(String.prototype.trimLeft);
assert.strictEqual(' \n q w e \n '.trimLeft(), 'q w e \n ', 'removes whitespaces at left side of string');
assert.strictEqual('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'.trimLeft(), '', 'removes all whitespaces');
assert.strictEqual('\u200b\u0085'.trimLeft(), '\u200b\u0085', "shouldn't remove this symbols");
@@ -6012,14 +5982,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#trimRight', function(assert){
- assert.ok(toString$.call(''.trimRight).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.trimRight.length, 0, 'arity is 0');
- assert.ok(/native code/.test(String.prototype.trimRight), 'looks like native');
- assert.strictEqual(String.prototype.trimRight.name, 'trimRight', 'name is "trimRight"');
+ assert.isFunction(''.trimRight);
+ assert.arity(String.prototype.trimRight, 0);
+ assert.name(String.prototype.trimRight, 'trimRight');
+ assert.looksNative(String.prototype.trimRight);
assert.strictEqual(' \n q w e \n '.trimRight(), ' \n q w e', 'removes whitespaces at right side of string');
assert.strictEqual('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'.trimRight(), '', 'removes all whitespaces');
assert.strictEqual('\u200b\u0085'.trimRight(), '\u200b\u0085', "shouldn't remove this symbols");
diff --git a/tests/helpers.js b/tests/helpers.js
index 65b92f70a8e5..a55a6093d101 100644
--- a/tests/helpers.js
+++ b/tests/helpers.js
@@ -1,3 +1,10 @@
+// Generated by LiveScript 1.3.1
+(function(){
+ QUnit.assert.arity = function(fn, length, message){
+ this.push(fn.length === length, fn.length, length, message || "arity is " + length);
+ };
+}).call(this);
+
// Generated by LiveScript 1.3.1
(function(){
QUnit.assert.epsilon = function(a, b, E, message){
@@ -5,6 +12,28 @@
};
}).call(this);
+// Generated by LiveScript 1.3.1
+(function(){
+ var toString$ = {}.toString;
+ QUnit.assert.isFunction = function(fn, message){
+ this.push(typeof fn === 'function' || toString$.call(fn).slice(8, -1) === 'Function', false, true, message || 'is function');
+ };
+}).call(this);
+
+// Generated by LiveScript 1.3.1
+(function(){
+ QUnit.assert.looksNative = function(fn, message){
+ this.push(/native code/.test(Function.prototype.toString.call(fn)), false, true, message || 'looks native');
+ };
+}).call(this);
+
+// Generated by LiveScript 1.3.1
+(function(){
+ QUnit.assert.name = function(fn, name, message){
+ this.push(fn.name === name, fn.name, name, message || "name is '" + name + "'");
+ };
+}).call(this);
+
// Generated by LiveScript 1.3.1
(function(){
QUnit.assert.same = function(a, b, message){
diff --git a/tests/helpers/arity.ls b/tests/helpers/arity.ls
new file mode 100644
index 000000000000..723a80b1cb41
--- /dev/null
+++ b/tests/helpers/arity.ls
@@ -0,0 +1,2 @@
+QUnit.assert.arity = !(fn, length, message)->
+ @push (fn.length is length), fn.length, length, message || "arity is #length"
\ No newline at end of file
diff --git a/tests/helpers/isFunction.ls b/tests/helpers/isFunction.ls
new file mode 100644
index 000000000000..8b947e5e6e81
--- /dev/null
+++ b/tests/helpers/isFunction.ls
@@ -0,0 +1,2 @@
+QUnit.assert.isFunction = !(fn, message)->
+ @push (typeof fn is \function or typeof! fn is \Function), no, on, message || 'is function'
\ No newline at end of file
diff --git a/tests/helpers/looksNative.ls b/tests/helpers/looksNative.ls
new file mode 100644
index 000000000000..9857c03e8770
--- /dev/null
+++ b/tests/helpers/looksNative.ls
@@ -0,0 +1,2 @@
+QUnit.assert.looksNative = !(fn, message)->
+ @push /native code/.test(Function::toString.call fn), no, on, message || 'looks native'
\ No newline at end of file
diff --git a/tests/helpers/name.ls b/tests/helpers/name.ls
new file mode 100644
index 000000000000..f6b2e06235a6
--- /dev/null
+++ b/tests/helpers/name.ls
@@ -0,0 +1,2 @@
+QUnit.assert.name = !(fn, name, message)->
+ @push (fn.name is name), fn.name, name, message || "name is '#name'"
\ No newline at end of file
diff --git a/tests/library.js b/tests/library.js
index ceaf3c289190..0443f15c3769 100644
--- a/tests/library.js
+++ b/tests/library.js
@@ -1,6 +1,6 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, delay, Promise, timeLimitedPromise, toString$ = {}.toString;
+ var module, test, delay, Promise, timeLimitedPromise;
module = QUnit.module, test = QUnit.test;
module('core-js');
delay = core.delay, Promise = core.Promise;
@@ -13,7 +13,7 @@
};
test('delay', function(assert){
assert.expect(3);
- assert.ok(toString$.call(delay).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(delay);
assert.ok(delay(42) instanceof Promise, 'returns promises');
return timeLimitedPromise(1e3, function(res){
delay(10).then(function(it){
@@ -29,18 +29,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, Dict, Set, Symbol, ref$, keys, create, assign, make, from, values, toString$ = {}.toString;
+ var module, test, Dict, Set, Symbol, ref$, keys, create, assign, make, from, values, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('core-js');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
Dict = core.Dict, Set = core.Set, Symbol = core.Symbol;
ref$ = core.Object, keys = ref$.keys, create = ref$.create, assign = ref$.assign, make = ref$.make;
ref$ = core.Array, from = ref$.from, values = ref$.values;
test('Dict', function(assert){
var dict1, dict2, dict3, done, iter;
- assert.ok(isFunction(Dict), 'is function');
+ assert.isFunction(Dict);
dict1 = Dict();
assert.ok(!(dict1 instanceof Object));
assert.deepEqual(keys(dict1), []);
@@ -70,7 +67,7 @@
test('Dict.every', function(assert){
var every, obj, ctx;
every = Dict.every;
- assert.ok(isFunction(every), 'is function');
+ assert.isFunction(every);
every(obj = {
q: 1
}, function(val, key, that){
@@ -97,7 +94,7 @@
test('Dict.filter', function(assert){
var filter, obj, ctx;
filter = Dict.filter;
- assert.ok(isFunction(filter), 'is function');
+ assert.isFunction(filter);
filter(obj = {
q: 1
}, function(val, key, that){
@@ -120,7 +117,7 @@
test('Dict.find', function(assert){
var find, obj, ctx;
find = Dict.find;
- assert.ok(isFunction(find), 'is function');
+ assert.isFunction(find);
find(obj = {
q: 1
}, function(val, key, that){
@@ -140,7 +137,7 @@
test('Dict.findKey', function(assert){
var findKey, obj, ctx;
findKey = Dict.findKey;
- assert.ok(isFunction(findKey), 'is function');
+ assert.isFunction(findKey);
findKey(obj = {
q: 1
}, function(val, key, that){
@@ -160,7 +157,7 @@
test('Dict.forEach', function(assert){
var forEach, obj, ctx, rez;
forEach = Dict.forEach;
- assert.ok(isFunction(forEach), 'is function');
+ assert.isFunction(forEach);
forEach(obj = {
q: 1
}, function(val, key, that){
@@ -213,7 +210,7 @@
test('Dict.keyOf', function(assert){
var keyOf;
keyOf = Dict.keyOf;
- assert.ok(isFunction(keyOf), 'is function');
+ assert.isFunction(keyOf);
assert.ok(keyOf({
q: 1,
w: 2,
@@ -233,7 +230,7 @@
test('Dict.map', function(assert){
var map, obj, ctx;
map = Dict.map;
- assert.ok(isFunction(map), 'is function');
+ assert.isFunction(map);
map(obj = {
q: 1
}, function(val, key, that){
@@ -257,7 +254,7 @@
test('Dict.mapPairs', function(assert){
var mapPairs, obj, ctx;
mapPairs = Dict.mapPairs;
- assert.ok(isFunction(mapPairs), 'is function');
+ assert.isFunction(mapPairs);
mapPairs(obj = {
q: 1
}, function(val, key, that){
@@ -280,7 +277,7 @@
test('Dict.reduce', function(assert){
var reduce, obj, foo, memo;
reduce = Dict.reduce;
- assert.ok(isFunction(reduce), 'is function');
+ assert.isFunction(reduce);
reduce(obj = {
a: 1
}, function(memo, val, key, that){
@@ -314,7 +311,7 @@
test('Dict.some', function(assert){
var some, obj, ctx;
some = Dict.some;
- assert.ok(isFunction(some), 'is function');
+ assert.isFunction(some);
some(obj = {
q: 1
}, function(val, key, that){
@@ -341,7 +338,7 @@
test('Dict.includes', function(assert){
var includes, dict, o;
includes = Dict.includes;
- assert.ok(isFunction(includes), 'is function');
+ assert.isFunction(includes);
dict = {
q: 1,
w: NaN,
@@ -360,7 +357,7 @@
test('Dict.has', function(assert){
var has;
has = Dict.has;
- assert.ok(isFunction(has), 'is function');
+ assert.isFunction(has);
assert.ok(has({
q: 1
}, 'q'));
@@ -377,7 +374,7 @@
test('Dict.get', function(assert){
var get;
get = Dict.get;
- assert.ok(isFunction(get), 'is function');
+ assert.isFunction(get);
assert.ok(get({
q: 1
}, 'q') === 1);
@@ -394,7 +391,7 @@
test('Dict.values', function(assert){
var values, iter;
values = Dict.values;
- assert.ok(isFunction(values), 'is function');
+ assert.isFunction(values);
iter = values({});
assert.ok(iter[Symbol != null ? Symbol.toStringTag : void 8] === 'Dict Iterator');
assert.ok('next' in iter);
@@ -417,7 +414,7 @@
test('Dict.keys', function(assert){
var keys, iter;
keys = Dict.keys;
- assert.ok(isFunction(keys), 'is function');
+ assert.isFunction(keys);
iter = keys({});
assert.ok(iter[Symbol != null ? Symbol.toStringTag : void 8] === 'Dict Iterator');
assert.ok('next' in iter);
@@ -440,7 +437,7 @@
test('Dict.entries', function(assert){
var entries, iter;
entries = Dict.entries;
- assert.ok(isFunction(entries), 'is function');
+ assert.isFunction(entries);
iter = entries({});
assert.ok(iter[Symbol != null ? Symbol.toStringTag : void 8] === 'Dict Iterator');
assert.ok('next' in iter);
@@ -468,18 +465,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, ref$, map, every, reduce, toString$ = {}.toString;
+ var module, test, ref$, map, every, reduce, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('core-js');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
ref$ = core.Array, map = ref$.map, every = ref$.every, reduce = ref$.reduce;
test('Function#part', function(assert){
var part, $, obj, fn, p;
part = core.Function.part;
$ = core._;
- assert.ok(isFunction(part), 'is function');
+ assert.isFunction(part);
assert.ok(part(function(it){
return toString$.call(it).slice(8, -1) === 'String';
}, 'qwe')());
@@ -494,7 +488,7 @@
return map(arguments, String).join(' ');
};
p = part(fn, $, 'Саша', $, 'шоссе', $, 'сосала');
- assert.ok(isFunction(p), '.part with placeholders return function');
+ assert.isFunction(p, '.part with placeholders return function');
assert.ok(p('Шла', 'по') === 'Шла Саша по шоссе undefined сосала', '.part with placeholders: args < placeholders');
assert.ok(p('Шла', 'по', 'и') === 'Шла Саша по шоссе и сосала', '.part with placeholders: args == placeholders');
return assert.ok(p('Шла', 'по', 'и', 'сушку') === 'Шла Саша по шоссе и сосала сушку', '.part with placeholders: args > placeholders');
@@ -510,7 +504,7 @@
test('core.getIteratorMethod', function(assert){
var getIteratorMethod, iterFn, iter;
getIteratorMethod = core.getIteratorMethod;
- assert.ok(typeof getIteratorMethod === 'function', 'is function');
+ assert.isFunction(getIteratorMethod);
assert.strictEqual(getIteratorMethod({}), void 8);
iterFn = getIteratorMethod([]);
assert.ok(typeof iterFn === 'function');
@@ -532,7 +526,7 @@
test('core.getIterator', function(assert){
var getIterator, iter;
getIterator = core.getIterator;
- assert.ok(typeof getIterator === 'function', 'is function');
+ assert.isFunction(getIterator);
assert.throws(function(){
getIterator({});
}, TypeError);
@@ -554,7 +548,7 @@
test('core.isIterable', function(assert){
var isIterable;
isIterable = core.isIterable;
- assert.ok(typeof isIterable === 'function', 'is function');
+ assert.isFunction(isIterable);
assert.ok(!isIterable({}));
assert.ok(isIterable([]));
return assert.ok(isIterable(function(){
@@ -565,25 +559,19 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isObject, log, methods, toString$ = {}.toString;
+ var module, test, log, methods;
module = QUnit.module, test = QUnit.test;
module('core-js');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
- isObject = function(it){
- return it === Object(it);
- };
log = core.log;
methods = ['assert', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupEnd', 'groupCollapsed', 'groupEnd', 'info', 'log', 'table', 'trace', 'warn', 'markTimeline', 'profile', 'profileEnd', 'time', 'timeEnd', 'timeStamp'];
test('is object', function(assert){
- return assert.ok(isObject(log), 'global.log is object');
+ return assert.strictEqual(log, Object(log), 'global.log is object');
});
test('log.{..} are functions', function(assert){
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = methods).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(log[x$]), "log." + x$ + " is function"));
+ results$.push(assert.isFunction(log[x$], "log." + x$ + " is function"));
}
return results$;
});
@@ -626,8 +614,8 @@
test('log.{enable, disable}', function(assert){
var enable, disable;
enable = log.enable, disable = log.disable;
- assert.ok(isFunction(enable), 'log.enable is function');
- assert.ok(isFunction(disable), 'log.disable is function');
+ assert.isFunction(enable, 'log.enable is function');
+ assert.isFunction(disable, 'log.disable is function');
assert.ok((function(){
try {
disable();
@@ -647,7 +635,7 @@
}()), 'enable log');
});
test('log', function(assert){
- assert.ok(isFunction(log), 'global.log is function');
+ assert.isFunction(log);
return assert.ok((function(){
try {
log(42);
@@ -726,13 +714,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.classof', function(assert){
var classof, Class;
classof = core.Object.classof;
- assert.ok(toString$.call(classof).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(classof);
assert.ok(classof(void 8) === 'Undefined', 'classof undefined is `Undefined`');
assert.ok(classof(null) === 'Null', 'classof null is `Null`');
assert.ok(classof(true) === 'Boolean', 'classof bool is `Boolean`');
@@ -776,13 +764,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.define', function(assert){
var ref$, define, defineProperty, foo, foo2;
ref$ = core.Object, define = ref$.define, defineProperty = ref$.defineProperty;
- assert.ok(toString$.call(define).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(define);
foo = {
q: 1
};
@@ -815,13 +803,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.isObject', function(assert){
var isObject;
isObject = core.Object.isObject;
- assert.ok(toString$.call(isObject).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(isObject);
assert.ok(!isObject(void 8), 'isObject undefined return false');
assert.ok(!isObject(null), 'isObject null return false');
assert.ok(!isObject(1), 'isObject number return false');
@@ -840,13 +828,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.make', function(assert){
var make, object, foo;
make = core.Object.make;
- assert.ok(toString$.call(make).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(make);
object = make(foo = {
q: 1
}, {
@@ -859,13 +847,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('String#escapeHTML', function(assert){
var escapeHTML;
escapeHTML = core.String.escapeHTML;
- assert.ok(toString$.call(escapeHTML).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(escapeHTML);
assert.strictEqual(escapeHTML('qwe, asd'), 'qwe, asd');
assert.strictEqual(escapeHTML('
qwe
'), '<div>qwe</div>');
return assert.strictEqual(escapeHTML("&<>\"'"), '&<>"'');
@@ -874,13 +862,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('String#unescapeHTML', function(assert){
var unescapeHTML;
unescapeHTML = core.String.unescapeHTML;
- assert.ok(toString$.call(unescapeHTML).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(unescapeHTML);
assert.strictEqual(unescapeHTML('qwe, asd'), 'qwe, asd');
assert.strictEqual(unescapeHTML('<div>qwe</div>'), 'qwe
');
return assert.strictEqual(unescapeHTML('&<>"''), "&<>\"'");
@@ -889,16 +877,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, toString$ = {}.toString;
+ var module, test, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('ES5');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
test('Object.getOwnPropertyDescriptor', function(assert){
var getOwnPropertyDescriptor;
getOwnPropertyDescriptor = core.Object.getOwnPropertyDescriptor;
- assert.ok(isFunction(getOwnPropertyDescriptor), 'is function');
+ assert.isFunction(getOwnPropertyDescriptor);
assert.deepEqual(getOwnPropertyDescriptor({
q: 42
}, 'q'), {
@@ -912,7 +897,7 @@
test('Object.defineProperty', function(assert){
var defineProperty, rez, src;
defineProperty = core.Object.defineProperty;
- assert.ok(isFunction(defineProperty), 'is function');
+ assert.isFunction(defineProperty);
assert.ok((rez = defineProperty(src = {}, 'q', {
value: 42
})) === src);
@@ -921,7 +906,7 @@
test('Object.defineProperties', function(assert){
var defineProperties, rez, src;
defineProperties = core.Object.defineProperties;
- assert.ok(isFunction(defineProperties), 'is function');
+ assert.isFunction(defineProperties);
assert.ok((rez = defineProperties(src = {}, {
q: {
value: 42
@@ -935,7 +920,7 @@
test('Object.getPrototypeOf', function(assert){
var ref$, create, getPrototypeOf, fn, obj, foo, bar;
ref$ = core.Object, create = ref$.create, getPrototypeOf = ref$.getPrototypeOf;
- assert.ok(isFunction(getPrototypeOf), 'is function');
+ assert.isFunction(getPrototypeOf);
assert.ok(getPrototypeOf({}) === Object.prototype);
assert.ok(getPrototypeOf([]) === Array.prototype);
assert.ok(getPrototypeOf(new (fn = (function(){
@@ -959,7 +944,7 @@
test('Object.getOwnPropertyNames', function(assert){
var getOwnPropertyNames, fn1, fn2, names;
getOwnPropertyNames = core.Object.getOwnPropertyNames;
- assert.ok(isFunction(getOwnPropertyNames), 'is function');
+ assert.isFunction(getOwnPropertyNames);
fn1 = function(w){
this.w = w != null ? w : 2;
};
@@ -999,7 +984,7 @@
}
return result;
};
- assert.ok(isFunction(create), 'is function');
+ assert.isFunction(create);
assert.ok(isPrototype(obj = {
q: 1
}, create(obj)));
@@ -1027,7 +1012,7 @@
test('Object.keys', function(assert){
var keys, fn1, fn2;
keys = core.Object.keys;
- assert.ok(isFunction(keys), 'is function');
+ assert.isFunction(keys);
fn1 = function(w){
this.w = w != null ? w : 2;
};
@@ -1043,43 +1028,43 @@
test('Object.seal', function(assert){
var seal, a;
seal = core.Object.seal;
- assert.ok(isFunction(seal), 'is function');
+ assert.isFunction(seal);
return assert.strictEqual(seal(a = {}), a);
});
test('Object.freeze', function(assert){
var freeze, a;
freeze = core.Object.freeze;
- assert.ok(isFunction(freeze), 'is function');
+ assert.isFunction(freeze);
return assert.strictEqual(freeze(a = {}), a);
});
test('Object.preventExtensions', function(assert){
var preventExtensions, a;
preventExtensions = core.Object.preventExtensions;
- assert.ok(isFunction(preventExtensions), 'is function');
+ assert.isFunction(preventExtensions);
return assert.strictEqual(preventExtensions(a = {}), a);
});
test('Object.isSealed', function(assert){
var isSealed;
isSealed = core.Object.isSealed;
- assert.ok(isFunction(isSealed), 'is function');
+ assert.isFunction(isSealed);
return assert.strictEqual(isSealed({}), false);
});
test('Object.isFrozen', function(assert){
var isFrozen;
isFrozen = core.Object.isFrozen;
- assert.ok(isFunction(isFrozen), 'is function');
+ assert.isFunction(isFrozen);
return assert.strictEqual(isFrozen({}), false);
});
test('Object.isExtensible', function(assert){
var isExtensible;
isExtensible = core.Object.isExtensible;
- assert.ok(isFunction(isExtensible), 'is function');
+ assert.isFunction(isExtensible);
return assert.strictEqual(isExtensible({}), true);
});
test('Function#bind', function(assert){
var bind, obj, fn, inst, F, date;
bind = core.Function.bind;
- assert.ok(isFunction(bind), 'is function');
+ assert.isFunction(bind);
obj = {
a: 42
};
@@ -1109,7 +1094,7 @@
test('Array.isArray', function(assert){
var isArray;
isArray = core.Array.isArray;
- assert.ok(isFunction(isArray), 'is function');
+ assert.isFunction(isArray);
assert.ok(!isArray({}));
assert.ok(!isArray(function(){
return arguments;
@@ -1120,7 +1105,7 @@
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = ['indexOf', 'lastIndexOf', 'every', 'some', 'forEach', 'map', 'filter', 'reduce', 'reduceRight']).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(core.Array[x$]), "Array::" + x$ + " is function"));
+ results$.push(assert.isFunction(core.Array[x$], "Array::" + x$ + " is function"));
}
return results$;
});
@@ -1346,13 +1331,13 @@
test('Date.now', function(assert){
var now;
now = core.Date.now;
- assert.ok(isFunction(now), 'is function');
+ assert.isFunction(now);
return assert.ok(+new Date - now() < 10, 'Date.now() ~ +new Date');
});
test('Date#toISOString', function(assert){
var toISOString, ft, bc;
toISOString = core.Date.toISOString;
- assert.ok(isFunction(toISOString), 'is function');
+ assert.isFunction(toISOString);
assert.strictEqual(toISOString(new Date(0)), '1970-01-01T00:00:00.000Z');
assert.strictEqual(toISOString(new Date(1e12 + 1)), '2001-09-09T01:46:40.001Z');
assert.strictEqual(toISOString(new Date(-5e13 - 1)), '0385-07-25T07:06:39.999Z');
@@ -1387,13 +1372,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#copyWithin', function(assert){
var copyWithin, a;
copyWithin = core.Array.copyWithin;
- assert.ok(toString$.call(copyWithin).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(copyWithin);
assert.strictEqual(a = copyWithin([1], 0), a);
assert.deepEqual(copyWithin([1, 2, 3, 4, 5], 0, 3), [4, 5, 3, 4, 5]);
assert.deepEqual(copyWithin([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]);
@@ -1423,13 +1408,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#fill', function(assert){
var fill, a;
fill = core.Array.fill;
- assert.ok(toString$.call(fill).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(fill);
assert.strictEqual(a = fill(Array(5), 5), a);
assert.deepEqual(fill(Array(5), 5), [5, 5, 5, 5, 5]);
assert.deepEqual(fill(Array(5), 5, 1), [void 8, 5, 5, 5, 5]);
@@ -1452,13 +1437,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#findIndex', function(assert){
var findIndex, arr, ctx;
findIndex = core.Array.findIndex;
- assert.ok(toString$.call(findIndex).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(findIndex);
findIndex(arr = [1], function(val, key, that){
assert.strictEqual(this, ctx);
assert.strictEqual(val, 1);
@@ -1484,13 +1469,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#find', function(assert){
var find, arr, ctx;
find = core.Array.find;
- assert.ok(toString$.call(find).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(find);
find(arr = [1], function(val, key, that){
assert.strictEqual(this, ctx);
assert.strictEqual(val, 1);
@@ -1518,15 +1503,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array.from', function(assert){
var ref$, from, values, iterator, al, ctx, done, iter, F, inst, a;
ref$ = core.Array, from = ref$.from, values = ref$.values;
iterator = core.Symbol.iterator;
- assert.ok(toString$.call(from).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(from.length, 1, 'arity is 1');
+ assert.isFunction(from);
+ assert.arity(from, 1);
assert.deepEqual(from('123'), ['1', '2', '3']);
assert.deepEqual(from({
length: 3,
@@ -1610,20 +1595,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, Symbol, ref$, keys, values, entries, toString$ = {}.toString;
+ var module, test, isIterator, Symbol, ref$, keys, values, entries;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
Symbol = core.Symbol;
ref$ = core.Array, keys = ref$.keys, values = ref$.values, entries = ref$.entries;
test('Array#@@iterator', function(assert){
var iter;
- assert.ok(isFunction(values), 'is function');
+ assert.isFunction(values);
iter = core.getIterator(['q', 'w', 'e']);
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1646,7 +1628,7 @@
});
test('Array#keys', function(assert){
var iter;
- assert.ok(isFunction(keys), 'is function');
+ assert.isFunction(keys);
iter = keys(['q', 'w', 'e']);
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1669,7 +1651,7 @@
});
test('Array#values', function(assert){
var iter;
- assert.ok(isFunction(values), 'is function');
+ assert.isFunction(values);
iter = values(['q', 'w', 'e']);
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1692,7 +1674,7 @@
});
test('Array#entries', function(assert){
var iter;
- assert.ok(isFunction(entries), 'is function');
+ assert.isFunction(entries);
iter = entries(['q', 'w', 'e']);
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1717,13 +1699,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array.of', function(assert){
var F, inst;
- assert.ok(toString$.call(core.Array.of).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(core.Array.of.length, 0, 'arity is 0');
+ assert.isFunction(core.Array.of);
+ assert.arity(core.Array.of, 0);
assert.deepEqual(core.Array.of(1), [1]);
assert.deepEqual(core.Array.of(1, 2, 3), [1, 2, 3]);
F = function(){};
@@ -1749,14 +1731,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, same, Map, Symbol, ref$, getOwnPropertyDescriptor, freeze, entries, values, iterator, toString$ = {}.toString;
+ var module, test, isIterator, same, Map, Symbol, ref$, getOwnPropertyDescriptor, freeze, entries, values, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
same = function(a, b){
if (a === b) {
@@ -1771,7 +1750,7 @@
iterator = core.Symbol.iterator;
test('Map', function(assert){
var done, iter, a;
- assert.ok(isFunction(Map), 'is function');
+ assert.isFunction(Map);
assert.ok('clear' in Map.prototype, 'clear in Map.prototype');
assert.ok('delete' in Map.prototype, 'delete in Map.prototype');
assert.ok('forEach' in Map.prototype, 'forEach in Map.prototype');
@@ -1803,7 +1782,7 @@
});
test('Map#clear', function(assert){
var M, f;
- assert.ok(isFunction(Map.prototype.clear), 'is function');
+ assert.isFunction(Map.prototype.clear);
M = new Map;
M.clear();
assert.strictEqual(M.size, 0);
@@ -1820,7 +1799,7 @@
});
test('Map#delete', function(assert){
var a, M, f;
- assert.ok(isFunction(Map.prototype['delete']), 'is function');
+ assert.isFunction(Map.prototype['delete']);
a = [];
M = new Map().set(NaN, 1).set(2, 1).set(3, 1).set(2, 5).set(1, 4).set(a, {});
assert.strictEqual(M.size, 5);
@@ -1839,7 +1818,7 @@
});
test('Map#forEach', function(assert){
var r, T, count, M, a, map, s;
- assert.ok(isFunction(Map.prototype.forEach), 'is function');
+ assert.isFunction(Map.prototype.forEach);
r = {};
count = 0;
M = new Map().set(NaN, 1).set(2, 1).set(3, 7).set(2, 5).set(1, 4).set(a = {}, 9);
@@ -1880,7 +1859,7 @@
});
test('Map#get', function(assert){
var o, f, M;
- assert.ok(isFunction(Map.prototype.get), 'is function');
+ assert.isFunction(Map.prototype.get);
o = {};
f = freeze({});
M = new Map([[NaN, 1], [2, 1], [3, 1], [2, 5], [1, 4], [f, 42], [o, o]]);
@@ -1893,7 +1872,7 @@
});
test('Map#has', function(assert){
var o, f, M;
- assert.ok(isFunction(Map.prototype.has), 'is function');
+ assert.isFunction(Map.prototype.has);
o = {};
f = freeze({});
M = new Map([[NaN, 1], [2, 1], [3, 1], [2, 5], [1, 4], [f, 42], [o, o]]);
@@ -1906,7 +1885,7 @@
});
test('Map#set', function(assert){
var o, M, chain, f;
- assert.ok(isFunction(Map.prototype.set), 'is function');
+ assert.isFunction(Map.prototype.set);
o = {};
M = new Map().set(NaN, 1).set(2, 1).set(3, 1).set(2, 5).set(1, 4).set(o, o);
assert.ok(M.size === 5);
@@ -1992,7 +1971,7 @@
});
test('Map#keys', function(assert){
var iter;
- assert.ok(typeof Map.prototype.keys === 'function', 'is function');
+ assert.isFunction(Map.prototype.keys);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).keys();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -2015,7 +1994,7 @@
});
test('Map#values', function(assert){
var iter;
- assert.ok(typeof Map.prototype.values === 'function', 'is function');
+ assert.isFunction(Map.prototype.values);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -2038,7 +2017,7 @@
});
test('Map#entries', function(assert){
var iter;
- assert.ok(typeof Map.prototype.entries === 'function', 'is function');
+ assert.isFunction(Map.prototype.entries);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -2085,13 +2064,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.acosh', function(assert){
var acosh;
acosh = core.Math.acosh;
- assert.ok(toString$.call(acosh).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(acosh);
assert.same(acosh(NaN), NaN);
assert.same(acosh(0.5), NaN);
assert.same(acosh(-1), NaN);
@@ -2108,13 +2087,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.asinh', function(assert){
var asinh;
asinh = core.Math.asinh;
- assert.ok(toString$.call(asinh).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(asinh);
assert.same(asinh(NaN), NaN);
assert.same(asinh(0), 0);
assert.same(asinh(-0), -0);
@@ -2130,13 +2109,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.atanh', function(assert){
var atanh;
atanh = core.Math.atanh;
- assert.ok(toString$.call(atanh).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(atanh);
assert.same(atanh(NaN), NaN);
assert.same(atanh(-2), NaN);
assert.same(atanh(-1.5), NaN);
@@ -2156,13 +2135,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.cbrt', function(assert){
var cbrt;
cbrt = core.Math.cbrt;
- assert.ok(toString$.call(cbrt).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(cbrt);
assert.same(cbrt(NaN), NaN);
assert.same(cbrt(0), 0);
assert.same(cbrt(-0), -0);
@@ -2177,13 +2156,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.clz32', function(assert){
var clz32;
clz32 = core.Math.clz32;
- assert.ok(toString$.call(clz32).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(clz32);
assert.strictEqual(clz32(0), 32);
assert.strictEqual(clz32(1), 31);
assert.same(clz32(-1), 0);
@@ -2195,13 +2174,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.cosh', function(assert){
var cosh;
cosh = core.Math.cosh;
- assert.ok(toString$.call(cosh).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(cosh);
assert.same(cosh(NaN), NaN);
assert.strictEqual(cosh(0), 1);
assert.strictEqual(cosh(-0), 1);
@@ -2216,13 +2195,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.expm1', function(assert){
var expm1;
expm1 = core.Math.expm1;
- assert.ok(toString$.call(expm1).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(expm1);
assert.same(expm1(NaN), NaN);
assert.same(expm1(0), 0);
assert.same(expm1(-0), -0);
@@ -2234,13 +2213,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.fround', function(assert){
var fround, maxFloat32, minFloat32;
fround = core.Math.fround;
- assert.ok(toString$.call(fround).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(fround);
assert.same(fround(void 8), NaN);
assert.same(fround(NaN), NaN);
assert.same(fround(0), 0);
@@ -2270,14 +2249,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.hypot', function(assert){
var hypot, sqrt;
hypot = core.Math.hypot;
sqrt = Math.sqrt;
- assert.ok(toString$.call(hypot).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(hypot);
assert.strictEqual(hypot(), 0);
assert.strictEqual(hypot(1), 1);
assert.same(hypot('', 0), 0);
@@ -2318,13 +2297,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.imul', function(assert){
var imul;
imul = core.Math.imul;
- assert.ok(toString$.call(imul).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(imul);
assert.same(imul(0, 0), 0);
assert.strictEqual(imul(123, 456), 56088);
assert.strictEqual(imul(-123, 456), -56088);
@@ -2365,13 +2344,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log10', function(assert){
var log10;
log10 = core.Math.log10;
- assert.ok(toString$.call(log10).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(log10);
assert.same(log10(''), log10(0));
assert.same(log10(NaN), NaN);
assert.same(log10(-1), NaN);
@@ -2389,13 +2368,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log1p', function(assert){
var log1p;
log1p = core.Math.log1p;
- assert.ok(toString$.call(log1p).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(log1p);
assert.same(log1p(''), log1p(0));
assert.same(log1p(NaN), NaN);
assert.same(log1p(-2), NaN);
@@ -2410,13 +2389,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log2', function(assert){
var log2;
log2 = core.Math.log2;
- assert.ok(toString$.call(log2).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(log2);
assert.same(log2(''), log2(0));
assert.same(log2(NaN), NaN);
assert.same(log2(-1), NaN);
@@ -2432,13 +2411,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.sign', function(assert){
var sign;
sign = core.Math.sign;
- assert.ok(toString$.call(sign).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(sign);
assert.same(sign(NaN), NaN);
assert.same(sign(), NaN);
assert.same(sign(-0), -0);
@@ -2454,13 +2433,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.sinh', function(assert){
var sinh;
sinh = core.Math.sinh;
- assert.ok(toString$.call(sinh).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(sinh);
assert.same(sinh(NaN), NaN);
assert.same(sinh(0), 0);
assert.same(sinh(-0), -0);
@@ -2474,13 +2453,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.tanh', function(assert){
var tanh;
tanh = core.Math.tanh;
- assert.ok(toString$.call(tanh).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(tanh);
assert.same(tanh(NaN), NaN);
assert.same(tanh(0), 0);
assert.same(tanh(-0), -0);
@@ -2492,13 +2471,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.trunc', function(assert){
var trunc;
trunc = core.Math.trunc;
- assert.ok(toString$.call(trunc).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(trunc);
assert.same(trunc(NaN), NaN, 'NaN -> NaN');
assert.same(trunc(-0), -0, '-0 -> -0');
assert.same(trunc(0), 0, '0 -> 0');
@@ -2534,14 +2513,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isFinite', function(assert){
var isFinite, create, i$, x$, ref$, len$, y$, e, results$ = [];
isFinite = core.Number.isFinite;
create = core.Object.create;
- assert.ok(toString$.call(isFinite).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(isFinite);
for (i$ = 0, len$ = (ref$ = [1, 0.1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isFinite(x$), "isFinite " + typeof x$ + " " + x$);
@@ -2565,14 +2544,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isInteger', function(assert){
var isInteger, create, i$, x$, ref$, len$, y$, e, results$ = [];
isInteger = core.Number.isInteger;
create = core.Object.create;
- assert.ok(toString$.call(isInteger).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(isInteger);
for (i$ = 0, len$ = (ref$ = [1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isInteger(x$), "isInteger " + typeof x$ + " " + x$);
@@ -2596,14 +2575,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isNaN', function(assert){
var isNaN, create, i$, x$, ref$, len$, e, results$ = [];
isNaN = core.Number.isNaN;
create = core.Object.create;
- assert.ok(toString$.call(isNaN).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(isNaN);
assert.ok(isNaN(NaN), 'Number.isNaN NaN');
for (i$ = 0, len$ = (ref$ = [1, 0.1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0, Infinity, 'NaN', '5', false, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void 8, null, {}, fn$, create(null)]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
@@ -2624,14 +2603,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isSafeInteger', function(assert){
var isSafeInteger, create, i$, x$, ref$, len$, y$, e, results$ = [];
isSafeInteger = core.Number.isSafeInteger;
create = core.Object.create;
- assert.ok(toString$.call(isSafeInteger).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(isSafeInteger);
for (i$ = 0, len$ = (ref$ = [1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0, 9007199254740991, -9007199254740991]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isSafeInteger(x$), "isSafeInteger " + typeof x$ + " " + x$);
@@ -2675,27 +2654,27 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.parseFloat', function(assert){
- return assert.ok(toString$.call(core.Number.parseFloat).slice(8, -1) === 'Function', 'is function');
+ return assert.isFunction(core.Number.parseFloat);
});
}).call(this);
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.parseInt', function(assert){
- return assert.ok(toString$.call(core.Number.parseInt).slice(8, -1) === 'Function', 'is function');
+ return assert.isFunction(core.Number.parseInt);
});
}).call(this);
// Generated by LiveScript 1.3.1
(function(){
- var module, test, descriptors, toString$ = {}.toString;
+ var module, test, descriptors;
module = QUnit.module, test = QUnit.test;
module('ES6');
descriptors = function(){
@@ -2710,7 +2689,7 @@
test('Object.assign', function(assert){
var ref$, assign, keys, defineProperty, foo, str, c, d, D, O, string, i$, x$, len$;
ref$ = core.Object, assign = ref$.assign, keys = ref$.keys, defineProperty = ref$.defineProperty;
- assert.ok(toString$.call(assign).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(assign);
foo = {
q: 1
};
@@ -2789,13 +2768,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Object.is', function(assert){
var same;
same = core.Object.is;
- assert.ok(toString$.call(same).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(same);
assert.ok(same(1, 1), '1 is 1');
assert.ok(same(NaN, NaN), '1 is 1');
assert.ok(!same(0, -0), '0 isnt -0');
@@ -2805,14 +2784,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
if (Object.setPrototypeOf || '__proto__' in Object.prototype) {
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Object.setPrototypeOf', function(assert){
var setPrototypeOf, tmp;
setPrototypeOf = core.Object.setPrototypeOf;
- assert.ok(toString$.call(setPrototypeOf).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(setPrototypeOf);
assert.ok('apply' in setPrototypeOf({}, Function.prototype), 'Parent properties in target');
assert.strictEqual(setPrototypeOf({
a: 2
@@ -2883,28 +2862,25 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, iterator, toString$ = {}.toString;
+ var module, test, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
iterator = core.Symbol.iterator;
test('Promise', function(assert){
- return assert.ok(isFunction(core.Promise), 'is function');
+ return assert.isFunction(core.Promise);
});
test('Promise#then', function(assert){
- return assert.ok(isFunction(core.Promise.prototype.then), 'is function');
+ return assert.isFunction(core.Promise.prototype.then);
});
test('Promise#catch', function(assert){
- return assert.ok(isFunction(core.Promise.prototype['catch']), 'is function');
+ return assert.isFunction(core.Promise.prototype['catch']);
});
test('Promise#@@toStringTag', function(assert){
return assert.ok(core.Promise.prototype[core.Symbol.toStringTag] === 'Promise', 'Promise::@@toStringTag is `Promise`');
});
test('Promise.all', function(assert){
var passed, iter, next, a, done;
- assert.ok(isFunction(core.Promise.all), 'is function');
+ assert.isFunction(core.Promise.all);
passed = false;
iter = core.Array.values([1, 2, 3]);
next = bind$(iter, 'next');
@@ -2926,7 +2902,7 @@
});
test('Promise.race', function(assert){
var passed, iter, next, a, done;
- assert.ok(isFunction(core.Promise.race), 'is function');
+ assert.isFunction(core.Promise.race);
passed = false;
iter = core.Array.values([1, 2, 3]);
next = bind$(iter, 'next');
@@ -2947,10 +2923,10 @@
return assert.ok(done);
});
test('Promise.resolve', function(assert){
- return assert.ok(isFunction(core.Promise.resolve), 'is function');
+ return assert.isFunction(core.Promise.resolve);
});
test('Promise.reject', function(assert){
- return assert.ok(isFunction(core.Promise.reject), 'is function');
+ return assert.isFunction(core.Promise.reject);
});
if (core.Object.setPrototypeOf) {
test('Promise subclassing', function(assert){
@@ -2995,16 +2971,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.apply', function(assert){
var apply, C;
apply = core.Reflect.apply;
- assert.ok(toString$.call(apply).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(apply.length, 3, 'arity is 3');
+ assert.isFunction(apply);
+ assert.arity(apply, 3);
if ('name' in apply) {
- assert.strictEqual(apply.name, 'apply', 'name is "apply"');
+ assert.name(apply, 'apply');
}
assert.strictEqual(apply(Array.prototype.push, [1, 2], [3, 4, 5]), 5);
C = function(a, b, c){
@@ -3020,17 +2996,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, getPrototypeOf, toString$ = {}.toString;
+ var module, test, getPrototypeOf;
module = QUnit.module, test = QUnit.test;
module('ES6');
getPrototypeOf = core.Object.getPrototypeOf;
test('Reflect.construct', function(assert){
var construct, C, inst, f, e;
construct = core.Reflect.construct;
- assert.ok(toString$.call(construct).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(construct.length, 2, 'arity is 2');
+ assert.isFunction(construct);
+ assert.arity(construct, 2);
if ('name' in construct) {
- assert.strictEqual(construct.name, 'construct', 'name is "construct"');
+ assert.name(construct, 'construct');
}
C = function(a, b, c){
return this.qux = a + b + c;
@@ -3062,7 +3038,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, ref$, defineProperty, getOwnPropertyDescriptor, MODERN, toString$ = {}.toString;
+ var module, test, ref$, defineProperty, getOwnPropertyDescriptor, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
ref$ = core.Object, defineProperty = ref$.defineProperty, getOwnPropertyDescriptor = ref$.getOwnPropertyDescriptor;
@@ -3078,10 +3054,10 @@
test('Reflect.defineProperty', function(assert){
var defineProperty, O;
defineProperty = core.Reflect.defineProperty;
- assert.ok(toString$.call(defineProperty).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(defineProperty.length, 3, 'arity is 3');
+ assert.isFunction(defineProperty);
+ assert.arity(defineProperty, 3);
if ('name' in defineProperty) {
- assert.strictEqual(defineProperty.name, 'defineProperty', 'name is "defineProperty"');
+ assert.name(defineProperty, 'defineProperty');
}
O = {};
assert.strictEqual(defineProperty(O, 'foo', {
@@ -3114,7 +3090,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = core.Object.defineProperty;
@@ -3130,10 +3106,10 @@
test('Reflect.deleteProperty', function(assert){
var deleteProperty, O;
deleteProperty = core.Reflect.deleteProperty;
- assert.ok(toString$.call(deleteProperty).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(deleteProperty.length, 2, 'arity is 2');
+ assert.isFunction(deleteProperty);
+ assert.arity(deleteProperty, 2);
if ('name' in deleteProperty) {
- assert.strictEqual(deleteProperty.name, 'deleteProperty', 'name is "deleteProperty"');
+ assert.name(deleteProperty, 'deleteProperty');
}
O = {
bar: 456
@@ -3158,7 +3134,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, from, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, from, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = core.Object.defineProperty;
@@ -3176,10 +3152,10 @@
var enumerate, iterator, obj, i, ref$;
enumerate = core.Reflect.enumerate;
iterator = core.Symbol.iterator;
- assert.ok(toString$.call(enumerate).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(enumerate.length, 1, 'arity is 1');
+ assert.isFunction(enumerate);
+ assert.arity(enumerate, 1);
if ('name' in enumerate) {
- assert.strictEqual(enumerate.name, 'enumerate', 'name is "enumerate"');
+ assert.name(enumerate, 'enumerate');
}
obj = {
foo: 1,
@@ -3214,16 +3190,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.getOwnPropertyDescriptor', function(assert){
var getOwnPropertyDescriptor, obj, desc;
getOwnPropertyDescriptor = core.Reflect.getOwnPropertyDescriptor;
- assert.ok(toString$.call(getOwnPropertyDescriptor).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getOwnPropertyDescriptor.length, 2, 'arity is 2');
+ assert.isFunction(getOwnPropertyDescriptor);
+ assert.arity(getOwnPropertyDescriptor, 2);
if ('name' in getOwnPropertyDescriptor) {
- assert.strictEqual(getOwnPropertyDescriptor.name, 'getOwnPropertyDescriptor', 'name is "getOwnPropertyDescriptor"');
+ assert.name(getOwnPropertyDescriptor, 'getOwnPropertyDescriptor');
}
obj = {
baz: 789
@@ -3238,16 +3214,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.getPrototypeOf', function(assert){
var getPrototypeOf;
getPrototypeOf = core.Reflect.getPrototypeOf;
- assert.ok(toString$.call(getPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getPrototypeOf.length, 1, 'arity is 1');
+ assert.isFunction(getPrototypeOf);
+ assert.arity(getPrototypeOf, 1);
if ('name' in getPrototypeOf) {
- assert.strictEqual(getPrototypeOf.name, 'getPrototypeOf', 'name is "getPrototypeOf"');
+ assert.name(getPrototypeOf, 'getPrototypeOf');
}
assert.strictEqual(getPrototypeOf([]), Array.prototype);
return assert.throws(function(){
@@ -3258,7 +3234,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, ref$, defineProperty, create, MODERN, toString$ = {}.toString;
+ var module, test, ref$, defineProperty, create, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
ref$ = core.Object, defineProperty = ref$.defineProperty, create = ref$.create;
@@ -3274,9 +3250,9 @@
test('Reflect.get', function(assert){
var get, target, receiver;
get = core.Reflect.get;
- assert.ok(toString$.call(get).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(get);
if ('name' in get) {
- assert.strictEqual(get.name, 'get', 'name is "get"');
+ assert.name(get, 'get');
}
assert.strictEqual(get({
qux: 987
@@ -3313,16 +3289,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.has', function(assert){
var has, O;
has = core.Reflect.has;
- assert.ok(toString$.call(has).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(has.length, 2, 'arity is 2');
+ assert.isFunction(has);
+ assert.arity(has, 2);
if ('name' in has) {
- assert.strictEqual(has.name, 'has', 'name is "has"');
+ assert.name(has, 'has');
}
O = {
qux: 987
@@ -3338,7 +3314,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, ref$, defineProperty, preventExtensions, MODERN, toString$ = {}.toString;
+ var module, test, ref$, defineProperty, preventExtensions, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
ref$ = core.Object, defineProperty = ref$.defineProperty, preventExtensions = ref$.preventExtensions;
@@ -3354,10 +3330,10 @@
test('Reflect.isExtensible', function(assert){
var isExtensible;
isExtensible = core.Reflect.isExtensible;
- assert.ok(toString$.call(isExtensible).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isExtensible.length, 1, 'arity is 1');
+ assert.isFunction(isExtensible);
+ assert.arity(isExtensible, 1);
if ('name' in isExtensible) {
- assert.strictEqual(isExtensible.name, 'isExtensible', 'name is "isExtensible"');
+ assert.name(isExtensible, 'isExtensible');
}
assert.ok(isExtensible({}));
if (MODERN) {
@@ -3371,7 +3347,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, toString$ = {}.toString;
+ var module, test, defineProperty;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = core.Object.defineProperty;
@@ -3379,10 +3355,10 @@
var ownKeys, sym, O1, keys, O2;
ownKeys = core.Reflect.ownKeys;
sym = core.Symbol('c');
- assert.ok(toString$.call(ownKeys).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(ownKeys.length, 1, 'arity is 1');
+ assert.isFunction(ownKeys);
+ assert.arity(ownKeys, 1);
if ('name' in ownKeys) {
- assert.strictEqual(ownKeys.name, 'ownKeys', 'name is "ownKeys"');
+ assert.name(ownKeys, 'ownKeys');
}
O1 = {
a: 1
@@ -3416,7 +3392,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, ref$, defineProperty, isExtensible, MODERN, toString$ = {}.toString;
+ var module, test, ref$, defineProperty, isExtensible, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
ref$ = core.Object, defineProperty = ref$.defineProperty, isExtensible = ref$.isExtensible;
@@ -3432,10 +3408,10 @@
test('Reflect.preventExtensions', function(assert){
var preventExtensions, obj;
preventExtensions = core.Reflect.preventExtensions;
- assert.ok(toString$.call(preventExtensions).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(preventExtensions.length, 1, 'arity is 1');
+ assert.isFunction(preventExtensions);
+ assert.arity(preventExtensions, 1);
if ('name' in preventExtensions) {
- assert.strictEqual(preventExtensions.name, 'preventExtensions', 'name is "preventExtensions"');
+ assert.name(preventExtensions, 'preventExtensions');
}
obj = {};
assert.ok(preventExtensions(obj), true);
@@ -3450,16 +3426,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
if (Object.setPrototypeOf || '__proto__' in {}) {
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.setPrototypeOf', function(assert){
var setPrototypeOf, obj, o;
setPrototypeOf = core.Reflect.setPrototypeOf;
- assert.ok(toString$.call(setPrototypeOf).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(setPrototypeOf);
if ('name' in setPrototypeOf) {
- assert.strictEqual(setPrototypeOf.name, 'setPrototypeOf', 'name is "setPrototypeOf"');
+ assert.name(setPrototypeOf, 'setPrototypeOf');
}
obj = {};
assert.ok(setPrototypeOf(obj, Array.prototype), true);
@@ -3477,7 +3453,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, ref$, defineProperty, getOwnPropertyDescriptor, create, MODERN, toString$ = {}.toString;
+ var module, test, ref$, defineProperty, getOwnPropertyDescriptor, create, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
ref$ = core.Object, defineProperty = ref$.defineProperty, getOwnPropertyDescriptor = ref$.getOwnPropertyDescriptor, create = ref$.create;
@@ -3493,9 +3469,9 @@
test('Reflect.set', function(assert){
var set, obj, target, receiver, out;
set = core.Reflect.set;
- assert.ok(toString$.call(set).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(set);
if ('name' in set) {
- assert.strictEqual(set.name, 'set', 'name is "set"');
+ assert.name(set, 'set');
}
obj = {};
assert.ok(set(obj, 'quux', 654), true);
@@ -3561,14 +3537,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, same, Set, Symbol, ref$, getOwnPropertyDescriptor, freeze, values, from, iterator, toString$ = {}.toString;
+ var module, test, isIterator, same, Set, Symbol, ref$, getOwnPropertyDescriptor, freeze, values, from, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
same = function(a, b){
if (a === b) {
@@ -3583,7 +3556,7 @@
iterator = core.Symbol.iterator;
test('Set', function(assert){
var S, r, done, iter, _add, a;
- assert.ok(isFunction(Set), 'is function');
+ assert.isFunction(Set);
assert.ok('add' in Set.prototype, 'add in Set.prototype');
assert.ok('clear' in Set.prototype, 'clear in Set.prototype');
assert.ok('delete' in Set.prototype, 'delete in Set.prototype');
@@ -3628,7 +3601,7 @@
});
test('Set#add', function(assert){
var a, S, chain, f;
- assert.ok(isFunction(Set.prototype.add), 'is function');
+ assert.isFunction(Set.prototype.add);
a = [];
S = new Set([NaN, 2, 3, 2, 1, a]);
assert.strictEqual(S.size, 5);
@@ -3648,7 +3621,7 @@
});
test('Set#clear', function(assert){
var S, f;
- assert.ok(isFunction(Set.prototype.clear), 'is function');
+ assert.isFunction(Set.prototype.clear);
S = new Set;
S.clear();
assert.strictEqual(S.size, 0);
@@ -3666,7 +3639,7 @@
});
test('Set#delete', function(assert){
var a, S, f;
- assert.ok(isFunction(Set.prototype['delete']), 'is function');
+ assert.isFunction(Set.prototype['delete']);
a = [];
S = new Set([NaN, 2, 3, 2, 1, a]);
assert.strictEqual(S.size, 5);
@@ -3685,7 +3658,7 @@
});
test('Set#forEach', function(assert){
var r, count, S, set, s;
- assert.ok(isFunction(Set.prototype.forEach), 'is function');
+ assert.isFunction(Set.prototype.forEach);
r = [];
count = 0;
S = new Set([1, 2, 3, 2, 1]);
@@ -3720,7 +3693,7 @@
});
test('Set#has', function(assert){
var a, f, S;
- assert.ok(isFunction(Set.prototype.has), 'is function');
+ assert.isFunction(Set.prototype.has);
a = [];
f = freeze({});
S = new Set([NaN, 2, 3, 2, 1, f, a]);
@@ -3792,7 +3765,7 @@
});
test('Set#keys', function(assert){
var iter;
- assert.ok(typeof Set.prototype.keys === 'function', 'is function');
+ assert.isFunction(Set.prototype.keys);
iter = new Set(['q', 'w', 'e']).keys();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -3815,7 +3788,7 @@
});
test('Set#values', function(assert){
var iter;
- assert.ok(typeof Set.prototype.values === 'function', 'is function');
+ assert.isFunction(Set.prototype.values);
iter = new Set(['q', 'w', 'e']).values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -3838,7 +3811,7 @@
});
test('Set#entries', function(assert){
var iter;
- assert.ok(typeof Set.prototype.entries === 'function', 'is function');
+ assert.isFunction(Set.prototype.entries);
iter = new Set(['q', 'w', 'e']).entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[Symbol != null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -3886,13 +3859,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#codePointAt', function(assert){
var codePointAt;
codePointAt = core.String.codePointAt;
- assert.ok(toString$.call(codePointAt).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(codePointAt);
assert.strictEqual(codePointAt('abc\uD834\uDF06def', ''), 0x61);
assert.strictEqual(codePointAt('abc\uD834\uDF06def', '_'), 0x61);
assert.strictEqual(codePointAt('abc\uD834\uDF06def'), 0x61);
@@ -3958,13 +3931,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#endsWith', function(assert){
var endsWith, re, ref$, e, O, ref1$;
endsWith = core.String.endsWith;
- assert.ok(toString$.call(endsWith).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(endsWith);
assert.ok(endsWith('undefined'));
assert.ok(!endsWith('undefined', null));
assert.ok(endsWith('abc', ''));
@@ -4019,16 +3992,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String.fromCodePoint', function(assert){
var fromCodePoint, tmp, counter, result;
fromCodePoint = core.String.fromCodePoint;
- assert.ok(toString$.call(fromCodePoint).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(fromCodePoint.length, 1, 'arity is 1');
+ assert.isFunction(fromCodePoint);
+ assert.arity(fromCodePoint, 1);
if ('name' in fromCodePoint) {
- assert.strictEqual(fromCodePoint.name, 'fromCodePoint', 'name is "fromCodePoint"');
+ assert.name(fromCodePoint, 'fromCodePoint');
}
assert.strictEqual(fromCodePoint(''), '\0');
assert.strictEqual(fromCodePoint(), '');
@@ -4103,13 +4076,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#includes', function(assert){
var includes, re, ref$, e, O, ref1$;
includes = core.String.includes;
- assert.ok(toString$.call(includes).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(includes);
assert.ok(!includes('abc'));
assert.ok(includes('aundefinedb'));
assert.ok(includes('abcd', 'b', 1));
@@ -4204,16 +4177,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String.raw', function(assert){
var raw;
raw = core.String.raw;
- assert.ok(toString$.call(raw).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(raw.length, 1, 'arity is 1');
+ assert.isFunction(raw);
+ assert.arity(raw, 1);
if ('name' in raw) {
- assert.strictEqual(raw.name, 'raw', 'name is "raw"');
+ assert.name(raw, 'raw');
}
assert.strictEqual(raw({
raw: ['Hi\\n', '!']
@@ -4238,13 +4211,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#repeat', function(assert){
var repeat;
repeat = core.String.repeat;
- assert.ok(toString$.call(repeat).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(repeat);
assert.strictEqual(repeat('qwe', 3), 'qweqweqwe');
assert.strictEqual(repeat('qwe', 2.5), 'qweqwe');
assert.throws(function(){
@@ -4269,13 +4242,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#startsWith', function(assert){
var startsWith, re, ref$, e, O, ref1$;
startsWith = core.String.startsWith;
- assert.ok(toString$.call(startsWith).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(startsWith);
assert.ok(startsWith('undefined'));
assert.ok(!startsWith('undefined', null));
assert.ok(startsWith('abc', ''));
@@ -4330,13 +4303,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#trim', function(assert){
var trim;
trim = core.String.trim;
- assert.ok(toString$.call(trim).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(trim);
assert.strictEqual(trim(' \n q w e \n '), 'q w e', 'removes whitespaces at left & right side of string');
assert.strictEqual(trim('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'), '', 'removes all whitespaces');
assert.strictEqual(trim('\u200b\u0085'), '\u200b\u0085', "shouldn't remove this symbols");
@@ -4355,17 +4328,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, Symbol, JSON, ref$, defineProperty, getOwnPropertyDescriptor, create, isFunction, isNative, descriptors, G, toString$ = {}.toString;
+ var module, test, Symbol, JSON, ref$, defineProperty, getOwnPropertyDescriptor, create, descriptors, G;
module = QUnit.module, test = QUnit.test;
module('ES6');
Symbol = core.Symbol, JSON = core.JSON;
ref$ = core.Object, defineProperty = ref$.defineProperty, getOwnPropertyDescriptor = ref$.getOwnPropertyDescriptor, create = ref$.create;
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
- isNative = function(it){
- return /\[native code\]\s*\}\s*$/.test(it);
- };
descriptors = function(){
try {
return 2 === core.Object.defineProperty({}, 'a', {
@@ -4378,7 +4345,7 @@
G = (typeof global != 'undefined' && global !== null) && global || window;
test('Symbol', function(assert){
var s1, s2, O, count, i;
- assert.ok(isFunction(Symbol), 'is function');
+ assert.isFunction(Symbol);
s1 = Symbol('foo');
s2 = Symbol('foo');
assert.ok(s1 !== s2, 'Symbol("foo") !== Symbol("foo")');
@@ -4405,8 +4372,8 @@
});
test('Global symbol registry', function(assert){
var symbol;
- assert.ok(isFunction(Symbol['for']), 'Symbol.for is function');
- assert.ok(isFunction(Symbol.keyFor), 'Symbol.keyFor is function');
+ assert.isFunction(Symbol['for'], 'Symbol.for is function');
+ assert.isFunction(Symbol.keyFor, 'Symbol.keyFor is function');
symbol = Symbol['for']('foo');
assert.strictEqual(Symbol['for']('foo'), symbol);
return assert.strictEqual(Symbol.keyFor(symbol), 'foo');
@@ -4417,7 +4384,7 @@
test('Object.getOwnPropertySymbols', function(assert){
var ref$, getOwnPropertySymbols, getOwnPropertyNames, obj, foo;
ref$ = core.Object, getOwnPropertySymbols = ref$.getOwnPropertySymbols, getOwnPropertyNames = ref$.getOwnPropertyNames;
- assert.ok(isFunction(getOwnPropertySymbols), 'is function');
+ assert.isFunction(getOwnPropertySymbols);
obj = {
q: 1,
w: 2,
@@ -4606,19 +4573,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, WeakMap, Map, freeze, values, iterator, toString$ = {}.toString;
+ var module, test, WeakMap, Map, freeze, values, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
WeakMap = core.WeakMap, Map = core.Map;
freeze = core.Object.freeze;
values = core.Array.values;
iterator = core.Symbol.iterator;
test('WeakMap', function(assert){
var a, b, f, M, done, iter;
- assert.ok(isFunction(WeakMap), 'is function');
+ assert.isFunction(WeakMap);
assert.ok('delete' in WeakMap.prototype, 'delete in WeakMap.prototype');
assert.ok('get' in WeakMap.prototype, 'get in WeakMap.prototype');
assert.ok('has' in WeakMap.prototype, 'has in WeakMap.prototype');
@@ -4656,7 +4620,7 @@
});
test('WeakMap#delete', function(assert){
var M, a, b;
- assert.ok(isFunction(WeakMap.prototype['delete']), 'is function');
+ assert.isFunction(WeakMap.prototype['delete']);
M = new WeakMap([[a = {}, 42], [b = {}, 21]]);
assert.ok(M.has(a) && M.has(b), 'WeakMap has values before .delete()');
M['delete'](a);
@@ -4664,7 +4628,7 @@
});
test('WeakMap#get', function(assert){
var M, a;
- assert.ok(isFunction(WeakMap.prototype.get), 'is function');
+ assert.isFunction(WeakMap.prototype.get);
M = new WeakMap();
assert.strictEqual(M.get({}), void 8, 'WeakMap .get() before .set() return undefined');
M.set(a = {}, 42);
@@ -4674,7 +4638,7 @@
});
test('WeakMap#has', function(assert){
var M, a;
- assert.ok(isFunction(WeakMap.prototype.has), 'is function');
+ assert.isFunction(WeakMap.prototype.has);
M = new WeakMap();
assert.ok(!M.has({}), 'WeakMap .has() before .set() return false');
M.set(a = {}, 42);
@@ -4684,7 +4648,7 @@
});
test('WeakMap#set', function(assert){
var w, a, e;
- assert.ok(isFunction(WeakMap.prototype.set), 'is function');
+ assert.isFunction(WeakMap.prototype.set);
assert.ok((w = new WeakMap).set(a = {}, 42) === w, 'chaining');
return assert.ok((function(){
try {
@@ -4704,19 +4668,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, WeakSet, freeze, values, iterator, toString$ = {}.toString;
+ var module, test, WeakSet, freeze, values, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
WeakSet = core.WeakSet;
freeze = core.Object.freeze;
values = core.Array.values;
iterator = core.Symbol.iterator;
test('WeakSet', function(assert){
var a, f, S, done, iter;
- assert.ok(isFunction(WeakSet), 'is function');
+ assert.isFunction(WeakSet);
assert.ok('add' in WeakSet.prototype, 'add in WeakSet.prototype');
assert.ok('delete' in WeakSet.prototype, 'delete in WeakSet.prototype');
assert.ok('has' in WeakSet.prototype, 'has in WeakSet.prototype');
@@ -4751,7 +4712,7 @@
});
test('WeakSet#add', function(assert){
var w, e;
- assert.ok(isFunction(WeakSet.prototype.add), 'is function');
+ assert.isFunction(WeakSet.prototype.add);
assert.ok((w = new WeakSet).add({}) === w, 'chaining');
return assert.ok((function(){
try {
@@ -4765,7 +4726,7 @@
});
test('WeakSet#delete', function(assert){
var S, a, b;
- assert.ok(isFunction(WeakSet.prototype['delete']), 'is function');
+ assert.isFunction(WeakSet.prototype['delete']);
S = new WeakSet().add(a = {}).add(b = {});
assert.ok(S.has(a) && S.has(b), 'WeakSet has values before .delete()');
S['delete'](a);
@@ -4773,7 +4734,7 @@
});
test('WeakSet#has', function(assert){
var M, a;
- assert.ok(isFunction(WeakSet.prototype.has), 'is function');
+ assert.isFunction(WeakSet.prototype.has);
M = new WeakSet();
assert.ok(!M.has({}), 'WeakSet has`nt value');
M.add(a = {});
@@ -4790,13 +4751,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Array#includes', function(assert){
var includes, arr, o;
includes = core.Array.includes;
- assert.ok(toString$.call(includes).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(includes);
arr = [1, 2, 3, -0, o = {}];
assert.ok(includes(arr, 1));
assert.ok(includes(arr, -0));
@@ -4822,16 +4783,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Object.entries', function(assert){
var ref$, entries, create, assign;
ref$ = core.Object, entries = ref$.entries, create = ref$.create, assign = ref$.assign;
- assert.ok(toString$.call(entries).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(entries.length, 1, 'arity is 1');
+ assert.isFunction(entries);
+ assert.arity(entries, 1);
if ('name' in entries) {
- assert.strictEqual(entries.name, 'entries', 'name is "entries"');
+ assert.name(entries, 'entries');
}
assert.deepEqual(entries({
q: 1,
@@ -4856,7 +4817,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, descriptors, create, toString$ = {}.toString;
+ var module, test, descriptors, create;
module = QUnit.module, test = QUnit.test;
module('ES7');
descriptors = function(){
@@ -4872,7 +4833,7 @@
test('Object.getOwnPropertyDescriptors', function(assert){
var getOwnPropertyDescriptors, O, s, descs;
getOwnPropertyDescriptors = core.Object.getOwnPropertyDescriptors;
- assert.ok(toString$.call(getOwnPropertyDescriptors).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(getOwnPropertyDescriptors);
O = create({
q: 1
}, {
@@ -4912,16 +4873,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Object.values', function(assert){
var ref$, values, create, assign;
ref$ = core.Object, values = ref$.values, create = ref$.create, assign = ref$.assign;
- assert.ok(toString$.call(values).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(values.length, 1, 'arity is 1');
+ assert.isFunction(values);
+ assert.arity(values, 1);
if ('name' in values) {
- assert.strictEqual(values.name, 'values', 'name is "values"');
+ assert.name(values, 'values');
}
assert.deepEqual(values({
q: 1,
@@ -4946,13 +4907,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('RegExp.escape', function(assert){
var escape;
escape = core.RegExp.escape;
- assert.ok(toString$.call(escape).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(escape);
assert.strictEqual(escape('qwe asd'), 'qwe asd', "Don't change simple string");
return assert.strictEqual(escape('\\[]{}()*+?.^$|'), '\\\\\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\^\\$\\|', 'Escape all RegExp special chars');
});
@@ -4961,13 +4922,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#at', function(assert){
var at;
at = core.String.at;
- assert.ok(toString$.call(at).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(at);
assert.strictEqual(at('abc\uD834\uDF06def', -Infinity), '');
assert.strictEqual(at('abc\uD834\uDF06def', -1), '');
assert.strictEqual(at('abc\uD834\uDF06def', -0), 'a');
@@ -5063,13 +5024,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#padLeft', function(assert){
var padLeft;
padLeft = core.String.padLeft;
- assert.ok(toString$.call(padLeft).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(padLeft);
assert.strictEqual(padLeft('abc', 5), ' abc');
assert.strictEqual(padLeft('abc', 4, 'de'), 'dabc');
assert.strictEqual(padLeft('abc'), 'abc');
@@ -5092,13 +5053,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#padRight', function(assert){
var padRight;
padRight = core.String.padRight;
- assert.ok(toString$.call(padRight).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(padRight);
assert.strictEqual(padRight('abc', 5), 'abc ');
assert.strictEqual(padRight('abc', 4, 'de'), 'abcd');
assert.strictEqual(padRight('abc'), 'abc');
@@ -5121,13 +5082,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#trimLeft', function(assert){
var trimLeft;
trimLeft = core.String.trimLeft;
- assert.ok(toString$.call(trimLeft).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(trimLeft);
assert.strictEqual(trimLeft(' \n q w e \n '), 'q w e \n ', 'removes whitespaces at left side of string');
assert.strictEqual(trimLeft('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'), '', 'removes all whitespaces');
assert.strictEqual(trimLeft('\u200b\u0085'), '\u200b\u0085', "shouldn't remove this symbols");
@@ -5147,13 +5108,13 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#trimRight', function(assert){
var trimRight;
trimRight = core.String.trimRight;
- assert.ok(toString$.call(trimRight).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(trimRight);
assert.strictEqual(trimRight(' \n q w e \n '), ' \n q w e', 'removes whitespaces at right side of string');
assert.strictEqual(trimRight('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'), '', 'removes all whitespaces');
assert.strictEqual(trimRight('\u200b\u0085'), '\u200b\u0085', "shouldn't remove this symbols");
@@ -5172,18 +5133,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, slice, toString$ = {}.toString;
+ var module, test, slice, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('Mozilla JavaScript Array statics');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
slice = Array.prototype.slice;
test('are functions', function(assert){
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = ['concat', 'join', 'pop', 'push', 'reverse', 'shift', 'slice', 'sort', 'splice', 'unshift', 'indexOf', 'lastIndexOf', 'every', 'some', 'forEach', 'map', 'filter', 'reduce', 'reduceRight', 'copyWithin', 'fill', 'find', 'findIndex', 'keys', 'values', 'entries', 'includes']).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(core.Array[x$]), "Array." + x$ + " is function"));
+ results$.push(assert.isFunction(core.Array[x$], "Array." + x$ + " is function"));
}
return results$;
});
@@ -5619,7 +5577,6 @@
test('.keys', function(assert){
var keys, iter1, iter2;
keys = core.Array.keys;
- assert.ok(typeof keys === 'function', 'is function');
iter1 = keys(function(){
return arguments;
}('q', 'w', 'e'));
@@ -5662,7 +5619,6 @@
test('.values', function(assert){
var values, iter1, iter2;
values = core.Array.values;
- assert.ok(typeof values === 'function', 'is function');
iter1 = values(function(){
return arguments;
}('q', 'w', 'e'));
@@ -5705,7 +5661,6 @@
test('.entries', function(assert){
var entries, iter1, iter2;
entries = core.Array.entries;
- assert.ok(typeof entries === 'function', 'is function');
iter1 = entries(function(){
return arguments;
}('q', 'w', 'e'));
@@ -5748,7 +5703,6 @@
test('.includes', function(assert){
var includes, args, o, str;
includes = core.Array.includes;
- assert.ok(isFunction(includes), 'is function');
args = function(){
return arguments;
}(1, 2, 3, -0, NaN, o = {});
@@ -5768,12 +5722,9 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, toString$ = {}.toString;
+ var module, test, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('DOM iterable');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
if ((typeof NodeList != 'undefined' && NodeList !== null) && ((typeof document != 'undefined' && document !== null) && document.querySelectorAll) && toString$.call(document.querySelectorAll('div')).slice(8, -1) === 'NodeList') {
test('NodeList.prototype@@iterator', function(assert){
return assert.ok(core.isIterable(document.querySelectorAll('div')), 'Is iterable');
@@ -5788,12 +5739,9 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, timeLimitedPromise, setImmediate, clearImmediate, Promise, toString$ = {}.toString;
+ var module, test, timeLimitedPromise, setImmediate, clearImmediate, Promise;
module = QUnit.module, test = QUnit.test;
module('Immediate');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
timeLimitedPromise = function(time, fn){
return Promise.race([
new Promise(fn), new Promise(function(res, rej){
@@ -5805,8 +5753,8 @@
test('setImmediate / clearImmediate', function(assert){
var def;
assert.expect(6);
- assert.ok(isFunction(setImmediate), 'setImmediate is function');
- assert.ok(isFunction(clearImmediate), 'clearImmediate is function');
+ assert.isFunction(setImmediate, 'setImmediate is function');
+ assert.isFunction(clearImmediate, 'clearImmediate is function');
timeLimitedPromise(1e3, function(res){
return setImmediate(function(){
def = 'a';
diff --git a/tests/library/core.delay.ls b/tests/library/core.delay.ls
index f6c456209211..b7811b96a597 100644
--- a/tests/library/core.delay.ls
+++ b/tests/library/core.delay.ls
@@ -6,7 +6,7 @@ timeLimitedPromise = (time, fn)-> Promise.race [new Promise(fn), new Promise (re
test 'delay' (assert)->
assert.expect 3
- assert.ok typeof! delay is \Function, 'is function'
+ assert.isFunction delay
assert.ok delay(42) instanceof Promise, 'returns promises'
timeLimitedPromise(1e3, !(res)-> delay(10).then !-> res it)
.then -> assert.ok it is on, 'resolves as `true`'
diff --git a/tests/library/core.dict.ls b/tests/library/core.dict.ls
index 8d9467fb4282..58d2e8a9aff8 100644
--- a/tests/library/core.dict.ls
+++ b/tests/library/core.dict.ls
@@ -1,13 +1,12 @@
{module, test} = QUnit
-
module 'core-js'
-isFunction = -> typeof! it is \Function
+
{Dict, Set, Symbol} = core
{keys, create, assign, make} = core.Object
{from, values} = core.Array
test 'Dict' (assert)->
- assert.ok isFunction(Dict), 'is function'
+ assert.isFunction Dict
dict1 = Dict!
assert.ok dict1 not instanceof Object
assert.deepEqual keys(dict1), []
@@ -30,7 +29,7 @@ test 'Dict' (assert)->
test 'Dict.every' (assert)->
{every} = Dict
- assert.ok isFunction(every), 'is function'
+ assert.isFunction every
every obj = {q: 1} (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -42,7 +41,7 @@ test 'Dict.every' (assert)->
test 'Dict.filter' (assert)->
{filter} = Dict
- assert.ok isFunction(filter), 'is function'
+ assert.isFunction filter
filter obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -53,7 +52,7 @@ test 'Dict.filter' (assert)->
test 'Dict.find' (assert)->
{find} = Dict
- assert.ok isFunction(find), 'is function'
+ assert.isFunction find
find obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -64,7 +63,7 @@ test 'Dict.find' (assert)->
test 'Dict.findKey' (assert)->
{findKey} = Dict
- assert.ok isFunction(findKey), 'is function'
+ assert.isFunction findKey
findKey obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -75,7 +74,7 @@ test 'Dict.findKey' (assert)->
test 'Dict.forEach' (assert)->
{forEach} = Dict
- assert.ok isFunction(forEach), 'is function'
+ assert.isFunction forEach
forEach obj = {q: 1}, (val, key, that)!->
assert.ok val is 1
assert.ok key is \q
@@ -100,14 +99,14 @@ test 'Dict.forEach' (assert)->
test 'Dict.keyOf' (assert)->
{keyOf} = Dict
- assert.ok isFunction(keyOf), 'is function'
+ assert.isFunction keyOf
assert.ok keyOf({q:1 w:2 e:3} 2) is \w
assert.ok keyOf({q:1 w:2 e:3} 4) is void
assert.ok keyOf({q:1 w:2 e:NaN} NaN) is void
test 'Dict.map' (assert)->
{map} = Dict
- assert.ok isFunction(map), 'is function'
+ assert.isFunction map
map obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -118,7 +117,7 @@ test 'Dict.map' (assert)->
test 'Dict.mapPairs' (assert)->
{mapPairs} = Dict
- assert.ok isFunction(mapPairs), 'is function'
+ assert.isFunction mapPairs
mapPairs obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -129,7 +128,7 @@ test 'Dict.mapPairs' (assert)->
test 'Dict.reduce' (assert)->
{reduce} = Dict
- assert.ok isFunction(reduce), 'is function'
+ assert.isFunction reduce
reduce (obj = a:1), (memo, val, key, that)->
assert.ok memo is foo
assert.ok val is 1
@@ -148,7 +147,7 @@ test 'Dict.reduce' (assert)->
test 'Dict.some' (assert)->
{some} = Dict
- assert.ok isFunction(some), 'is function'
+ assert.isFunction some
some obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -160,7 +159,7 @@ test 'Dict.some' (assert)->
test 'Dict.includes' (assert)->
{includes} = Dict
- assert.ok isFunction(includes), 'is function'
+ assert.isFunction includes
dict = {q:1, w: NaN, e: -0, r: o = {}}
assert.ok includes dict, 1
assert.ok includes dict, -0
@@ -173,7 +172,7 @@ test 'Dict.includes' (assert)->
test 'Dict.has' (assert)->
{has} = Dict
- assert.ok isFunction(has), 'is function'
+ assert.isFunction has
assert.ok has q:1, \q
assert.ok not has q:1, \w
assert.ok has [1] 0
@@ -183,7 +182,7 @@ test 'Dict.has' (assert)->
test 'Dict.get' (assert)->
{get} = Dict
- assert.ok isFunction(get), 'is function'
+ assert.isFunction get
assert.ok get(q:1, \q) is 1
assert.ok get(q:1, \w) is void
assert.ok get([1] 0) is 1
@@ -193,7 +192,7 @@ test 'Dict.get' (assert)->
test 'Dict.values' (assert)->
{values} = Dict
- assert.ok isFunction(values), 'is function'
+ assert.isFunction values
iter = values {}
assert.ok iter[Symbol?toStringTag] is 'Dict Iterator'
assert.ok \next of iter
@@ -203,7 +202,7 @@ test 'Dict.values' (assert)->
test 'Dict.keys' (assert)->
{keys} = Dict
- assert.ok isFunction(keys), 'is function'
+ assert.isFunction keys
iter = keys {}
assert.ok iter[Symbol?toStringTag] is 'Dict Iterator'
assert.ok \next of iter
@@ -213,7 +212,7 @@ test 'Dict.keys' (assert)->
test 'Dict.entries' (assert)->
{entries} = Dict
- assert.ok isFunction(entries), 'is function'
+ assert.isFunction entries
iter = entries {}
assert.ok iter[Symbol?toStringTag] is 'Dict Iterator'
assert.ok \next of iter
diff --git a/tests/library/core.function.part.ls b/tests/library/core.function.part.ls
index fd58d2a41855..e649e3f97a07 100644
--- a/tests/library/core.function.part.ls
+++ b/tests/library/core.function.part.ls
@@ -1,20 +1,19 @@
{module, test} = QUnit
module 'core-js'
-isFunction = -> typeof! it is \Function
{map, every, reduce} = core.Array
test 'Function#part' (assert)->
{part} = core.Function
$ = core._
- assert.ok isFunction(part), 'is function'
+ assert.isFunction part
assert.ok part((-> typeof! it is \String), \qwe)!
obj = a: 42
obj.fn = part (-> @a + it), 21
assert.ok obj.fn! is 63
fn = -> map(&, String).join ' '
p = part fn, $, \Саша, $, \шоссе, $, \сосала
- assert.ok isFunction(p), '.part with placeholders return function'
+ assert.isFunction p, '.part with placeholders return function'
assert.ok p(\Шла \по) is 'Шла Саша по шоссе undefined сосала', '.part with placeholders: args < placeholders'
assert.ok p(\Шла \по \и) is 'Шла Саша по шоссе и сосала', '.part with placeholders: args == placeholders'
assert.ok p(\Шла \по \и \сушку) is 'Шла Саша по шоссе и сосала сушку', '.part with placeholders: args > placeholders'
\ No newline at end of file
diff --git a/tests/library/core.get-iterator-method.ls b/tests/library/core.get-iterator-method.ls
index 7b2ef318ea05..c73f16c05359 100644
--- a/tests/library/core.get-iterator-method.ls
+++ b/tests/library/core.get-iterator-method.ls
@@ -5,7 +5,7 @@ module \core-js
test 'core.getIteratorMethod' (assert)->
{getIteratorMethod} = core
- assert.ok typeof getIteratorMethod is \function, 'is function'
+ assert.isFunction getIteratorMethod
assert.strictEqual getIteratorMethod({}), void
iterFn = getIteratorMethod []
assert.ok typeof iterFn is \function
diff --git a/tests/library/core.get-iterator.ls b/tests/library/core.get-iterator.ls
index b907e4620912..547aa6e67fa9 100644
--- a/tests/library/core.get-iterator.ls
+++ b/tests/library/core.get-iterator.ls
@@ -5,7 +5,7 @@ module \core-js
test 'core.getIterator' (assert)->
{getIterator} = core
- assert.ok typeof getIterator is \function, 'is function'
+ assert.isFunction getIterator
assert.throws (!-> getIterator {}), TypeError
iter = getIterator []
assert.ok \next of iter
diff --git a/tests/library/core.is-iterable.ls b/tests/library/core.is-iterable.ls
index e4a1624fd3eb..49992b145ee8 100644
--- a/tests/library/core.is-iterable.ls
+++ b/tests/library/core.is-iterable.ls
@@ -5,7 +5,7 @@ module \core-js
test 'core.isIterable' (assert)->
{isIterable} = core
- assert.ok typeof isIterable is \function, 'is function'
+ assert.isFunction isIterable
assert.ok !isIterable {}
assert.ok isIterable []
assert.ok isIterable (->&)!
\ No newline at end of file
diff --git a/tests/library/core.log.ls b/tests/library/core.log.ls
index a6e781f8813d..e72293082b1d 100644
--- a/tests/library/core.log.ls
+++ b/tests/library/core.log.ls
@@ -1,17 +1,15 @@
{module, test} = QUnit
module 'core-js'
-isFunction = -> typeof! it is \Function
-isObject = -> it is Object it
{log} = core
methods = <[assert count debug dir dirxml error exception group groupEnd groupCollapsed groupEnd info log table trace warn markTimeline profile profileEnd time timeEnd timeStamp]>
test 'is object' (assert)->
- assert.ok isObject(log), 'global.log is object'
+ assert.strictEqual log, Object(log), 'global.log is object'
test 'log.{..} are functions' (assert)->
- for methods => assert.ok isFunction(log[..]), "log.#{..} is function"
+ for methods => assert.isFunction log[..], "log.#{..} is function"
test 'call log.{..}' (assert)->
for m in methods => assert.ok (try
@@ -29,12 +27,12 @@ test 'call unbound log.#{..}' (assert)->
test 'log.{enable, disable}' (assert)->
{enable, disable} = log
- assert.ok isFunction(enable), 'log.enable is function'
- assert.ok isFunction(disable), 'log.disable is function'
+ assert.isFunction enable, 'log.enable is function'
+ assert.isFunction disable, 'log.disable is function'
assert.ok (try disable!; on), 'disable log'
assert.ok (try log.log('call disabled log') is void), 'call disabled log'
assert.ok (try enable!; on), 'enable log'
test 'log' (assert)->
- assert.ok isFunction(log), 'global.log is function'
+ assert.isFunction log
assert.ok (try log(42); on), 'call log'
\ No newline at end of file
diff --git a/tests/library/core.object.classof.ls b/tests/library/core.object.classof.ls
index 12d7c3293fe1..6ac27a1ab5d3 100644
--- a/tests/library/core.object.classof.ls
+++ b/tests/library/core.object.classof.ls
@@ -3,7 +3,7 @@ module 'core-js'
test 'Object.classof' (assert)->
{classof} = core.Object
- assert.ok typeof! classof is \Function, 'is function'
+ assert.isFunction classof
assert.ok classof(void) is \Undefined, 'classof undefined is `Undefined`'
assert.ok classof(null) is \Null, 'classof null is `Null`'
assert.ok classof(true) is \Boolean, 'classof bool is `Boolean`'
diff --git a/tests/library/core.object.define.ls b/tests/library/core.object.define.ls
index 99ca07d9f85b..fcddc36e657c 100644
--- a/tests/library/core.object.define.ls
+++ b/tests/library/core.object.define.ls
@@ -3,7 +3,7 @@ module 'core-js'
test 'Object.define' (assert)->
{define, defineProperty} = core.Object
- assert.ok typeof! define is \Function, 'is function'
+ assert.isFunction define
foo = q:1
assert.ok foo is define foo, w:2
assert.ok foo.w is 2
diff --git a/tests/library/core.object.is-object.ls b/tests/library/core.object.is-object.ls
index 1bf518773909..7fa9cbe236f7 100644
--- a/tests/library/core.object.is-object.ls
+++ b/tests/library/core.object.is-object.ls
@@ -3,7 +3,7 @@ module 'core-js'
test 'Object.isObject' (assert)->
{isObject} = core.Object
- assert.ok typeof! isObject is \Function, 'is function'
+ assert.isFunction isObject
assert.ok not isObject(void), 'isObject undefined return false'
assert.ok not isObject(null), 'isObject null return false'
assert.ok not isObject(1), 'isObject number return false'
diff --git a/tests/library/core.object.make.ls b/tests/library/core.object.make.ls
index 969deebff998..7a9a9b1696d4 100644
--- a/tests/library/core.object.make.ls
+++ b/tests/library/core.object.make.ls
@@ -3,7 +3,7 @@ module 'core-js'
test 'Object.make' (assert)->
{make} = core.Object
- assert.ok typeof! make is \Function, 'is function'
+ assert.isFunction make
object = make foo = {q:1}, {w:2}
assert.ok core.Object.getPrototypeOf(object) is foo
assert.ok object.w is 2
\ No newline at end of file
diff --git a/tests/library/core.string.escape-html.ls b/tests/library/core.string.escape-html.ls
index 53a684e7ea78..0db960539ca7 100644
--- a/tests/library/core.string.escape-html.ls
+++ b/tests/library/core.string.escape-html.ls
@@ -3,7 +3,7 @@ module 'core-js'
test 'String#escapeHTML' (assert)->
{escapeHTML} = core.String
- assert.ok typeof! escapeHTML is \Function, 'is function'
+ assert.isFunction escapeHTML
assert.strictEqual escapeHTML('qwe, asd'), 'qwe, asd'
assert.strictEqual escapeHTML('qwe
'), '<div>qwe</div>'
assert.strictEqual escapeHTML("&<>\"'"), '&<>"''
\ No newline at end of file
diff --git a/tests/library/core.string.unescape-html.ls b/tests/library/core.string.unescape-html.ls
index e0f90122851e..b6f7b8f6065e 100644
--- a/tests/library/core.string.unescape-html.ls
+++ b/tests/library/core.string.unescape-html.ls
@@ -3,7 +3,7 @@ module 'core-js'
test 'String#unescapeHTML' (assert)->
{unescapeHTML} = core.String
- assert.ok typeof! unescapeHTML is \Function, 'is function'
+ assert.isFunction unescapeHTML
assert.strictEqual unescapeHTML('qwe, asd'), 'qwe, asd'
assert.strictEqual unescapeHTML('<div>qwe</div>'), 'qwe
'
assert.strictEqual unescapeHTML('&<>"''), "&<>\"'"
\ No newline at end of file
diff --git a/tests/library/es5.ls b/tests/library/es5.ls
index 1824179643f3..7d50b4f61ef4 100644
--- a/tests/library/es5.ls
+++ b/tests/library/es5.ls
@@ -1,29 +1,27 @@
{module, test} = QUnit
module \ES5
-isFunction = -> typeof! it is \Function
-
test 'Object.getOwnPropertyDescriptor' (assert)->
{getOwnPropertyDescriptor} = core.Object
- assert.ok isFunction(getOwnPropertyDescriptor), 'is function'
+ assert.isFunction getOwnPropertyDescriptor
assert.deepEqual getOwnPropertyDescriptor(q:42, \q), {+writable, +enumerable, +configurable, value: 42}
assert.ok getOwnPropertyDescriptor({}, \toString) is void
test 'Object.defineProperty' (assert)->
{defineProperty} = core.Object
- assert.ok isFunction(defineProperty), 'is function'
+ assert.isFunction defineProperty
assert.ok (rez = defineProperty src = {}, \q, value: 42) is src
assert.ok rez.q is 42
test 'Object.defineProperties' (assert)->
{defineProperties} = core.Object
- assert.ok isFunction(defineProperties), 'is function'
+ assert.isFunction defineProperties
assert.ok (rez = defineProperties src = {}, q: {value: 42}, w: value: 33) is src
assert.ok rez.q is 42 and rez.w is 33
test 'Object.getPrototypeOf' (assert)->
{create, getPrototypeOf} = core.Object
- assert.ok isFunction(getPrototypeOf), 'is function'
+ assert.isFunction getPrototypeOf
assert.ok getPrototypeOf({}) is Object::
assert.ok getPrototypeOf([]) is Array::
assert.ok getPrototypeOf(new class fn) is fn::
@@ -39,7 +37,7 @@ test 'Object.getPrototypeOf' (assert)->
test 'Object.getOwnPropertyNames' (assert)->
{getOwnPropertyNames} = core.Object
- assert.ok isFunction(getOwnPropertyNames), 'is function'
+ assert.isFunction getOwnPropertyNames
fn1 = (@w = 2)->
fn2 = (@toString = 2)->
fn1::q = fn2::q = 1
@@ -65,7 +63,7 @@ test 'Object.create' (assert)->
for getOwnPropertyNames(object)
.. in result or result.push ..
result
- assert.ok isFunction(create), 'is function'
+ assert.isFunction create
assert.ok isPrototype obj = q:1, create(obj)
assert.ok create(obj)q is 1
fn = -> @a = 1
@@ -80,7 +78,7 @@ test 'Object.create' (assert)->
test 'Object.keys' (assert)->
{keys} = core.Object
- assert.ok isFunction(keys), 'is function'
+ assert.isFunction keys
fn1 = (@w = 2)->
fn2 = (@toString = 2)->
fn1::q = fn2::q = 1
@@ -91,37 +89,37 @@ test 'Object.keys' (assert)->
test 'Object.seal' (assert)->
{seal} = core.Object
- assert.ok isFunction(seal), 'is function'
+ assert.isFunction seal
assert.strictEqual seal(a = {}), a
test 'Object.freeze' (assert)->
{freeze} = core.Object
- assert.ok isFunction(freeze), 'is function'
+ assert.isFunction freeze
assert.strictEqual freeze(a = {}), a
test 'Object.preventExtensions' (assert)->
{preventExtensions} = core.Object
- assert.ok isFunction(preventExtensions), 'is function'
+ assert.isFunction preventExtensions
assert.strictEqual preventExtensions(a = {}), a
test 'Object.isSealed' (assert)->
{isSealed} = core.Object
- assert.ok isFunction(isSealed), 'is function'
+ assert.isFunction isSealed
assert.strictEqual isSealed({}), no
test 'Object.isFrozen' (assert)->
{isFrozen} = core.Object
- assert.ok isFunction(isFrozen), 'is function'
+ assert.isFunction isFrozen
assert.strictEqual isFrozen({}), no
test 'Object.isExtensible' (assert)->
{isExtensible} = core.Object
- assert.ok isFunction(isExtensible), 'is function'
+ assert.isFunction isExtensible
assert.strictEqual isExtensible({}), on
test 'Function#bind' (assert)->
{bind} = core.Function
- assert.ok isFunction(bind), 'is function'
+ assert.isFunction bind
obj = a: 42
assert.ok 42 is bind((-> @a), obj)!
assert.ok void is new (bind((->), obj))!a
@@ -141,14 +139,14 @@ test 'Function#bind' (assert)->
test 'Array.isArray' (assert)->
{isArray} = core.Array
- assert.ok isFunction(isArray), 'is function'
+ assert.isFunction isArray
assert.ok not isArray {}
assert.ok not isArray do -> &
assert.ok isArray []
test 'ES5 Array prototype methods are functions' (assert)->
for <[indexOf lastIndexOf every some forEach map filter reduce reduceRight]>
- assert.ok isFunction(core.Array[..]), "Array::#{..} is function"
+ assert.isFunction core.Array[..], "Array::#{..} is function"
test 'Array#slice' (assert)->
{slice} = core.Array
@@ -302,12 +300,12 @@ test 'Array#reduceRight' (assert)->
test 'Date.now' (assert)->
{now} = core.Date
- assert.ok isFunction(now), 'is function'
+ assert.isFunction now
assert.ok +new Date - now! < 10, 'Date.now() ~ +new Date'
test 'Date#toISOString' (assert)->
{toISOString} = core.Date
- assert.ok isFunction(toISOString), 'is function'
+ assert.isFunction toISOString
assert.strictEqual toISOString(new Date(0)), '1970-01-01T00:00:00.000Z'
assert.strictEqual toISOString(new Date(1e12+1)), '2001-09-09T01:46:40.001Z'
assert.strictEqual toISOString(new Date(-5e13-1)), '0385-07-25T07:06:39.999Z'
diff --git a/tests/library/es6.array.copy-within.ls b/tests/library/es6.array.copy-within.ls
index ebefe2f33709..1ef1885f9f06 100644
--- a/tests/library/es6.array.copy-within.ls
+++ b/tests/library/es6.array.copy-within.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Array#copyWithin' (assert)->
{copyWithin} = core.Array
- assert.ok typeof! copyWithin is \Function, 'is function'
+ assert.isFunction copyWithin
assert.strictEqual (a = copyWithin [1], 0), a
assert.deepEqual copyWithin([1 2 3 4 5], 0 3), [4 5 3 4 5]
assert.deepEqual copyWithin([1 2 3 4 5], 1 3), [1 4 5 4 5]
diff --git a/tests/library/es6.array.fill.ls b/tests/library/es6.array.fill.ls
index 1713c9c4d85e..86e5ed447f19 100644
--- a/tests/library/es6.array.fill.ls
+++ b/tests/library/es6.array.fill.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Array#fill' (assert)->
{fill} = core.Array
- assert.ok typeof! fill is \Function, 'is function'
+ assert.isFunction fill
assert.strictEqual (a = fill Array(5), 5), a
assert.deepEqual fill(Array(5), 5), [5 5 5 5 5]
assert.deepEqual fill(Array(5), 5 1), [void 5 5 5 5]
diff --git a/tests/library/es6.array.find-index.ls b/tests/library/es6.array.find-index.ls
index ba6237777071..74650091718e 100644
--- a/tests/library/es6.array.find-index.ls
+++ b/tests/library/es6.array.find-index.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Array#findIndex' (assert)->
{findIndex} = core.Array
- assert.ok typeof! findIndex is \Function, 'is function'
+ assert.isFunction findIndex
findIndex arr = [1], (val, key, that)->
assert.strictEqual @, ctx
assert.strictEqual val, 1
diff --git a/tests/library/es6.array.find.ls b/tests/library/es6.array.find.ls
index 317de545480b..c7fb49f8c632 100644
--- a/tests/library/es6.array.find.ls
+++ b/tests/library/es6.array.find.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Array#find' (assert)->
{find} = core.Array
- assert.ok typeof! find is \Function, 'is function'
+ assert.isFunction find
find arr = [1], (val, key, that)->
assert.strictEqual @, ctx
assert.strictEqual val, 1
diff --git a/tests/library/es6.array.from.ls b/tests/library/es6.array.from.ls
index c2e441946070..4dd4ba28c6f8 100644
--- a/tests/library/es6.array.from.ls
+++ b/tests/library/es6.array.from.ls
@@ -4,8 +4,8 @@ module \ES6
test 'Array.from' (assert)->
{from, values} = core.Array
{iterator} = core.Symbol
- assert.ok typeof! from is \Function, 'is function'
- assert.strictEqual from.length, 1, 'arity is 1'
+ assert.isFunction from
+ assert.arity from, 1
assert.deepEqual from(\123), <[1 2 3]>
assert.deepEqual from({length: 3, 0: 1, 1: 2, 2: 3}), [1 2 3]
from al = (-> &)(1), (val, key)->
diff --git a/tests/library/es6.array.iterator.ls b/tests/library/es6.array.iterator.ls
index c462e21f39bb..740665e906f1 100644
--- a/tests/library/es6.array.iterator.ls
+++ b/tests/library/es6.array.iterator.ls
@@ -1,13 +1,12 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
{Symbol} = core
{keys, values, entries} = core.Array
test 'Array#@@iterator' (assert)->
- assert.ok isFunction(values), 'is function'
+ assert.isFunction values
iter = core.getIterator <[q w e]>
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
@@ -17,7 +16,7 @@ test 'Array#@@iterator' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Array#keys' (assert)->
- assert.ok isFunction(keys), 'is function'
+ assert.isFunction keys
iter = keys <[q w e]>
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
@@ -27,7 +26,7 @@ test 'Array#keys' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Array#values' (assert)->
- assert.ok isFunction(values), 'is function'
+ assert.isFunction values
iter = values <[q w e]>
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
@@ -37,7 +36,7 @@ test 'Array#values' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Array#entries' (assert)->
- assert.ok isFunction(entries), 'is function'
+ assert.isFunction entries
iter = entries <[q w e]>
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
diff --git a/tests/library/es6.array.of.ls b/tests/library/es6.array.of.ls
index 709ff0e2acc1..25ff3ff0917f 100644
--- a/tests/library/es6.array.of.ls
+++ b/tests/library/es6.array.of.ls
@@ -2,8 +2,8 @@
module \ES6
test 'Array.of' (assert)->
- assert.ok typeof! core.Array.of is \Function, 'is function'
- assert.strictEqual core.Array.of.length, 0, 'arity is 0'
+ assert.isFunction core.Array.of
+ assert.arity core.Array.of, 0
assert.deepEqual core.Array.of(1), [1]
assert.deepEqual core.Array.of(1 2 3), [1 2 3]
# generic
diff --git a/tests/library/es6.map.ls b/tests/library/es6.map.ls
index d077189a2c57..9b4512d8c479 100644
--- a/tests/library/es6.map.ls
+++ b/tests/library/es6.map.ls
@@ -1,8 +1,7 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
same = (a, b)-> if a is b => a isnt 0 or 1 / a is 1 / b else a !~= a and b !~= b
{Map, Symbol} = core
{getOwnPropertyDescriptor, freeze} = core.Object
@@ -10,7 +9,7 @@ same = (a, b)-> if a is b => a isnt 0 or 1 / a is 1 / b else a !~= a and b !~= b
{iterator} = core.Symbol
test 'Map' (assert)->
- assert.ok isFunction(Map), 'is function'
+ assert.isFunction Map
assert.ok \clear of Map::, 'clear in Map.prototype'
assert.ok \delete of Map::, 'delete in Map.prototype'
assert.ok \forEach of Map::, 'forEach in Map.prototype'
@@ -38,7 +37,7 @@ test 'Map' (assert)->
assert.ok done
test 'Map#clear' (assert)->
- assert.ok isFunction(Map::clear), 'is function'
+ assert.isFunction Map::clear
M = new Map
M.clear!
assert.strictEqual M.size, 0
@@ -54,7 +53,7 @@ test 'Map#clear' (assert)->
assert.ok !M.has f
test 'Map#delete' (assert)->
- assert.ok isFunction(Map::delete), 'is function'
+ assert.isFunction Map::delete
a = []
M = new Map!set NaN, 1 .set 2 1 .set 3 1 .set 2 5 .set 1 4 .set a, {}
assert.strictEqual M.size, 5
@@ -72,7 +71,7 @@ test 'Map#delete' (assert)->
assert.strictEqual M.size, 3
test 'Map#forEach' (assert)->
- assert.ok isFunction(Map::forEach), 'is function'
+ assert.isFunction Map::forEach
r = {}
var T
count = 0
@@ -101,7 +100,7 @@ test 'Map#forEach' (assert)->
assert.strictEqual s, \1
test 'Map#get' (assert)->
- assert.ok isFunction(Map::get), 'is function'
+ assert.isFunction Map::get
o = {}
f = freeze {}
M = new Map [[NaN, 1], [2 1], [3 1], [2 5], [1 4], [f, 42], [o, o]]
@@ -113,7 +112,7 @@ test 'Map#get' (assert)->
assert.strictEqual M.get(2), 5
test 'Map#has' (assert)->
- assert.ok isFunction(Map::has), 'is function'
+ assert.isFunction Map::has
o = {}
f = freeze {}
M = new Map [[NaN, 1], [2 1], [3 1], [2 5], [1 4], [f, 42], [o, o]]
@@ -125,7 +124,7 @@ test 'Map#has' (assert)->
assert.ok not M.has {}
test 'Map#set' (assert)->
- assert.ok isFunction(Map::set), 'is function'
+ assert.isFunction Map::set
o = {}
M = new Map!set NaN, 1 .set 2 1 .set 3 1 .set 2 5 .set 1 4 .set o, o
assert.ok M.size is 5
@@ -194,7 +193,7 @@ test 'Map Iterator' (assert)->
assert.deepEqual keys, <[a d e]>
test 'Map#keys' (assert)->
- assert.ok typeof Map::keys is \function, 'is function'
+ assert.isFunction Map::keys
iter = new Map([[\a \q],[\s \w],[\d \e]])keys!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Map Iterator'
@@ -204,7 +203,7 @@ test 'Map#keys' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Map#values' (assert)->
- assert.ok typeof Map::values is \function, 'is function'
+ assert.isFunction Map::values
iter = new Map([[\a \q],[\s \w],[\d \e]])values!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Map Iterator'
@@ -214,7 +213,7 @@ test 'Map#values' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Map#entries' (assert)->
- assert.ok typeof Map::entries is \function, 'is function'
+ assert.isFunction Map::entries
iter = new Map([[\a \q],[\s \w],[\d \e]])entries!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Map Iterator'
diff --git a/tests/library/es6.math.acosh.ls b/tests/library/es6.math.acosh.ls
index 29ed518087ce..80f2dc372f42 100644
--- a/tests/library/es6.math.acosh.ls
+++ b/tests/library/es6.math.acosh.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the inverse hyperbolic cosine of x.
test 'Math.acosh' (assert)->
{acosh} = core.Math
- assert.ok typeof! acosh is \Function, 'is function'
+ assert.isFunction acosh
assert.same acosh(NaN), NaN
assert.same acosh(0.5), NaN
assert.same acosh(-1), NaN
diff --git a/tests/library/es6.math.asinh.ls b/tests/library/es6.math.asinh.ls
index 715a027d7053..c95b6a16396d 100644
--- a/tests/library/es6.math.asinh.ls
+++ b/tests/library/es6.math.asinh.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the inverse hyperbolic sine of x.
test 'Math.asinh' (assert)->
{asinh} = core.Math
- assert.ok typeof! asinh is \Function, 'is function'
+ assert.isFunction asinh
assert.same asinh(NaN), NaN
assert.same asinh(0), 0
assert.same asinh(-0), -0
diff --git a/tests/library/es6.math.atanh.ls b/tests/library/es6.math.atanh.ls
index 5aedbe12676a..84bb4853fd3b 100644
--- a/tests/library/es6.math.atanh.ls
+++ b/tests/library/es6.math.atanh.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the inverse hyperbolic tangent of x.
test 'Math.atanh' (assert)->
{atanh} = core.Math
- assert.ok typeof! atanh is \Function, 'is function'
+ assert.isFunction atanh
assert.same atanh(NaN), NaN
assert.same atanh(-2), NaN
assert.same atanh(-1.5), NaN
diff --git a/tests/library/es6.math.cbrt.ls b/tests/library/es6.math.cbrt.ls
index 65289e157fd1..faf93b557caf 100644
--- a/tests/library/es6.math.cbrt.ls
+++ b/tests/library/es6.math.cbrt.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the cube root of x.
test 'Math.cbrt' (assert)->
{cbrt} = core.Math
- assert.ok typeof! cbrt is \Function, 'is function'
+ assert.isFunction cbrt
assert.same cbrt(NaN), NaN
assert.same cbrt(0), 0
assert.same cbrt(-0), -0
diff --git a/tests/library/es6.math.clz32.ls b/tests/library/es6.math.clz32.ls
index b8af6dfbed90..af2db584d71a 100644
--- a/tests/library/es6.math.clz32.ls
+++ b/tests/library/es6.math.clz32.ls
@@ -3,7 +3,7 @@ module \ES6
test 'Math.clz32' (assert)->
{clz32} = core.Math
- assert.ok typeof! clz32 is \Function, 'is function'
+ assert.isFunction clz32
assert.strictEqual clz32(0), 32
assert.strictEqual clz32(1), 31
assert.same clz32(-1), 0
diff --git a/tests/library/es6.math.cosh.ls b/tests/library/es6.math.cosh.ls
index b875df210596..b8e1796865b4 100644
--- a/tests/library/es6.math.cosh.ls
+++ b/tests/library/es6.math.cosh.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the hyperbolic cosine of x.
test 'Math.cosh' (assert)->
{cosh} = core.Math
- assert.ok typeof! cosh is \Function, 'is function'
+ assert.isFunction cosh
assert.same cosh(NaN), NaN
assert.strictEqual cosh(0), 1
assert.strictEqual cosh(-0), 1
diff --git a/tests/library/es6.math.expm1.ls b/tests/library/es6.math.expm1.ls
index 5ac3debb406d..356d76950eb7 100644
--- a/tests/library/es6.math.expm1.ls
+++ b/tests/library/es6.math.expm1.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to subtracting 1 from the exponential function of x
test 'Math.expm1' (assert)->
{expm1} = core.Math
- assert.ok typeof! expm1 is \Function, 'is function'
+ assert.isFunction expm1
assert.same expm1(NaN), NaN
assert.same expm1(0), 0
assert.same expm1(-0), -0
diff --git a/tests/library/es6.math.fround.ls b/tests/library/es6.math.fround.ls
index 689f0b552768..abd4008e581c 100644
--- a/tests/library/es6.math.fround.ls
+++ b/tests/library/es6.math.fround.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Math.fround' (assert)->
# https://github.com/paulmillr/es6-shim/blob/master/test/math.js
{fround} = core.Math
- assert.ok typeof! fround is \Function, 'is function'
+ assert.isFunction fround
assert.same fround(void), NaN
assert.same fround(NaN), NaN
assert.same fround(0), 0
diff --git a/tests/library/es6.math.hypot.ls b/tests/library/es6.math.hypot.ls
index 080c52a8c8ae..ea0d5ad5016b 100644
--- a/tests/library/es6.math.hypot.ls
+++ b/tests/library/es6.math.hypot.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Math.hypot' (assert)->
{hypot} = core.Math
{sqrt} = Math
- assert.ok typeof! hypot is \Function, 'is function'
+ assert.isFunction hypot
assert.strictEqual hypot!, 0
assert.strictEqual hypot(1), 1
assert.same hypot('', 0), 0
diff --git a/tests/library/es6.math.imul.ls b/tests/library/es6.math.imul.ls
index d49d6c4d06b1..0de703f695f3 100644
--- a/tests/library/es6.math.imul.ls
+++ b/tests/library/es6.math.imul.ls
@@ -3,7 +3,7 @@ module \ES6
test 'Math.imul' (assert)->
{imul} = core.Math
- assert.ok typeof! imul is \Function, 'is function'
+ assert.isFunction imul
assert.same imul(0, 0), 0
assert.strictEqual imul(123, 456), 56088
assert.strictEqual imul(-123, 456), -56088
diff --git a/tests/library/es6.math.log10.ls b/tests/library/es6.math.log10.ls
index a906b2372a90..71f3bc4bf272 100644
--- a/tests/library/es6.math.log10.ls
+++ b/tests/library/es6.math.log10.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the base 10 logarithm of x.
test 'Math.log10' (assert)->
{log10} = core.Math
- assert.ok typeof! log10 is \Function, 'is function'
+ assert.isFunction log10
assert.same log10(''), log10 0
assert.same log10(NaN), NaN
assert.same log10(-1), NaN
diff --git a/tests/library/es6.math.log1p.ls b/tests/library/es6.math.log1p.ls
index 81ee852dc6ff..846f515afa8c 100644
--- a/tests/library/es6.math.log1p.ls
+++ b/tests/library/es6.math.log1p.ls
@@ -4,7 +4,7 @@ module \ES6
# The result is computed in a way that is accurate even when the value of x is close to zero.
test 'Math.log1p' (assert)->
{log1p} = core.Math
- assert.ok typeof! log1p is \Function, 'is function'
+ assert.isFunction log1p
assert.same log1p(''), log1p 0
assert.same log1p(NaN), NaN
assert.same log1p(-2), NaN
diff --git a/tests/library/es6.math.log2.ls b/tests/library/es6.math.log2.ls
index 80dacf780738..534192da2add 100644
--- a/tests/library/es6.math.log2.ls
+++ b/tests/library/es6.math.log2.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the base 2 logarithm of x.
test 'Math.log2' (assert)->
{log2} = core.Math
- assert.ok typeof! log2 is \Function, 'is function'
+ assert.isFunction log2
assert.same log2(''), log2 0
assert.same log2(NaN), NaN
assert.same log2(-1), NaN
diff --git a/tests/library/es6.math.sign.ls b/tests/library/es6.math.sign.ls
index f91337ecf4f4..122751712cc7 100644
--- a/tests/library/es6.math.sign.ls
+++ b/tests/library/es6.math.sign.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns the sign of the x, indicating whether x is positive, negative or zero.
test 'Math.sign' (assert)->
{sign} = core.Math
- assert.ok typeof! sign is \Function, 'is function'
+ assert.isFunction sign
assert.same sign(NaN), NaN
assert.same sign!, NaN
assert.same sign(-0), -0
diff --git a/tests/library/es6.math.sinh.ls b/tests/library/es6.math.sinh.ls
index ece79008d0e1..c63b32db4096 100644
--- a/tests/library/es6.math.sinh.ls
+++ b/tests/library/es6.math.sinh.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the hyperbolic sine of x.
test 'Math.sinh' (assert)->
{sinh} = core.Math
- assert.ok typeof! sinh is \Function, 'is function'
+ assert.isFunction sinh
assert.same sinh(NaN), NaN
assert.same sinh(0), 0
assert.same sinh(-0), -0
diff --git a/tests/library/es6.math.tanh.ls b/tests/library/es6.math.tanh.ls
index 56ab725c40a9..bb535b1263e1 100644
--- a/tests/library/es6.math.tanh.ls
+++ b/tests/library/es6.math.tanh.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns an implementation-dependent approximation to the hyperbolic tangent of x.
test 'Math.tanh' (assert)->
{tanh} = core.Math
- assert.ok typeof! tanh is \Function, 'is function'
+ assert.isFunction tanh
assert.same tanh(NaN), NaN
assert.same tanh(0), 0
assert.same tanh(-0), -0
diff --git a/tests/library/es6.math.trunc.ls b/tests/library/es6.math.trunc.ls
index 1a40b9fd39a3..d9a0c94ac60f 100644
--- a/tests/library/es6.math.trunc.ls
+++ b/tests/library/es6.math.trunc.ls
@@ -3,7 +3,7 @@ module \ES6
# Returns the integral part of the number x, removing any fractional digits. If x is already an integer, the result is x.
test 'Math.trunc' (assert)->
{trunc} = core.Math
- assert.ok typeof! trunc is \Function, 'is function'
+ assert.isFunction trunc
assert.same trunc(NaN), NaN, 'NaN -> NaN'
assert.same trunc(-0), -0, '-0 -> -0'
assert.same trunc(0), 0, '0 -> 0'
diff --git a/tests/library/es6.number.is-finite.ls b/tests/library/es6.number.is-finite.ls
index 01e36434b54b..3dd9c320efd7 100644
--- a/tests/library/es6.number.is-finite.ls
+++ b/tests/library/es6.number.is-finite.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Number.isFinite' (assert)->
{isFinite} = core.Number
{create} = core.Object
- assert.ok typeof! isFinite is \Function, 'is function'
+ assert.isFunction isFinite
for [1 0.1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0]
assert.ok isFinite(..), "isFinite #{typeof ..} #{..}"
for [NaN, Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
diff --git a/tests/library/es6.number.is-integer.ls b/tests/library/es6.number.is-integer.ls
index 5a129053efd1..72ff48ad16b8 100644
--- a/tests/library/es6.number.is-integer.ls
+++ b/tests/library/es6.number.is-integer.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Number.isInteger' (assert)->
{isInteger} = core.Number
{create} = core.Object
- assert.ok typeof! isInteger is \Function, 'is function'
+ assert.isFunction isInteger
for [1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0]
assert.ok isInteger(..), "isInteger #{typeof ..} #{..}"
for [NaN, 0.1, Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
diff --git a/tests/library/es6.number.is-nan.ls b/tests/library/es6.number.is-nan.ls
index 0b0fc979f662..14d77cf50e83 100644
--- a/tests/library/es6.number.is-nan.ls
+++ b/tests/library/es6.number.is-nan.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Number.isNaN' (assert)->
{isNaN} = core.Number
{create} = core.Object
- assert.ok typeof! isNaN is \Function, 'is function'
+ assert.isFunction isNaN
assert.ok isNaN(NaN), 'Number.isNaN NaN'
for [1 0.1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0 Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
assert.ok not isNaN(..), "not Number.isNaN #{typeof ..} #{try String(..) catch e => 'Object.create(null)'}"
\ No newline at end of file
diff --git a/tests/library/es6.number.is-safe-integer.ls b/tests/library/es6.number.is-safe-integer.ls
index 2bef831c05f4..87fc27626547 100644
--- a/tests/library/es6.number.is-safe-integer.ls
+++ b/tests/library/es6.number.is-safe-integer.ls
@@ -4,7 +4,7 @@ module \ES6
test 'Number.isSafeInteger' (assert)->
{isSafeInteger} = core.Number
{create} = core.Object
- assert.ok typeof! isSafeInteger is \Function, 'is function'
+ assert.isFunction isSafeInteger
for [1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0 16~1fffffffffffff -16~1fffffffffffff]
assert.ok isSafeInteger(..), "isSafeInteger #{typeof ..} #{..}"
for [16~20000000000000 -16~20000000000000 NaN, 0.1, Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
diff --git a/tests/library/es6.number.parse-float.ls b/tests/library/es6.number.parse-float.ls
index fad8227211b0..65a3c961fcc7 100644
--- a/tests/library/es6.number.parse-float.ls
+++ b/tests/library/es6.number.parse-float.ls
@@ -2,4 +2,4 @@
module \ES6
test 'Number.parseFloat' (assert)->
- assert.ok typeof! core.Number.parseFloat is \Function, 'is function'
\ No newline at end of file
+ assert.isFunction core.Number.parseFloat
\ No newline at end of file
diff --git a/tests/library/es6.number.parse-int.ls b/tests/library/es6.number.parse-int.ls
index c87b1f8ffa94..72ffdf0c0957 100644
--- a/tests/library/es6.number.parse-int.ls
+++ b/tests/library/es6.number.parse-int.ls
@@ -2,4 +2,4 @@
module \ES6
test 'Number.parseInt' (assert)->
- assert.ok typeof! core.Number.parseInt is \Function, 'is function'
\ No newline at end of file
+ assert.isFunction core.Number.parseInt
\ No newline at end of file
diff --git a/tests/library/es6.object.assign.ls b/tests/library/es6.object.assign.ls
index 1f883d8fb0d9..5641ef1f0e64 100644
--- a/tests/library/es6.object.assign.ls
+++ b/tests/library/es6.object.assign.ls
@@ -5,7 +5,7 @@ descriptors = (-> try 2 == core.Object.defineProperty({}, \a, get: -> 2)a)!
test 'Object.assign' (assert)->
{assign, keys, defineProperty} = core.Object
- assert.ok typeof! assign is \Function, 'is function'
+ assert.isFunction assign
foo = q: 1
assert.strictEqual foo, assign(foo, bar: 2), 'assign return target'
assert.strictEqual foo.bar, 2, 'assign define properties'
diff --git a/tests/library/es6.object.is.ls b/tests/library/es6.object.is.ls
index 8ae5c9212e91..4481fd18a209 100644
--- a/tests/library/es6.object.is.ls
+++ b/tests/library/es6.object.is.ls
@@ -3,7 +3,7 @@ module \ES6
test 'Object.is' (assert)->
same = core.Object.is
- assert.ok typeof! same is \Function, 'is function'
+ assert.isFunction same
assert.ok same(1 1), '1 is 1'
assert.ok same(NaN, NaN), '1 is 1'
assert.ok not same(0 -0), '0 isnt -0'
diff --git a/tests/library/es6.object.set-prototype-of.ls b/tests/library/es6.object.set-prototype-of.ls
index 809d09d1bcff..1738f4ab45d7 100644
--- a/tests/library/es6.object.set-prototype-of.ls
+++ b/tests/library/es6.object.set-prototype-of.ls
@@ -4,7 +4,7 @@ if Object.setPrototypeOf or '__proto__' of Object::
test 'Object.setPrototypeOf' (assert)->
{setPrototypeOf} = core.Object
- assert.ok typeof! setPrototypeOf is \Function, 'is function'
+ assert.isFunction setPrototypeOf
assert.ok \apply of setPrototypeOf({} Function::), 'Parent properties in target'
assert.strictEqual setPrototypeOf(a:2, {b: -> @a^2})b!, 4, 'Child and parent properties in target'
assert.strictEqual setPrototypeOf(tmp = {}, {a: 1}), tmp, 'setPrototypeOf return target'
diff --git a/tests/library/es6.promise.ls b/tests/library/es6.promise.ls
index 6252082e200c..4a1a71a229bb 100644
--- a/tests/library/es6.promise.ls
+++ b/tests/library/es6.promise.ls
@@ -1,23 +1,22 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
{iterator} = core.Symbol
test 'Promise' (assert)->
- assert.ok isFunction(core.Promise), 'is function'
+ assert.isFunction core.Promise
test 'Promise#then' (assert)->
- assert.ok isFunction(core.Promise::then), 'is function'
+ assert.isFunction core.Promise::then
test 'Promise#catch' (assert)->
- assert.ok isFunction(core.Promise::catch), 'is function'
+ assert.isFunction core.Promise::catch
test 'Promise#@@toStringTag' (assert)->
assert.ok core.Promise::[core.Symbol.toStringTag] is \Promise, 'Promise::@@toStringTag is `Promise`'
test 'Promise.all' (assert)->
- assert.ok isFunction(core.Promise.all), 'is function'
+ assert.isFunction core.Promise.all
# works with iterables
passed = no
iter = core.Array.values [1 2 3]
@@ -38,7 +37,7 @@ test 'Promise.all' (assert)->
assert.ok done
test 'Promise.race' (assert)->
- assert.ok isFunction(core.Promise.race), 'is function'
+ assert.isFunction core.Promise.race
# works with iterables
passed = no
iter = core.Array.values [1 2 3]
@@ -59,10 +58,10 @@ test 'Promise.race' (assert)->
assert.ok done
test 'Promise.resolve' (assert)->
- assert.ok isFunction(core.Promise.resolve), 'is function'
+ assert.isFunction core.Promise.resolve
test 'Promise.reject' (assert)->
- assert.ok isFunction(core.Promise.reject), 'is function'
+ assert.isFunction core.Promise.reject
if core.Object.setPrototypeOf
test 'Promise subclassing' (assert)->
diff --git a/tests/library/es6.reflect.apply.ls b/tests/library/es6.reflect.apply.ls
index 27d66a7111b1..f93c5bdfc5d0 100644
--- a/tests/library/es6.reflect.apply.ls
+++ b/tests/library/es6.reflect.apply.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Reflect.apply' (assert)->
{apply} = core.Reflect
- assert.ok typeof! apply is \Function, 'is function'
- assert.strictEqual apply.length, 3, 'arity is 3'
+ assert.isFunction apply
+ assert.arity apply, 3
if \name of apply
- assert.strictEqual apply.name, \apply, 'name is "apply"'
+ assert.name apply, \apply
assert.strictEqual apply(Array::push, [1 2], [3 4 5]), 5
C = (a, b, c)-> a + b + c
C.apply = 42
diff --git a/tests/library/es6.reflect.construct.ls b/tests/library/es6.reflect.construct.ls
index 4f7718b528eb..3945efb4f03b 100644
--- a/tests/library/es6.reflect.construct.ls
+++ b/tests/library/es6.reflect.construct.ls
@@ -5,10 +5,10 @@ module \ES6
test 'Reflect.construct' (assert)->
{construct} = core.Reflect
- assert.ok typeof! construct is \Function, 'is function'
- assert.strictEqual construct.length, 2, 'arity is 2'
+ assert.isFunction construct
+ assert.arity construct, 2
if \name of construct
- assert.strictEqual construct.name, \construct, 'name is "construct"'
+ assert.name construct, \construct
C = (a, b, c)-> @qux = a + b + c
assert.strictEqual construct(C, <[foo bar baz]>).qux, \foobarbaz, \basic
C.apply = 42
diff --git a/tests/library/es6.reflect.define-property.ls b/tests/library/es6.reflect.define-property.ls
index 3320390fd420..684e8e7bb979 100644
--- a/tests/library/es6.reflect.define-property.ls
+++ b/tests/library/es6.reflect.define-property.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.defineProperty' (assert)->
{defineProperty} = core.Reflect
- assert.ok typeof! defineProperty is \Function, 'is function'
- assert.strictEqual defineProperty.length, 3, 'arity is 3'
+ assert.isFunction defineProperty
+ assert.arity defineProperty, 3
if \name of defineProperty
- assert.strictEqual defineProperty.name, \defineProperty, 'name is "defineProperty"'
+ assert.name defineProperty, \defineProperty
O = {}
assert.strictEqual defineProperty(O, \foo, {value: 123}), on
assert.strictEqual O.foo, 123
diff --git a/tests/library/es6.reflect.delete-property.ls b/tests/library/es6.reflect.delete-property.ls
index f49a59d7dcae..206aa3dffe62 100644
--- a/tests/library/es6.reflect.delete-property.ls
+++ b/tests/library/es6.reflect.delete-property.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.deleteProperty' (assert)->
{deleteProperty} = core.Reflect
- assert.ok typeof! deleteProperty is \Function, 'is function'
- assert.strictEqual deleteProperty.length, 2, 'arity is 2'
+ assert.isFunction deleteProperty
+ assert.arity deleteProperty, 2
if \name of deleteProperty
- assert.strictEqual deleteProperty.name, \deleteProperty, 'name is "deleteProperty"'
+ assert.name deleteProperty, \deleteProperty
O = {bar: 456}
assert.strictEqual deleteProperty(O, \bar), on
assert.ok \bar not in O
diff --git a/tests/library/es6.reflect.enumerate.ls b/tests/library/es6.reflect.enumerate.ls
index 23f95eb9b1f0..7351243bacbb 100644
--- a/tests/library/es6.reflect.enumerate.ls
+++ b/tests/library/es6.reflect.enumerate.ls
@@ -8,10 +8,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.enumerate' (assert)->
{enumerate} = core.Reflect
{iterator} = core.Symbol
- assert.ok typeof! enumerate is \Function, 'is function'
- assert.strictEqual enumerate.length, 1, 'arity is 1'
+ assert.isFunction enumerate
+ assert.arity enumerate, 1
if \name of enumerate
- assert.strictEqual enumerate.name, \enumerate, 'name is "enumerate"'
+ assert.name enumerate, \enumerate
obj = {foo: 1, bar: 2}
i = enumerate obj
assert.ok iterator of i, 'returns iterator'
diff --git a/tests/library/es6.reflect.get-own-property-descriptor.ls b/tests/library/es6.reflect.get-own-property-descriptor.ls
index 96d9beea03ef..4400531dbf6e 100644
--- a/tests/library/es6.reflect.get-own-property-descriptor.ls
+++ b/tests/library/es6.reflect.get-own-property-descriptor.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Reflect.getOwnPropertyDescriptor' (assert)->
{getOwnPropertyDescriptor} = core.Reflect
- assert.ok typeof! getOwnPropertyDescriptor is \Function, 'is function'
- assert.strictEqual getOwnPropertyDescriptor.length, 2, 'arity is 2'
+ assert.isFunction getOwnPropertyDescriptor
+ assert.arity getOwnPropertyDescriptor, 2
if \name of getOwnPropertyDescriptor
- assert.strictEqual getOwnPropertyDescriptor.name, \getOwnPropertyDescriptor, 'name is "getOwnPropertyDescriptor"'
+ assert.name getOwnPropertyDescriptor, \getOwnPropertyDescriptor
obj = {baz: 789}
desc = getOwnPropertyDescriptor obj, \baz
assert.strictEqual desc.value, 789
diff --git a/tests/library/es6.reflect.get-prototype-of.ls b/tests/library/es6.reflect.get-prototype-of.ls
index baf37de1dbb2..b8982cc01b61 100644
--- a/tests/library/es6.reflect.get-prototype-of.ls
+++ b/tests/library/es6.reflect.get-prototype-of.ls
@@ -3,9 +3,9 @@ module \ES6
test 'Reflect.getPrototypeOf' (assert)->
{getPrototypeOf} = core.Reflect
- assert.ok typeof! getPrototypeOf is \Function, 'is function'
- assert.strictEqual getPrototypeOf.length, 1, 'arity is 1'
+ assert.isFunction getPrototypeOf
+ assert.arity getPrototypeOf, 1
if \name of getPrototypeOf
- assert.strictEqual getPrototypeOf.name, \getPrototypeOf, 'name is "getPrototypeOf"'
+ assert.name getPrototypeOf, \getPrototypeOf
assert.strictEqual getPrototypeOf([]), Array::
assert.throws (-> getPrototypeOf 42), TypeError, 'throws on primitive'
\ No newline at end of file
diff --git a/tests/library/es6.reflect.get.ls b/tests/library/es6.reflect.get.ls
index 5367e328fa45..e3b61480c1bb 100644
--- a/tests/library/es6.reflect.get.ls
+++ b/tests/library/es6.reflect.get.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.get' (assert)->
{get} = core.Reflect
- assert.ok typeof! get is \Function, 'is function'
- #eq get.length, 2, 'arity is 2' # fails in MS Edge
+ assert.isFunction get
+ #assert.arity get, 2 # fails in MS Edge
if \name of get
- assert.strictEqual get.name, \get, 'name is "get"'
+ assert.name get, \get
assert.strictEqual get({qux: 987}, \qux), 987
if MODERN
diff --git a/tests/library/es6.reflect.has.ls b/tests/library/es6.reflect.has.ls
index 3a0d060aa4ef..9d241866cb34 100644
--- a/tests/library/es6.reflect.has.ls
+++ b/tests/library/es6.reflect.has.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Reflect.has' (assert)->
{has} = core.Reflect
- assert.ok typeof! has is \Function, 'is function'
- assert.strictEqual has.length, 2, 'arity is 2'
+ assert.isFunction has
+ assert.arity has, 2
if \name of has
- assert.strictEqual has.name, \has, 'name is "has"'
+ assert.name has, \has
O = qux: 987
assert.strictEqual has(O, \qux), on
assert.strictEqual has(O, \qwe), no
diff --git a/tests/library/es6.reflect.is-extensible.ls b/tests/library/es6.reflect.is-extensible.ls
index bbed79a893f5..cad9f5bc1624 100644
--- a/tests/library/es6.reflect.is-extensible.ls
+++ b/tests/library/es6.reflect.is-extensible.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.isExtensible' (assert)->
{isExtensible} = core.Reflect
- assert.ok typeof! isExtensible is \Function, 'is function'
- assert.strictEqual isExtensible.length, 1, 'arity is 1'
+ assert.isFunction isExtensible
+ assert.arity isExtensible, 1
if \name of isExtensible
- assert.strictEqual isExtensible.name, \isExtensible, 'name is "isExtensible"'
+ assert.name isExtensible, \isExtensible
assert.ok isExtensible {}
if MODERN
assert.ok !isExtensible preventExtensions {}
diff --git a/tests/library/es6.reflect.own-keys.ls b/tests/library/es6.reflect.own-keys.ls
index 8cc2a25fb07c..3351927e256b 100644
--- a/tests/library/es6.reflect.own-keys.ls
+++ b/tests/library/es6.reflect.own-keys.ls
@@ -6,10 +6,10 @@ module \ES6
test 'Reflect.ownKeys' (assert)->
{ownKeys} = core.Reflect
sym = core.Symbol \c
- assert.ok typeof! ownKeys is \Function, 'is function'
- assert.strictEqual ownKeys.length, 1, 'arity is 1'
+ assert.isFunction ownKeys
+ assert.arity ownKeys, 1
if \name of ownKeys
- assert.strictEqual ownKeys.name, \ownKeys, 'name is "ownKeys"'
+ assert.name ownKeys, \ownKeys
O1 = {a: 1}
defineProperty O1, \b, value: 2
O1[sym] = 3
diff --git a/tests/library/es6.reflect.prevent-extensions.ls b/tests/library/es6.reflect.prevent-extensions.ls
index 6f431f4ae862..5f7c207235a4 100644
--- a/tests/library/es6.reflect.prevent-extensions.ls
+++ b/tests/library/es6.reflect.prevent-extensions.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.preventExtensions' (assert)->
{preventExtensions} = core.Reflect
- assert.ok typeof! preventExtensions is \Function, 'is function'
- assert.strictEqual preventExtensions.length, 1, 'arity is 1'
+ assert.isFunction preventExtensions
+ assert.arity preventExtensions, 1
if \name of preventExtensions
- assert.strictEqual preventExtensions.name, \preventExtensions, 'name is "preventExtensions"'
+ assert.name preventExtensions, \preventExtensions
obj = {}
assert.ok preventExtensions(obj), on
if MODERN
diff --git a/tests/library/es6.reflect.set-prototype-of.ls b/tests/library/es6.reflect.set-prototype-of.ls
index e89a0ee1a0c3..7639cce707c5 100644
--- a/tests/library/es6.reflect.set-prototype-of.ls
+++ b/tests/library/es6.reflect.set-prototype-of.ls
@@ -4,10 +4,10 @@ if Object.setPrototypeOf || '__proto__' of {}
test 'Reflect.setPrototypeOf' (assert)->
{setPrototypeOf} = core.Reflect
- assert.ok typeof! setPrototypeOf is \Function, 'is function'
- #eq setPrototypeOf.length, 2, 'arity is 2' # fails in MS Edge
+ assert.isFunction setPrototypeOf
+ #assert.arity setPrototypeOf, 2 # fails in MS Edge
if \name of setPrototypeOf
- assert.strictEqual setPrototypeOf.name, \setPrototypeOf, 'name is "setPrototypeOf"'
+ assert.name setPrototypeOf, \setPrototypeOf
obj = {}
assert.ok setPrototypeOf(obj, Array::), on
assert.ok obj instanceof Array
diff --git a/tests/library/es6.reflect.set.ls b/tests/library/es6.reflect.set.ls
index 65307bc982d5..8e8416ea38f4 100644
--- a/tests/library/es6.reflect.set.ls
+++ b/tests/library/es6.reflect.set.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.set' (assert)->
{set} = core.Reflect
- assert.ok typeof! set is \Function, 'is function'
- #eq set.length, 3, 'arity is 3' # fails in MS Edge
+ assert.isFunction set
+ #assert.arity set, 3 # fails in MS Edge
if \name of set
- assert.strictEqual set.name, \set, 'name is "set"'
+ assert.name set, \set
obj = {}
assert.ok set(obj, \quux, 654), on
assert.strictEqual obj.quux, 654
diff --git a/tests/library/es6.set.ls b/tests/library/es6.set.ls
index 746da2b6dec3..2cfe83072208 100644
--- a/tests/library/es6.set.ls
+++ b/tests/library/es6.set.ls
@@ -1,8 +1,7 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
same = (a, b)-> if a is b => a isnt 0 or 1 / a is 1 / b else a !~= a and b !~= b
{Set, Symbol} = core
{getOwnPropertyDescriptor, freeze} = core.Object
@@ -10,7 +9,7 @@ same = (a, b)-> if a is b => a isnt 0 or 1 / a is 1 / b else a !~= a and b !~= b
{iterator} = core.Symbol
test 'Set' (assert)->
- assert.ok isFunction(Set), 'is function'
+ assert.isFunction Set
assert.ok \add of Set::, 'add in Set.prototype'
assert.ok \clear of Set::, 'clear in Set.prototype'
assert.ok \delete of Set::, 'delete in Set.prototype'
@@ -47,7 +46,7 @@ test 'Set' (assert)->
assert.ok done
test 'Set#add' (assert)->
- assert.ok isFunction(Set::add), 'is function'
+ assert.isFunction Set::add
a = []
S = new Set [NaN, 2 3 2 1 a]
assert.strictEqual S.size, 5
@@ -66,7 +65,7 @@ test 'Set#add' (assert)->
assert.ok S.has f
test 'Set#clear' (assert)->
- assert.ok isFunction(Set::clear), 'is function'
+ assert.isFunction Set::clear
S = new Set
S.clear!
assert.strictEqual S.size, 0
@@ -83,7 +82,7 @@ test 'Set#clear' (assert)->
assert.ok !S.has f
test 'Set#delete' (assert)->
- assert.ok isFunction(Set::delete), 'is function'
+ assert.isFunction Set::delete
a = []
S = new Set [NaN, 2 3 2 1 a]
assert.strictEqual S.size, 5
@@ -101,7 +100,7 @@ test 'Set#delete' (assert)->
assert.strictEqual S.size, 3
test 'Set#forEach' (assert)->
- assert.ok isFunction(Set::forEach), 'is function'
+ assert.isFunction Set::forEach
r = []
count = 0
S = new Set [1 2 3 2 1]
@@ -129,7 +128,7 @@ test 'Set#forEach' (assert)->
assert.strictEqual s, \0
test 'Set#has' (assert)->
- assert.ok isFunction(Set::has), 'is function'
+ assert.isFunction Set::has
a = []
f = freeze {}
S = new Set [NaN, 2 3 2 1 f, a]
@@ -184,7 +183,7 @@ test 'Set Iterator' (assert)->
assert.deepEqual keys, <[a d e]>
test 'Set#keys' (assert)->
- assert.ok typeof Set::keys is \function, 'is function'
+ assert.isFunction Set::keys
iter = new Set(<[q w e]>)keys!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Set Iterator'
@@ -194,7 +193,7 @@ test 'Set#keys' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Set#values' (assert)->
- assert.ok typeof Set::values is \function, 'is function'
+ assert.isFunction Set::values
iter = new Set(<[q w e]>)values!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Set Iterator'
@@ -204,7 +203,7 @@ test 'Set#values' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Set#entries' (assert)->
- assert.ok typeof Set::entries is \function, 'is function'
+ assert.isFunction Set::entries
iter = new Set(<[q w e]>)entries!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Set Iterator'
diff --git a/tests/library/es6.string.code-point-at.ls b/tests/library/es6.string.code-point-at.ls
index 4c47b666fa40..499a80d7f24b 100644
--- a/tests/library/es6.string.code-point-at.ls
+++ b/tests/library/es6.string.code-point-at.ls
@@ -4,7 +4,7 @@ module \ES6
test 'String#codePointAt' (assert)->
{codePointAt} = core.String
- assert.ok typeof! codePointAt is \Function, 'is function'
+ assert.isFunction codePointAt
# tests from https://github.com/mathiasbynens/String.prototype.codePointAt/blob/master/tests/tests.js
assert.strictEqual codePointAt('abc\uD834\uDF06def', ''), 0x61
assert.strictEqual codePointAt('abc\uD834\uDF06def', \_), 0x61
diff --git a/tests/library/es6.string.ends-with.ls b/tests/library/es6.string.ends-with.ls
index f45ad50b8509..cc26cf7a0799 100644
--- a/tests/library/es6.string.ends-with.ls
+++ b/tests/library/es6.string.ends-with.ls
@@ -4,7 +4,7 @@ module \ES6
test 'String#endsWith' (assert)->
{endsWith} = core.String
- assert.ok typeof! endsWith is \Function, 'is function'
+ assert.isFunction endsWith
assert.ok endsWith 'undefined'
assert.ok not endsWith 'undefined' null
assert.ok endsWith 'abc' ''
diff --git a/tests/library/es6.string.from-code-point.ls b/tests/library/es6.string.from-code-point.ls
index 7f79a31e6364..52cb3cd43ab0 100644
--- a/tests/library/es6.string.from-code-point.ls
+++ b/tests/library/es6.string.from-code-point.ls
@@ -3,10 +3,10 @@ module \ES6
test 'String.fromCodePoint' (assert)->
{fromCodePoint} = core.String
- assert.ok typeof! fromCodePoint is \Function, 'is function'
- assert.strictEqual fromCodePoint.length, 1, 'arity is 1'
+ assert.isFunction fromCodePoint
+ assert.arity fromCodePoint, 1
if \name of fromCodePoint
- assert.strictEqual fromCodePoint.name, \fromCodePoint, 'name is "fromCodePoint"'
+ assert.name fromCodePoint, \fromCodePoint
# tests from https://github.com/mathiasbynens/String.fromCodePoint/blob/master/tests/tests.js
assert.strictEqual fromCodePoint(''), '\0'
assert.strictEqual fromCodePoint!, ''
diff --git a/tests/library/es6.string.includes.ls b/tests/library/es6.string.includes.ls
index 70599ce16779..c0463e3a2397 100644
--- a/tests/library/es6.string.includes.ls
+++ b/tests/library/es6.string.includes.ls
@@ -4,7 +4,7 @@ module \ES6
test 'String#includes' (assert)->
{includes} = core.String
- assert.ok typeof! includes is \Function, 'is function'
+ assert.isFunction includes
assert.ok not includes 'abc'
assert.ok includes 'aundefinedb'
assert.ok includes 'abcd' \b 1
diff --git a/tests/library/es6.string.raw.ls b/tests/library/es6.string.raw.ls
index c2ac14ae5004..5bde899b8fb2 100644
--- a/tests/library/es6.string.raw.ls
+++ b/tests/library/es6.string.raw.ls
@@ -3,10 +3,10 @@ module \ES6
test 'String.raw' (assert)->
{raw} = core.String
- assert.ok typeof! raw is \Function, 'is function'
- assert.strictEqual raw.length, 1, 'arity is 1'
+ assert.isFunction raw
+ assert.arity raw, 1
if \name of raw
- assert.strictEqual raw.name, \raw, 'name is "raw"'
+ assert.name raw, \raw
assert.strictEqual raw({raw: ['Hi\\n', '!']} , \Bob), 'Hi\\nBob!', 'raw is array'
assert.strictEqual raw({raw: \test}, 0, 1, 2), 't0e1s2t', 'raw is string'
assert.strictEqual raw({raw: \test}, 0), 't0est', 'lacks substituting'
diff --git a/tests/library/es6.string.repeat.ls b/tests/library/es6.string.repeat.ls
index 70cd5b0210ca..058ed5ce6954 100644
--- a/tests/library/es6.string.repeat.ls
+++ b/tests/library/es6.string.repeat.ls
@@ -4,7 +4,7 @@ module \ES6
test 'String#repeat' (assert)->
{repeat} = core.String
- assert.ok typeof! repeat is \Function, 'is function'
+ assert.isFunction repeat
assert.strictEqual repeat('qwe' 3), \qweqweqwe
assert.strictEqual repeat('qwe' 2.5), \qweqwe
assert.throws (-> repeat 'qwe' -1), RangeError
diff --git a/tests/library/es6.string.starts-with.ls b/tests/library/es6.string.starts-with.ls
index f74f8dcd7831..c84ff610573f 100644
--- a/tests/library/es6.string.starts-with.ls
+++ b/tests/library/es6.string.starts-with.ls
@@ -4,7 +4,7 @@ module \ES6
test 'String#startsWith' (assert)->
{startsWith} = core.String
- assert.ok typeof! startsWith is \Function, 'is function'
+ assert.isFunction startsWith
assert.ok startsWith 'undefined'
assert.ok not startsWith 'undefined' null
assert.ok startsWith 'abc' ''
diff --git a/tests/library/es6.string.trim.ls b/tests/library/es6.string.trim.ls
index 38e641ed6c0c..7f99e56d1cca 100644
--- a/tests/library/es6.string.trim.ls
+++ b/tests/library/es6.string.trim.ls
@@ -4,7 +4,7 @@ module \ES6
test 'String#trim' (assert)->
{trim} = core.String
- assert.ok typeof! trim is \Function, 'is function'
+ assert.isFunction trim
assert.strictEqual trim(' \n q w e \n '), 'q w e', 'removes whitespaces at left & right side of string'
assert.strictEqual trim('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'), '', 'removes all whitespaces'
assert.strictEqual trim('\u200b\u0085'), '\u200b\u0085', "shouldn't remove this symbols"
diff --git a/tests/library/es6.symbol.ls b/tests/library/es6.symbol.ls
index 4ca03e594295..86586d5f1574 100644
--- a/tests/library/es6.symbol.ls
+++ b/tests/library/es6.symbol.ls
@@ -3,13 +3,11 @@ module \ES6
{Symbol, JSON} = core
{defineProperty, getOwnPropertyDescriptor, create} = core.Object
-isFunction = -> typeof! it is \Function
-isNative = -> /\[native code\]\s*\}\s*$/.test it
descriptors = (-> try 2 == core.Object.defineProperty({}, \a, get: -> 2)a)!
G = global? && global || window
test 'Symbol' (assert)->
- assert.ok isFunction(Symbol), 'is function'
+ assert.isFunction Symbol
s1 = Symbol 'foo'
s2 = Symbol 'foo'
assert.ok s1 isnt s2, 'Symbol("foo") !== Symbol("foo")'
@@ -28,8 +26,8 @@ test 'Well-known Symbols' (assert)->
assert.ok Object(Symbol[..]) instanceof Symbol, "Symbol.#{..} is symbol"
test 'Global symbol registry' (assert)->
- assert.ok isFunction(Symbol.for), 'Symbol.for is function'
- assert.ok isFunction(Symbol.keyFor), 'Symbol.keyFor is function'
+ assert.isFunction Symbol.for, 'Symbol.for is function'
+ assert.isFunction Symbol.keyFor, 'Symbol.keyFor is function'
symbol = Symbol.for \foo
assert.strictEqual Symbol.for(\foo), symbol
assert.strictEqual Symbol.keyFor(symbol), \foo
@@ -39,7 +37,7 @@ test 'Symbol#@@toStringTag' (assert)->
test 'Object.getOwnPropertySymbols' (assert)->
{getOwnPropertySymbols, getOwnPropertyNames} = core.Object
- assert.ok isFunction(getOwnPropertySymbols), 'is function'
+ assert.isFunction getOwnPropertySymbols
obj = {q: 1, w: 2, e: 3}
obj[Symbol()] = 42
obj[Symbol()] = 43
diff --git a/tests/library/es6.weak-map.ls b/tests/library/es6.weak-map.ls
index d926eb9e297d..ba305108c6ed 100644
--- a/tests/library/es6.weak-map.ls
+++ b/tests/library/es6.weak-map.ls
@@ -1,14 +1,13 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
{WeakMap, Map} = core
{freeze} = core.Object
{values} = core.Array
{iterator} = core.Symbol
test 'WeakMap' (assert)->
- assert.ok isFunction(WeakMap), 'is function'
+ assert.isFunction WeakMap
assert.ok \delete of WeakMap::, 'delete in WeakMap.prototype'
assert.ok \get of WeakMap::, 'get in WeakMap.prototype'
assert.ok \has of WeakMap::, 'has in WeakMap.prototype'
@@ -42,14 +41,14 @@ test 'WeakMap' (assert)->
assert.ok done
test 'WeakMap#delete' (assert)->
- assert.ok isFunction(WeakMap::delete), 'is function'
+ assert.isFunction WeakMap::delete
M = new WeakMap [[a = {}, 42], [b = {}, 21]]
assert.ok M.has(a) && M.has(b), 'WeakMap has values before .delete()'
M.delete a
assert.ok !M.has(a) && M.has(b), 'WeakMap hasn`t value after .delete()'
test 'WeakMap#get' (assert)->
- assert.ok isFunction(WeakMap::get), 'is function'
+ assert.isFunction WeakMap::get
M = new WeakMap!
assert.strictEqual M.get({}), void, 'WeakMap .get() before .set() return undefined'
M.set a = {}, 42
@@ -58,7 +57,7 @@ test 'WeakMap#get' (assert)->
assert.strictEqual M.get(a), void, 'WeakMap .get() after .delete() return undefined'
test 'WeakMap#has' (assert)->
- assert.ok isFunction(WeakMap::has), 'is function'
+ assert.isFunction WeakMap::has
M = new WeakMap!
assert.ok !M.has({}), 'WeakMap .has() before .set() return false'
M.set a = {}, 42
@@ -67,7 +66,7 @@ test 'WeakMap#has' (assert)->
assert.ok !M.has(a), 'WeakMap .has() after .delete() return false'
test 'WeakMap#set' (assert)->
- assert.ok isFunction(WeakMap::set), 'is function'
+ assert.isFunction WeakMap::set
assert.ok (w = new WeakMap)set(a = {}, 42) is w, 'chaining'
assert.ok (try new WeakMap!set(42, 42); no; catch => on), 'throws with primitive keys'
diff --git a/tests/library/es6.weak-set.ls b/tests/library/es6.weak-set.ls
index 7bd7c5e40f27..5e58007088e4 100644
--- a/tests/library/es6.weak-set.ls
+++ b/tests/library/es6.weak-set.ls
@@ -1,14 +1,13 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
{WeakSet} = core
{freeze} = core.Object
{values} = core.Array
{iterator} = core.Symbol
test 'WeakSet' (assert)->
- assert.ok isFunction(WeakSet), 'is function'
+ assert.isFunction WeakSet
assert.ok \add of WeakSet::, 'add in WeakSet.prototype'
assert.ok \delete of WeakSet::, 'delete in WeakSet.prototype'
assert.ok \has of WeakSet::, 'has in WeakSet.prototype'
@@ -39,12 +38,12 @@ test 'WeakSet' (assert)->
assert.ok done
test 'WeakSet#add' (assert)->
- assert.ok isFunction(WeakSet::add), 'is function'
+ assert.isFunction WeakSet::add
assert.ok (w = new WeakSet)add({}) is w, 'chaining'
assert.ok (try new WeakSet!add(42); no; catch => on), 'throws with primitive keys'
test 'WeakSet#delete' (assert)->
- assert.ok isFunction(WeakSet::delete), 'is function'
+ assert.isFunction WeakSet::delete
S = new WeakSet!
.add a = {}
.add b = {}
@@ -53,7 +52,7 @@ test 'WeakSet#delete' (assert)->
assert.ok !S.has(a) && S.has(b), 'WeakSet has`nt value after .delete()'
test 'WeakSet#has' (assert)->
- assert.ok isFunction(WeakSet::has), 'is function'
+ assert.isFunction WeakSet::has
M = new WeakSet!
assert.ok not M.has({}), 'WeakSet has`nt value'
M.add a = {}
diff --git a/tests/library/es7.array.includes.ls b/tests/library/es7.array.includes.ls
index d6ea3c5f63c2..1102003295d2 100644
--- a/tests/library/es7.array.includes.ls
+++ b/tests/library/es7.array.includes.ls
@@ -4,7 +4,7 @@ module \ES7
test 'Array#includes' (assert)->
{includes} = core.Array
- assert.ok typeof! includes is \Function, 'is function'
+ assert.isFunction includes
arr = [1 2 3 -0 o = {}]
assert.ok includes arr, 1
assert.ok includes arr, -0
diff --git a/tests/library/es7.object.entries.ls b/tests/library/es7.object.entries.ls
index f95abe0ce2f0..7d0474066a74 100644
--- a/tests/library/es7.object.entries.ls
+++ b/tests/library/es7.object.entries.ls
@@ -3,9 +3,9 @@ module \ES7
test 'Object.entries' (assert)->
{entries, create, assign} = core.Object
- assert.ok typeof! entries is \Function, 'is function'
- assert.strictEqual entries.length, 1, 'arity is 1'
- if \name of entries => assert.strictEqual entries.name, \entries, 'name is "entries"'
+ assert.isFunction entries
+ assert.arity entries, 1
+ if \name of entries => assert.name entries, \entries
assert.deepEqual entries({q:1, w:2, e:3}), [[\q 1] [\w 2] [\e 3]]
assert.deepEqual entries(new String \qwe), [[\0 \q] [\1 \w] [\2 \e]]
assert.deepEqual entries(assign create({q:1, w:2, e:3}), {a:4, s:5, d:6}), [[\a 4] [\s 5] [\d 6]]
diff --git a/tests/library/es7.object.get-own-property-descriptors.ls b/tests/library/es7.object.get-own-property-descriptors.ls
index 20a077e9a39d..b7c8e7799841 100644
--- a/tests/library/es7.object.get-own-property-descriptors.ls
+++ b/tests/library/es7.object.get-own-property-descriptors.ls
@@ -6,7 +6,7 @@ descriptors = (-> try 2 == core.Object.defineProperty({}, \a, get: -> 2)a)!
test 'Object.getOwnPropertyDescriptors' (assert)->
{getOwnPropertyDescriptors} = core.Object
- assert.ok typeof! getOwnPropertyDescriptors is \Function, 'is function'
+ assert.isFunction getOwnPropertyDescriptors
O = create {q: 1}, e: value: 3
O.w = 2
s = core.Symbol \s
diff --git a/tests/library/es7.object.values.ls b/tests/library/es7.object.values.ls
index b5d39454df25..5f8009df6cc1 100644
--- a/tests/library/es7.object.values.ls
+++ b/tests/library/es7.object.values.ls
@@ -3,9 +3,9 @@ module \ES7
test 'Object.values' (assert)->
{values, create, assign} = core.Object
- assert.ok typeof! values is \Function, 'is function'
- assert.strictEqual values.length, 1, 'arity is 1'
- if \name of values => assert.strictEqual values.name, \values, 'name is "values"'
+ assert.isFunction values
+ assert.arity values, 1
+ if \name of values => assert.name values, \values
assert.deepEqual values({q:1, w:2, e:3}), [1 2 3]
assert.deepEqual values(new String \qwe), [\q \w \e]
assert.deepEqual values(assign create({q:1, w:2, e:3}), {a:4, s:5, d:6}), [4 5 6]
diff --git a/tests/library/es7.regexp.escape.ls b/tests/library/es7.regexp.escape.ls
index f2eac40df876..cba42b13946d 100644
--- a/tests/library/es7.regexp.escape.ls
+++ b/tests/library/es7.regexp.escape.ls
@@ -3,6 +3,6 @@ module \ES7
test 'RegExp.escape' (assert)->
{escape} = core.RegExp
- assert.ok typeof! escape is \Function, 'is function'
+ assert.isFunction escape
assert.strictEqual escape('qwe asd'), 'qwe asd', "Don't change simple string"
assert.strictEqual escape('\\[]{}()*+?.^$|'), '\\\\\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\^\\$\\|', 'Escape all RegExp special chars'
\ No newline at end of file
diff --git a/tests/library/es7.string.at.ls b/tests/library/es7.string.at.ls
index 511de5b6a8cd..a08d2b3214e9 100644
--- a/tests/library/es7.string.at.ls
+++ b/tests/library/es7.string.at.ls
@@ -4,7 +4,7 @@ module \ES7
test 'String#at' (assert)->
{at} = core.String
- assert.ok typeof! at is \Function, 'is function'
+ assert.isFunction at
# Tests from https://github.com/mathiasbynens/String.prototype.at/blob/master/tests/tests.js
# String that starts with a BMP symbol
assert.strictEqual at('abc\uD834\uDF06def', -Infinity), ''
diff --git a/tests/library/es7.string.pad-left.ls b/tests/library/es7.string.pad-left.ls
index bdabc1a00044..03369775f97a 100644
--- a/tests/library/es7.string.pad-left.ls
+++ b/tests/library/es7.string.pad-left.ls
@@ -4,7 +4,7 @@ module \ES7
test 'String#padLeft' (assert)->
{padLeft} = core.String
- assert.ok typeof! padLeft is \Function, 'is function'
+ assert.isFunction padLeft
assert.strictEqual padLeft(\abc 5), ' abc'
assert.strictEqual padLeft(\abc 4 \de), \dabc
assert.strictEqual padLeft(\abc), \abc
diff --git a/tests/library/es7.string.pad-right.ls b/tests/library/es7.string.pad-right.ls
index 53bcc84e1f79..561cb24619b3 100644
--- a/tests/library/es7.string.pad-right.ls
+++ b/tests/library/es7.string.pad-right.ls
@@ -4,7 +4,7 @@ module \ES7
test 'String#padRight' (assert)->
{padRight} = core.String
- assert.ok typeof! padRight is \Function, 'is function'
+ assert.isFunction padRight
assert.strictEqual padRight(\abc 5), 'abc '
assert.strictEqual padRight(\abc 4 \de), 'abcd'
assert.strictEqual padRight(\abc), \abc
diff --git a/tests/library/es7.string.trim-left.ls b/tests/library/es7.string.trim-left.ls
index f990dc23f96d..a645a94b166d 100644
--- a/tests/library/es7.string.trim-left.ls
+++ b/tests/library/es7.string.trim-left.ls
@@ -4,7 +4,7 @@ module \ES7
test 'String#trimLeft' (assert)->
{trimLeft} = core.String
- assert.ok typeof! trimLeft is \Function, 'is function'
+ assert.isFunction trimLeft
assert.strictEqual trimLeft(' \n q w e \n '), 'q w e \n ', 'removes whitespaces at left side of string'
assert.strictEqual trimLeft('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'), '', 'removes all whitespaces'
assert.strictEqual trimLeft('\u200b\u0085'), '\u200b\u0085', "shouldn't remove this symbols"
diff --git a/tests/library/es7.string.trim-right.ls b/tests/library/es7.string.trim-right.ls
index d2d32e67fffd..32cbe813c52b 100644
--- a/tests/library/es7.string.trim-right.ls
+++ b/tests/library/es7.string.trim-right.ls
@@ -4,7 +4,7 @@ module \ES7
test 'String#trimRight' (assert)->
{trimRight} = core.String
- assert.ok typeof! trimRight is \Function, 'is function'
+ assert.isFunction trimRight
assert.strictEqual trimRight(' \n q w e \n '), ' \n q w e', 'removes whitespaces at right side of string'
assert.strictEqual trimRight('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'), '', 'removes all whitespaces'
assert.strictEqual trimRight('\u200b\u0085'), '\u200b\u0085', "shouldn't remove this symbols"
diff --git a/tests/library/js.array.statics.ls b/tests/library/js.array.statics.ls
index de49f0be19d9..f6127e33fa82 100644
--- a/tests/library/js.array.statics.ls
+++ b/tests/library/js.array.statics.ls
@@ -1,12 +1,11 @@
{module, test} = QUnit
module 'Mozilla JavaScript Array statics'
-isFunction = -> typeof! it is \Function
{slice} = Array::
test 'are functions' (assert)->
for <[concat join pop push reverse shift slice sort splice unshift indexOf lastIndexOf every some forEach map filter reduce reduceRight copyWithin fill find findIndex keys values entries includes]>
- assert.ok isFunction(core.Array[..]), "Array.#{..} is function"
+ assert.isFunction core.Array[..], "Array.#{..} is function"
test '.join' (assert)->
{join} = core.Array
@@ -222,7 +221,6 @@ test '.findIndex' (assert)->
test '.keys' (assert)->
{keys} = core.Array
- assert.ok typeof keys is \function, 'is function'
iter1 = keys (->&)(\q \w \e)
assert.ok typeof iter1 is \object, 'Iterator is object'
assert.ok typeof iter1.next is \function, 'Iterator has .next method'
@@ -238,7 +236,6 @@ test '.keys' (assert)->
test '.values' (assert)->
{values} = core.Array
- assert.ok typeof values is \function, 'is function'
iter1 = values (->&)(\q \w \e)
assert.ok typeof iter1 is \object, 'Iterator is object'
assert.ok typeof iter1.next is \function, 'Iterator has .next method'
@@ -254,7 +251,6 @@ test '.values' (assert)->
test '.entries' (assert)->
{entries} = core.Array
- assert.ok typeof entries is \function, 'is function'
iter1 = entries (->&)(\q \w \e)
assert.ok typeof iter1 is \object, 'Iterator is object'
assert.ok typeof iter1.next is \function, 'Iterator has .next method'
@@ -270,7 +266,6 @@ test '.entries' (assert)->
test '.includes' (assert)->
{includes} = core.Array
- assert.ok isFunction(includes), 'is function'
args = (->&)(1 2 3 -0 NaN, o = {})
assert.ok includes args, 1
assert.ok includes args, -0
diff --git a/tests/library/web.dom.itarable.ls b/tests/library/web.dom.itarable.ls
index a95090543d81..020211ca1aed 100644
--- a/tests/library/web.dom.itarable.ls
+++ b/tests/library/web.dom.itarable.ls
@@ -1,8 +1,6 @@
{module, test} = QUnit
module 'DOM iterable'
-isFunction = -> typeof! it is \Function
-
if NodeList? and document?querySelectorAll and typeof! document.querySelectorAll(\div) is \NodeList
test 'NodeList.prototype@@iterator' (assert)->
assert.ok core.isIterable(document.querySelectorAll(\div)), 'Is iterable'
diff --git a/tests/library/web.immediate.ls b/tests/library/web.immediate.ls
index 46914fc5bc81..57563ce03a83 100644
--- a/tests/library/web.immediate.ls
+++ b/tests/library/web.immediate.ls
@@ -1,14 +1,13 @@
{module, test} = QUnit
module 'Immediate'
-isFunction = -> typeof! it is \Function
timeLimitedPromise = (time, fn)-> Promise.race [new Promise(fn), new Promise (res, rej)-> setTimeout rej, time]
{setImmediate, clearImmediate, Promise} = core
test 'setImmediate / clearImmediate' (assert)->
assert.expect 6
- assert.ok isFunction(setImmediate), 'setImmediate is function'
- assert.ok isFunction(clearImmediate), 'clearImmediate is function'
+ assert.isFunction setImmediate, 'setImmediate is function'
+ assert.isFunction clearImmediate, 'clearImmediate is function'
var def
timeLimitedPromise(1e3, (res)-> setImmediate ->
def := \a
diff --git a/tests/tests.js b/tests/tests.js
index 6a4fbbc0bf15..57a3bd97bd91 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -1,6 +1,6 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, timeLimitedPromise, toString$ = {}.toString;
+ var module, test, timeLimitedPromise;
module = QUnit.module, test = QUnit.test;
module('core-js');
timeLimitedPromise = function(time, fn){
@@ -12,10 +12,10 @@
};
test('delay', function(assert){
assert.expect(6);
- assert.ok(toString$.call(delay).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(delay.length, 1, 'arity is 1');
- assert.strictEqual(delay.name, 'delay', 'name is "delay"');
- assert.ok(/native code/.test(delay), 'looks like native');
+ assert.isFunction(delay);
+ assert.arity(delay, 1);
+ assert.name(delay, 'delay');
+ assert.looksNative(delay);
assert.ok(delay(42) instanceof Promise, 'returns promises');
return timeLimitedPromise(1e3, function(res){
delay(10).then(function(it){
@@ -31,21 +31,18 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, keys, create, assign, from, global, toString$ = {}.toString;
+ var module, test, keys, create, assign, from, global, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('core-js');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
keys = Object.keys, create = Object.create, assign = Object.assign;
from = Array.from;
global = this;
test('Dict', function(assert){
var dict1, dict2, dict3, done, iter;
- assert.ok(isFunction(global.Dict), 'is function');
- assert.strictEqual(Dict.length, 1, 'arity is 1');
- assert.strictEqual(Dict.name, 'Dict', 'name is "Dict"');
- assert.ok(/native code/.test(Dict), 'looks like native');
+ assert.isFunction(Dict);
+ assert.arity(Dict, 1);
+ assert.name(Dict, 'Dict');
+ assert.looksNative(Dict);
dict1 = Dict();
assert.ok(!(dict1 instanceof Object));
assert.deepEqual(keys(dict1), []);
@@ -75,7 +72,7 @@
test('Dict.every', function(assert){
var every, obj, ctx;
every = Dict.every;
- assert.ok(isFunction(every), 'is function');
+ assert.isFunction(every);
every(obj = {
q: 1
}, function(val, key, that){
@@ -102,7 +99,7 @@
test('Dict.filter', function(assert){
var filter, obj, ctx;
filter = Dict.filter;
- assert.ok(isFunction(filter), 'is function');
+ assert.isFunction(filter);
filter(obj = {
q: 1
}, function(val, key, that){
@@ -125,7 +122,7 @@
test('Dict.find', function(assert){
var find, obj, ctx;
find = Dict.find;
- assert.ok(isFunction(find), 'is function');
+ assert.isFunction(find);
find(obj = {
q: 1
}, function(val, key, that){
@@ -145,7 +142,7 @@
test('Dict.findKey', function(assert){
var findKey, obj, ctx;
findKey = Dict.findKey;
- assert.ok(isFunction(findKey), 'is function');
+ assert.isFunction(findKey);
findKey(obj = {
q: 1
}, function(val, key, that){
@@ -165,7 +162,7 @@
test('Dict.forEach', function(assert){
var forEach, obj, ctx, rez;
forEach = Dict.forEach;
- assert.ok(isFunction(forEach), 'is function');
+ assert.isFunction(forEach);
forEach(obj = {
q: 1
}, function(val, key, that){
@@ -218,7 +215,7 @@
test('Dict.keyOf', function(assert){
var keyOf;
keyOf = Dict.keyOf;
- assert.ok(isFunction(keyOf), 'is function');
+ assert.isFunction(keyOf);
assert.ok(keyOf({
q: 1,
w: 2,
@@ -238,7 +235,7 @@
test('Dict.map', function(assert){
var map, obj, ctx;
map = Dict.map;
- assert.ok(isFunction(map), 'is function');
+ assert.isFunction(map);
map(obj = {
q: 1
}, function(val, key, that){
@@ -262,7 +259,7 @@
test('Dict.mapPairs', function(assert){
var mapPairs, obj, ctx;
mapPairs = Dict.mapPairs;
- assert.ok(isFunction(mapPairs), 'is function');
+ assert.isFunction(mapPairs);
mapPairs(obj = {
q: 1
}, function(val, key, that){
@@ -285,7 +282,7 @@
test('Dict.reduce', function(assert){
var reduce, obj, foo, memo;
reduce = Dict.reduce;
- assert.ok(isFunction(reduce), 'is function');
+ assert.isFunction(reduce);
reduce(obj = {
a: 1
}, function(memo, val, key, that){
@@ -319,7 +316,7 @@
test('Dict.some', function(assert){
var some, obj, ctx;
some = Dict.some;
- assert.ok(isFunction(some), 'is function');
+ assert.isFunction(some);
some(obj = {
q: 1
}, function(val, key, that){
@@ -346,7 +343,7 @@
test('Dict.includes', function(assert){
var includes, dict, o;
includes = Dict.includes;
- assert.ok(isFunction(includes), 'is function');
+ assert.isFunction(includes);
dict = {
q: 1,
w: NaN,
@@ -365,7 +362,7 @@
test('Dict.has', function(assert){
var has;
has = Dict.has;
- assert.ok(isFunction(has), 'is function');
+ assert.isFunction(has);
assert.ok(has({
q: 1
}, 'q'));
@@ -382,7 +379,7 @@
test('Dict.get', function(assert){
var get;
get = Dict.get;
- assert.ok(isFunction(get), 'is function');
+ assert.isFunction(get);
assert.ok(get({
q: 1
}, 'q') === 1);
@@ -399,7 +396,7 @@
test('Dict.values', function(assert){
var values, iter;
values = Dict.values;
- assert.ok(isFunction(values), 'is function');
+ assert.isFunction(values);
iter = values({});
assert.ok(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8] === 'Dict Iterator');
assert.ok('next' in iter);
@@ -422,7 +419,7 @@
test('Dict.keys', function(assert){
var keys, iter;
keys = Dict.keys;
- assert.ok(isFunction(keys), 'is function');
+ assert.isFunction(keys);
iter = keys({});
assert.ok(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8] === 'Dict Iterator');
assert.ok('next' in iter);
@@ -445,7 +442,7 @@
test('Dict.entries', function(assert){
var entries, iter;
entries = Dict.entries;
- assert.ok(isFunction(entries), 'is function');
+ assert.isFunction(entries);
iter = entries({});
assert.ok(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8] === 'Dict Iterator');
assert.ok('next' in iter);
@@ -473,15 +470,12 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, toString$ = {}.toString;
+ var module, test, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('core-js');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
test('Function#part', function(assert){
var obj, $, fn, part;
- assert.ok(isFunction(Function.prototype.part), 'is function');
+ assert.isFunction(Function.prototype.part);
assert.ok(function(it){
return toString$.call(it).slice(8, -1) === 'String';
}.part('qwe')());
@@ -497,7 +491,7 @@
return Array.prototype.map.call(arguments, String).join(' ');
};
part = fn.part($, 'Саша', $, 'шоссе', $, 'сосала');
- assert.ok(isFunction(part), '.part with placeholders return function');
+ assert.isFunction(part, '.part with placeholders return function');
assert.ok(part('Шла', 'по') === 'Шла Саша по шоссе undefined сосала', '.part with placeholders: args < placeholders');
assert.ok(part('Шла', 'по', 'и') === 'Шла Саша по шоссе и сосала', '.part with placeholders: args == placeholders');
return assert.ok(part('Шла', 'по', 'и', 'сушку') === 'Шла Саша по шоссе и сосала сушку', '.part with placeholders: args > placeholders');
@@ -513,7 +507,7 @@
test('core.getIteratorMethod', function(assert){
var getIteratorMethod, iterFn, iter;
getIteratorMethod = core.getIteratorMethod;
- assert.ok(typeof getIteratorMethod === 'function', 'is function');
+ assert.isFunction(getIteratorMethod);
assert.strictEqual(getIteratorMethod({}), void 8);
iterFn = getIteratorMethod([]);
assert.ok(typeof iterFn === 'function');
@@ -535,7 +529,7 @@
test('core.getIterator', function(assert){
var getIterator, iter;
getIterator = core.getIterator;
- assert.ok(typeof getIterator === 'function', 'is function');
+ assert.isFunction(getIterator);
assert.throws(function(){
getIterator({});
}, TypeError);
@@ -556,7 +550,7 @@
test('core.isIterable', function(assert){
var isIterable;
isIterable = core.isIterable;
- assert.ok(typeof isIterable === 'function', 'is function');
+ assert.isFunction(isIterable);
assert.ok(!isIterable({}));
assert.ok(isIterable([]));
return assert.ok(isIterable(function(){
@@ -567,24 +561,18 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isObject, methods, toString$ = {}.toString;
+ var module, test, methods;
module = QUnit.module, test = QUnit.test;
module('core-js');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
- isObject = function(it){
- return it === Object(it);
- };
methods = ['assert', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupEnd', 'groupCollapsed', 'groupEnd', 'info', 'log', 'table', 'trace', 'warn', 'markTimeline', 'profile', 'profileEnd', 'time', 'timeEnd', 'timeStamp'];
test('log is object', function(assert){
- return assert.ok(isObject(log), 'global.log is object');
+ return assert.ok(Object(log) === log, 'global.log is object');
});
test('log.{..} are functions', function(assert){
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = methods).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(log[x$]), "log." + x$ + " is function"));
+ results$.push(assert.isFunction(log[x$], "log." + x$ + " is function"));
}
return results$;
});
@@ -627,8 +615,8 @@
test('log.{enable, disable}', function(assert){
var enable, disable;
enable = log.enable, disable = log.disable;
- assert.ok(isFunction(enable), 'log.enable is function');
- assert.ok(isFunction(disable), 'log.disable is function');
+ assert.isFunction(enable, 'log.enable is function');
+ assert.isFunction(disable, 'log.disable is function');
assert.ok((function(){
try {
disable();
@@ -648,7 +636,7 @@
}()), 'enable log');
});
test('log', function(assert){
- assert.ok(isFunction(log), 'global.log is function');
+ assert.isFunction(log);
return assert.ok((function(){
try {
log(42);
@@ -660,13 +648,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Number#@@iterator', function(assert){
var iterator, toStringTag, iter1, iter2, iter3, iter4, iter5, iter6;
iterator = Symbol.iterator, toStringTag = Symbol.toStringTag;
- assert.ok(toString$.call(Number.prototype[iterator]).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(Number.prototype[iterator]);
iter1 = 2[iterator]();
assert.ok(iter1[toStringTag] === 'Number Iterator', '@@toStringTag');
assert.deepEqual(iter1.next(), {
@@ -727,13 +715,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.classof', function(assert){
var classof, Class;
classof = Object.classof;
- assert.ok(toString$.call(classof).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(classof);
assert.ok(classof(void 8) === 'Undefined', 'classof undefined is `Undefined`');
assert.ok(classof(null) === 'Null', 'classof null is `Null`');
assert.ok(classof(true) === 'Boolean', 'classof bool is `Boolean`');
@@ -777,13 +765,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.define', function(assert){
var define, defineProperty, foo, foo2;
define = Object.define, defineProperty = Object.defineProperty;
- assert.ok(toString$.call(define).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(define);
foo = {
q: 1
};
@@ -816,13 +804,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.isObject', function(assert){
var isObject;
isObject = Object.isObject;
- assert.ok(toString$.call(isObject).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(isObject);
assert.ok(!isObject(void 8), 'isObject undefined return false');
assert.ok(!isObject(null), 'isObject null return false');
assert.ok(!isObject(1), 'isObject number return false');
@@ -841,13 +829,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('Object.make', function(assert){
var make, object, foo;
make = Object.make;
- assert.ok(toString$.call(make).slice(8, -1) === 'Function', 'is function');
+ assert.isFunction(make);
object = make(foo = {
q: 1
}, {
@@ -860,14 +848,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('String#escapeHTML', function(assert){
- assert.ok(toString$.call(String.prototype.escapeHTML).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(String.prototype.escapeHTML), 'looks like native');
- assert.strictEqual(String.prototype.escapeHTML.length, 0, 'arity is 0');
- assert.strictEqual(String.prototype.escapeHTML.name, 'escapeHTML', 'name is "escapeHTML"');
+ assert.isFunction(String.prototype.escapeHTML);
+ assert.arity(String.prototype.escapeHTML, 0);
+ assert.name(String.prototype.escapeHTML, 'escapeHTML');
+ assert.looksNative(String.prototype.escapeHTML);
assert.strictEqual('qwe, asd'.escapeHTML(), 'qwe, asd');
assert.strictEqual('qwe
'.escapeHTML(), '<div>qwe</div>');
return assert.strictEqual("&<>\"'".escapeHTML(), '&<>"'');
@@ -876,14 +864,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('core-js');
test('String#unescapeHTML', function(assert){
- assert.ok(toString$.call(String.prototype.unescapeHTML).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(String.prototype.unescapeHTML), 'looks like native');
- assert.strictEqual(String.prototype.unescapeHTML.length, 0, 'arity is 0');
- assert.strictEqual(String.prototype.unescapeHTML.name, 'unescapeHTML', 'name is "unescapeHTML"');
+ assert.isFunction(String.prototype.unescapeHTML);
+ assert.arity(String.prototype.unescapeHTML, 0);
+ assert.name(String.prototype.unescapeHTML, 'unescapeHTML');
+ assert.looksNative(String.prototype.unescapeHTML);
assert.strictEqual('qwe, asd'.unescapeHTML(), 'qwe, asd');
assert.strictEqual('<div>qwe</div>'.unescapeHTML(), 'qwe
');
return assert.strictEqual('&<>"''.unescapeHTML(), "&<>\"'");
@@ -892,16 +880,13 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, toString$ = {}.toString;
+ var module, test, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('ES5');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
test('Object.getOwnPropertyDescriptor', function(assert){
var getOwnPropertyDescriptor;
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- assert.ok(isFunction(getOwnPropertyDescriptor), 'is function');
+ assert.isFunction(getOwnPropertyDescriptor);
assert.deepEqual(getOwnPropertyDescriptor({
q: 42
}, 'q'), {
@@ -915,7 +900,7 @@
test('Object.defineProperty', function(assert){
var defineProperty, rez, src;
defineProperty = Object.defineProperty;
- assert.ok(isFunction(defineProperty), 'is function');
+ assert.isFunction(defineProperty);
assert.ok((rez = defineProperty(src = {}, 'q', {
value: 42
})) === src);
@@ -924,7 +909,7 @@
test('Object.defineProperties', function(assert){
var defineProperties, rez, src;
defineProperties = Object.defineProperties;
- assert.ok(isFunction(defineProperties), 'is function');
+ assert.isFunction(defineProperties);
assert.ok((rez = defineProperties(src = {}, {
q: {
value: 42
@@ -938,7 +923,7 @@
test('Object.getPrototypeOf', function(assert){
var create, getPrototypeOf, fn, obj, foo, bar;
create = Object.create, getPrototypeOf = Object.getPrototypeOf;
- assert.ok(isFunction(getPrototypeOf), 'is function');
+ assert.isFunction(getPrototypeOf);
assert.ok(getPrototypeOf({}) === Object.prototype);
assert.ok(getPrototypeOf([]) === Array.prototype);
assert.ok(getPrototypeOf(new (fn = (function(){
@@ -962,7 +947,7 @@
test('Object.getOwnPropertyNames', function(assert){
var getOwnPropertyNames, fn1, fn2, names;
getOwnPropertyNames = Object.getOwnPropertyNames;
- assert.ok(isFunction(getOwnPropertyNames), 'is function');
+ assert.isFunction(getOwnPropertyNames);
fn1 = function(w){
this.w = w != null ? w : 2;
};
@@ -1002,7 +987,7 @@
}
return result;
};
- assert.ok(isFunction(create), 'is function');
+ assert.isFunction(create);
assert.ok(isPrototype(obj = {
q: 1
}, create(obj)));
@@ -1030,7 +1015,7 @@
test('Object.keys', function(assert){
var keys, fn1, fn2;
keys = Object.keys;
- assert.ok(isFunction(keys), 'is function');
+ assert.isFunction(keys);
fn1 = function(w){
this.w = w != null ? w : 2;
};
@@ -1046,42 +1031,42 @@
test('Object.seal', function(assert){
var seal, a;
seal = Object.seal;
- assert.ok(isFunction(seal), 'is function');
+ assert.isFunction(seal);
return assert.strictEqual(seal(a = {}), a);
});
test('Object.freeze', function(assert){
var freeze, a;
freeze = Object.freeze;
- assert.ok(isFunction(freeze), 'is function');
+ assert.isFunction(freeze);
return assert.strictEqual(freeze(a = {}), a);
});
test('Object.preventExtensions', function(assert){
var preventExtensions, a;
preventExtensions = Object.preventExtensions;
- assert.ok(isFunction(preventExtensions), 'is function');
+ assert.isFunction(preventExtensions);
return assert.strictEqual(preventExtensions(a = {}), a);
});
test('Object.isSealed', function(assert){
var isSealed;
isSealed = Object.isSealed;
- assert.ok(isFunction(isSealed), 'is function');
+ assert.isFunction(isSealed);
return assert.strictEqual(isSealed({}), false);
});
test('Object.isFrozen', function(assert){
var isFrozen;
isFrozen = Object.isFrozen;
- assert.ok(isFunction(isFrozen), 'is function');
+ assert.isFunction(isFrozen);
return assert.strictEqual(isFrozen({}), false);
});
test('Object.isExtensible', function(assert){
var isExtensible;
isExtensible = Object.isExtensible;
- assert.ok(isFunction(isExtensible), 'is function');
+ assert.isFunction(isExtensible);
return assert.strictEqual(isExtensible({}), true);
});
test('Function#bind', function(assert){
var obj, fn, inst, F, date;
- assert.ok(isFunction(Function.prototype.bind), 'is function');
+ assert.isFunction(Function.prototype.bind);
obj = {
a: 42
};
@@ -1111,7 +1096,7 @@
test('Array.isArray', function(assert){
var isArray;
isArray = Array.isArray;
- assert.ok(isFunction(isArray), 'is function');
+ assert.isFunction(isArray);
assert.ok(!isArray({}));
assert.ok(!isArray(function(){
return arguments;
@@ -1122,7 +1107,7 @@
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = ['indexOf', 'lastIndexOf', 'every', 'some', 'forEach', 'map', 'filter', 'reduce', 'reduceRight']).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(Array.prototype[x$]), "Array::" + x$ + " is function"));
+ results$.push(assert.isFunction(Array.prototype[x$], "Array::" + x$ + " is function"));
}
return results$;
});
@@ -1335,12 +1320,12 @@
test('Date.now', function(assert){
var now;
now = Date.now;
- assert.ok(isFunction(now), 'is function');
+ assert.isFunction(now);
return assert.ok(+new Date - now() < 10, 'Date.now() ~ +new Date');
});
test('Date#toISOString', function(assert){
var ft, bc;
- assert.ok(isFunction(Date.prototype.toISOString), 'is function');
+ assert.isFunction(Date.prototype.toISOString);
assert.strictEqual(new Date(0).toISOString(), '1970-01-01T00:00:00.000Z');
assert.strictEqual(new Date(1e12 + 1).toISOString(), '2001-09-09T01:46:40.001Z');
assert.strictEqual(new Date(-5e13 - 1).toISOString(), '0385-07-25T07:06:39.999Z');
@@ -1375,15 +1360,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#copyWithin', function(assert){
var a;
- assert.ok(toString$.call(Array.prototype.copyWithin).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.copyWithin.length, 2, 'arity is 2');
- assert.ok(/native code/.test(Array.prototype.copyWithin), 'looks like native');
- assert.strictEqual(Array.prototype.copyWithin.name, 'copyWithin', 'name is "copyWithin"');
+ assert.isFunction(Array.prototype.copyWithin);
+ assert.arity(Array.prototype.copyWithin, 2);
+ assert.name(Array.prototype.copyWithin, 'copyWithin');
+ assert.looksNative(Array.prototype.copyWithin);
assert.strictEqual(a = [1].copyWithin(0), a);
assert.deepEqual([1, 2, 3, 4, 5].copyWithin(0, 3), [4, 5, 3, 4, 5]);
assert.deepEqual([1, 2, 3, 4, 5].copyWithin(1, 3), [1, 4, 5, 4, 5]);
@@ -1414,15 +1399,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#fill', function(assert){
var a;
- assert.ok(toString$.call(Array.prototype.fill).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.fill.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.fill), 'looks like native');
- assert.strictEqual(Array.prototype.fill.name, 'fill', 'name is "fill"');
+ assert.isFunction(Array.prototype.fill);
+ assert.arity(Array.prototype.fill, 1);
+ assert.name(Array.prototype.fill, 'fill');
+ assert.looksNative(Array.prototype.fill);
assert.strictEqual(a = Array(5).fill(5), a);
assert.deepEqual(Array(5).fill(5), [5, 5, 5, 5, 5]);
assert.deepEqual(Array(5).fill(5, 1), [void 8, 5, 5, 5, 5]);
@@ -1446,15 +1431,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#findIndex', function(assert){
var arr, ctx;
- assert.ok(toString$.call(Array.prototype.findIndex).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.findIndex.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.findIndex), 'looks like native');
- assert.strictEqual(Array.prototype.findIndex.name, 'findIndex', 'name is "findIndex"');
+ assert.isFunction(Array.prototype.findIndex);
+ assert.arity(Array.prototype.findIndex, 1);
+ assert.name(Array.prototype.findIndex, 'findIndex');
+ assert.looksNative(Array.prototype.findIndex);
(arr = [1]).findIndex(function(val, key, that){
assert.strictEqual(this, ctx);
assert.strictEqual(val, 1);
@@ -1481,15 +1466,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array#find', function(assert){
var arr, ctx;
- assert.ok(toString$.call(Array.prototype.find).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.find.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.find), 'looks like native');
- assert.strictEqual(Array.prototype.find.name, 'find', 'name is "find"');
+ assert.isFunction(Array.prototype.find);
+ assert.arity(Array.prototype.find, 1);
+ assert.name(Array.prototype.find, 'find');
+ assert.looksNative(Array.prototype.find);
(arr = [1]).find(function(val, key, that){
assert.strictEqual(this, ctx);
assert.strictEqual(val, 1);
@@ -1518,17 +1503,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array.from', function(assert){
var from, iterator, al, ctx, done, iter, F, inst, a;
from = Array.from;
iterator = Symbol.iterator;
- assert.ok(toString$.call(from).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.from.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.from), 'looks like native');
- assert.strictEqual(Array.from.name, 'from', 'name is "from"');
+ assert.isFunction(from);
+ assert.arity(from, 1);
+ assert.name(from, 'from');
+ assert.looksNative(from);
assert.deepEqual(from('123'), ['1', '2', '3']);
assert.deepEqual(from({
length: 3,
@@ -1611,21 +1596,18 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, toString$ = {}.toString;
+ var module, test, isIterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
test('Array#keys', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype.keys), 'is function');
- assert.strictEqual(Array.prototype.keys.length, 0, 'arity is 0');
- assert.strictEqual(Array.prototype.keys.name, 'keys', 'name is "keys"');
- assert.ok(/native code/.test(Array.prototype.keys), 'looks like native');
+ assert.isFunction(Array.prototype.keys);
+ assert.arity(Array.prototype.keys, 0);
+ assert.name(Array.prototype.keys, 'keys');
+ assert.looksNative(Array.prototype.keys);
iter = ['q', 'w', 'e'].keys();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1649,9 +1631,9 @@
});
test('Array#values', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype.values), 'is function');
- assert.strictEqual(Array.prototype.values.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Array.prototype.values), 'looks like native');
+ assert.isFunction(Array.prototype.values);
+ assert.arity(Array.prototype.values, 0);
+ assert.looksNative(Array.prototype.values);
iter = ['q', 'w', 'e'].values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1675,10 +1657,10 @@
});
test('Array#entries', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype.entries), 'is function');
- assert.strictEqual(Array.prototype.entries.length, 0, 'arity is 0');
- assert.strictEqual(Array.prototype.entries.name, 'entries', 'name is "entries"');
- assert.ok(/native code/.test(Array.prototype.entries), 'looks like native');
+ assert.isFunction(Array.prototype.entries);
+ assert.arity(Array.prototype.entries, 0);
+ assert.name(Array.prototype.entries, 'entries');
+ assert.looksNative(Array.prototype.entries);
iter = ['q', 'w', 'e'].entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Array Iterator');
@@ -1702,9 +1684,9 @@
});
test('Array#@@iterator', function(assert){
var iter;
- assert.ok(isFunction(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'is function');
- assert.strictEqual(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8].length, 0, 'arity is 0');
- assert.ok(/native code/.test(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'looks like native');
+ assert.isFunction(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
+ assert.arity(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], 0);
+ assert.looksNative(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
assert.strictEqual(Array.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], Array.prototype.values);
iter = ['q', 'w', 'e'][typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
@@ -1730,15 +1712,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Array.of', function(assert){
var F, inst;
- assert.ok(toString$.call(Array.of).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.of.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Array.of), 'looks like native');
- assert.strictEqual(Array.of.name, 'of', 'name is "of"');
+ assert.isFunction(Array.of);
+ assert.arity(Array.of, 0);
+ assert.name(Array.of, 'of');
+ assert.looksNative(Array.of);
assert.deepEqual(Array.of(1), [1]);
assert.deepEqual(Array.of(1, 2, 3), [1, 2, 3]);
F = function(){};
@@ -1791,14 +1773,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, same, getOwnPropertyDescriptor, freeze, iterator, toString$ = {}.toString;
+ var module, test, isIterator, same, getOwnPropertyDescriptor, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
same = function(a, b){
if (a === b) {
@@ -1811,10 +1790,10 @@
iterator = Symbol.iterator;
test('Map', function(assert){
var done, iter, a;
- assert.ok(isFunction(Map), 'is function');
- assert.ok(/native code/.test(Map), 'looks like native');
- assert.strictEqual(Map.name, 'Map', 'name is "Map"');
- assert.strictEqual(Map.length, 0, 'arity is 0');
+ assert.isFunction(Map);
+ assert.arity(Map, 0);
+ assert.name(Map, 'Map');
+ assert.looksNative(Map);
assert.ok('clear' in Map.prototype, 'clear in Map.prototype');
assert.ok('delete' in Map.prototype, 'delete in Map.prototype');
assert.ok('forEach' in Map.prototype, 'forEach in Map.prototype');
@@ -1845,10 +1824,10 @@
});
test('Map#clear', function(assert){
var M, f;
- assert.ok(isFunction(Map.prototype.clear), 'is function');
- assert.strictEqual(Map.prototype.clear.name, 'clear', 'name is "clear"');
- assert.strictEqual(Map.prototype.clear.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.clear), 'looks like native');
+ assert.isFunction(Map.prototype.clear);
+ assert.arity(Map.prototype.clear, 0);
+ assert.name(Map.prototype.clear, 'clear');
+ assert.looksNative(Map.prototype.clear);
M = new Map;
M.clear();
assert.strictEqual(M.size, 0);
@@ -1865,9 +1844,9 @@
});
test('Map#delete', function(assert){
var a, M, f;
- assert.ok(isFunction(Map.prototype['delete']), 'is function');
- assert.strictEqual(Map.prototype['delete'].length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype['delete']), 'looks like native');
+ assert.isFunction(Map.prototype['delete']);
+ assert.arity(Map.prototype['delete'], 1);
+ assert.looksNative(Map.prototype['delete']);
a = [];
M = new Map().set(NaN, 1).set(2, 1).set(3, 1).set(2, 5).set(1, 4).set(a, {});
assert.strictEqual(M.size, 5);
@@ -1886,10 +1865,10 @@
});
test('Map#forEach', function(assert){
var r, T, count, M, a, map, s;
- assert.ok(isFunction(Map.prototype.forEach), 'is function');
- assert.strictEqual(Map.prototype.forEach.name, 'forEach', 'name is "forEach"');
- assert.strictEqual(Map.prototype.forEach.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype.forEach), 'looks like native');
+ assert.isFunction(Map.prototype.forEach);
+ assert.arity(Map.prototype.forEach, 1);
+ assert.name(Map.prototype.forEach, 'forEach');
+ assert.looksNative(Map.prototype.forEach);
r = {};
count = 0;
M = new Map().set(NaN, 1).set(2, 1).set(3, 7).set(2, 5).set(1, 4).set(a = {}, 9);
@@ -1930,10 +1909,10 @@
});
test('Map#get', function(assert){
var o, f, M;
- assert.ok(isFunction(Map.prototype.get), 'is function');
- assert.strictEqual(Map.prototype.get.name, 'get', 'name is "get"');
- assert.strictEqual(Map.prototype.get.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype.get), 'looks like native');
+ assert.isFunction(Map.prototype.get);
+ assert.name(Map.prototype.get, 'get');
+ assert.arity(Map.prototype.get, 1);
+ assert.looksNative(Map.prototype.get);
o = {};
f = freeze({});
M = new Map([[NaN, 1], [2, 1], [3, 1], [2, 5], [1, 4], [f, 42], [o, o]]);
@@ -1946,10 +1925,10 @@
});
test('Map#has', function(assert){
var o, f, M;
- assert.ok(isFunction(Map.prototype.has), 'is function');
- assert.strictEqual(Map.prototype.has.name, 'has', 'name is "has"');
- assert.strictEqual(Map.prototype.has.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Map.prototype.has), 'looks like native');
+ assert.isFunction(Map.prototype.has);
+ assert.name(Map.prototype.has, 'has');
+ assert.arity(Map.prototype.has, 1);
+ assert.looksNative(Map.prototype.has);
o = {};
f = freeze({});
M = new Map([[NaN, 1], [2, 1], [3, 1], [2, 5], [1, 4], [f, 42], [o, o]]);
@@ -1962,10 +1941,10 @@
});
test('Map#set', function(assert){
var o, M, chain, f;
- assert.ok(isFunction(Map.prototype.set), 'is function');
- assert.strictEqual(Map.prototype.set.name, 'set', 'name is "set"');
- assert.strictEqual(Map.prototype.set.length, 2, 'arity is 2');
- assert.ok(/native code/.test(Map.prototype.set), 'looks like native');
+ assert.isFunction(Map.prototype.set);
+ assert.name(Map.prototype.set, 'set');
+ assert.arity(Map.prototype.set, 2);
+ assert.looksNative(Map.prototype.set);
o = {};
M = new Map().set(NaN, 1).set(2, 1).set(3, 1).set(2, 5).set(1, 4).set(o, o);
assert.ok(M.size === 5);
@@ -2051,10 +2030,10 @@
});
test('Map#keys', function(assert){
var iter;
- assert.ok(typeof Map.prototype.keys === 'function', 'is function');
- assert.strictEqual(Map.prototype.keys.name, 'keys', 'name is "keys"');
- assert.strictEqual(Map.prototype.keys.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.keys), 'looks like native');
+ assert.isFunction(Map.prototype.keys);
+ assert.name(Map.prototype.keys, 'keys');
+ assert.arity(Map.prototype.keys, 0);
+ assert.looksNative(Map.prototype.keys);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).keys();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -2077,10 +2056,10 @@
});
test('Map#values', function(assert){
var iter;
- assert.ok(typeof Map.prototype.values === 'function', 'is function');
- assert.strictEqual(Map.prototype.values.name, 'values', 'name is "values"');
- assert.strictEqual(Map.prototype.values.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.values), 'looks like native');
+ assert.isFunction(Map.prototype.values);
+ assert.name(Map.prototype.values, 'values');
+ assert.arity(Map.prototype.values, 0);
+ assert.looksNative(Map.prototype.values);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -2103,10 +2082,10 @@
});
test('Map#entries', function(assert){
var iter;
- assert.ok(typeof Map.prototype.entries === 'function', 'is function');
- assert.strictEqual(Map.prototype.entries.name, 'entries', 'name is "entries"');
- assert.strictEqual(Map.prototype.entries.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.entries), 'looks like native');
+ assert.isFunction(Map.prototype.entries);
+ assert.name(Map.prototype.entries, 'entries');
+ assert.arity(Map.prototype.entries, 0);
+ assert.looksNative(Map.prototype.entries);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']]).entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Map Iterator');
@@ -2129,10 +2108,10 @@
});
test('Map#@@iterator', function(assert){
var iter;
- assert.ok(typeof Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8] === 'function', 'is function');
- assert.strictEqual(Map.prototype.entries.name, 'entries', 'name is "entries"');
- assert.strictEqual(Map.prototype.entries.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'looks like native');
+ assert.isFunction(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
+ assert.name(Map.prototype.entries, 'entries');
+ assert.arity(Map.prototype.entries, 0);
+ assert.looksNative(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
assert.strictEqual(Map.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], Map.prototype.entries);
iter = new Map([['a', 'q'], ['s', 'w'], ['d', 'e']])[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
@@ -2158,16 +2137,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.acosh', function(assert){
var acosh;
acosh = Math.acosh;
- assert.ok(toString$.call(acosh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(acosh.name, 'acosh', 'name is "acosh"');
- assert.strictEqual(acosh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(acosh), 'looks like native');
+ assert.isFunction(acosh);
+ assert.name(acosh, 'acosh');
+ assert.arity(acosh, 1);
+ assert.looksNative(acosh);
assert.same(acosh(NaN), NaN);
assert.same(acosh(0.5), NaN);
assert.same(acosh(-1), NaN);
@@ -2184,16 +2163,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.asinh', function(assert){
var asinh;
asinh = Math.asinh;
- assert.ok(toString$.call(asinh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(asinh.name, 'asinh', 'name is "asinh"');
- assert.strictEqual(asinh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(asinh), 'looks like native');
+ assert.isFunction(asinh);
+ assert.name(asinh, 'asinh');
+ assert.arity(asinh, 1);
+ assert.looksNative(asinh);
assert.same(asinh(NaN), NaN);
assert.same(asinh(0), 0);
assert.same(asinh(-0), -0);
@@ -2209,16 +2188,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.atanh', function(assert){
var atanh;
atanh = Math.atanh;
- assert.ok(toString$.call(atanh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(atanh.name, 'atanh', 'name is "atanh"');
- assert.strictEqual(atanh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(atanh), 'looks like native');
+ assert.isFunction(atanh);
+ assert.name(atanh, 'atanh');
+ assert.arity(atanh, 1);
+ assert.looksNative(atanh);
assert.same(atanh(NaN), NaN);
assert.same(atanh(-2), NaN);
assert.same(atanh(-1.5), NaN);
@@ -2238,16 +2217,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.cbrt', function(assert){
var cbrt;
cbrt = Math.cbrt;
- assert.ok(toString$.call(cbrt).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(cbrt.name, 'cbrt', 'name is "cbrt"');
- assert.strictEqual(cbrt.length, 1, 'arity is 1');
- assert.ok(/native code/.test(cbrt), 'looks like native');
+ assert.isFunction(cbrt);
+ assert.name(cbrt, 'cbrt');
+ assert.arity(cbrt, 1);
+ assert.looksNative(cbrt);
assert.same(cbrt(NaN), NaN);
assert.same(cbrt(0), 0);
assert.same(cbrt(-0), -0);
@@ -2262,16 +2241,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.clz32', function(assert){
var clz32;
clz32 = Math.clz32;
- assert.ok(toString$.call(clz32).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(clz32.name, 'clz32', 'name is "clz32"');
- assert.strictEqual(clz32.length, 1, 'arity is 1');
- assert.ok(/native code/.test(clz32), 'looks like native');
+ assert.isFunction(clz32);
+ assert.name(clz32, 'clz32');
+ assert.arity(clz32, 1);
+ assert.looksNative(clz32);
assert.strictEqual(clz32(0), 32);
assert.strictEqual(clz32(1), 31);
assert.same(clz32(-1), 0);
@@ -2283,16 +2262,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.cosh', function(assert){
var cosh;
cosh = Math.cosh;
- assert.ok(toString$.call(cosh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(cosh.name, 'cosh', 'name is "cosh"');
- assert.strictEqual(cosh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(cosh), 'looks like native');
+ assert.isFunction(cosh);
+ assert.name(cosh, 'cosh');
+ assert.arity(cosh, 1);
+ assert.looksNative(cosh);
assert.same(cosh(NaN), NaN);
assert.strictEqual(cosh(0), 1);
assert.strictEqual(cosh(-0), 1);
@@ -2307,16 +2286,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.expm1', function(assert){
var expm1;
expm1 = Math.expm1;
- assert.ok(toString$.call(expm1).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(expm1.name, 'expm1', 'name is "expm1"');
- assert.strictEqual(expm1.length, 1, 'arity is 1');
- assert.ok(/native code/.test(expm1), 'looks like native');
+ assert.isFunction(expm1);
+ assert.name(expm1, 'expm1');
+ assert.arity(expm1, 1);
+ assert.looksNative(expm1);
assert.same(expm1(NaN), NaN);
assert.same(expm1(0), 0);
assert.same(expm1(-0), -0);
@@ -2328,16 +2307,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.fround', function(assert){
var fround, maxFloat32, minFloat32;
fround = Math.fround;
- assert.ok(toString$.call(fround).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(fround.name, 'fround', 'name is "fround"');
- assert.strictEqual(fround.length, 1, 'arity is 1');
- assert.ok(/native code/.test(fround), 'looks like native');
+ assert.isFunction(fround);
+ assert.name(fround, 'fround');
+ assert.arity(fround, 1);
+ assert.looksNative(fround);
assert.same(fround(void 8), NaN);
assert.same(fround(NaN), NaN);
assert.same(fround(0), 0);
@@ -2367,16 +2346,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.hypot', function(assert){
var hypot, sqrt;
hypot = Math.hypot, sqrt = Math.sqrt;
- assert.ok(toString$.call(hypot).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(hypot.name, 'hypot', 'name is "hypot"');
- assert.strictEqual(hypot.length, 2, 'arity is 2');
- assert.ok(/native code/.test(hypot), 'looks like native');
+ assert.isFunction(hypot);
+ assert.name(hypot, 'hypot');
+ assert.arity(hypot, 2);
+ assert.looksNative(hypot);
assert.strictEqual(hypot(), 0);
assert.strictEqual(hypot(1), 1);
assert.same(hypot('', 0), 0);
@@ -2417,16 +2396,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.imul', function(assert){
var imul;
imul = Math.imul;
- assert.ok(toString$.call(imul).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(imul.name, 'imul', 'name is "imul"');
- assert.strictEqual(imul.length, 2, 'arity is 2');
- assert.ok(/native code/.test(imul), 'looks like native');
+ assert.isFunction(imul);
+ assert.name(imul, 'imul');
+ assert.arity(imul, 2);
+ assert.looksNative(imul);
assert.same(imul(0, 0), 0);
assert.strictEqual(imul(123, 456), 56088);
assert.strictEqual(imul(-123, 456), -56088);
@@ -2467,16 +2446,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log10', function(assert){
var log10;
log10 = Math.log10;
- assert.ok(toString$.call(log10).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(log10.name, 'log10', 'name is "log10"');
- assert.strictEqual(log10.length, 1, 'arity is 1');
- assert.ok(/native code/.test(log10), 'looks like native');
+ assert.isFunction(log10);
+ assert.name(log10, 'log10');
+ assert.arity(log10, 1);
+ assert.looksNative(log10);
assert.same(log10(''), log10(0));
assert.same(log10(NaN), NaN);
assert.same(log10(-1), NaN);
@@ -2494,16 +2473,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log1p', function(assert){
var log1p;
log1p = Math.log1p;
- assert.ok(toString$.call(log1p).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(log1p.name, 'log1p', 'name is "log1p"');
- assert.strictEqual(log1p.length, 1, 'arity is 1');
- assert.ok(/native code/.test(log1p), 'looks like native');
+ assert.isFunction(log1p);
+ assert.name(log1p, 'log1p');
+ assert.arity(log1p, 1);
+ assert.looksNative(log1p);
assert.same(log1p(''), log1p(0));
assert.same(log1p(NaN), NaN);
assert.same(log1p(-2), NaN);
@@ -2518,16 +2497,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.log2', function(assert){
var log2;
log2 = Math.log2;
- assert.ok(toString$.call(log2).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(log2.name, 'log2', 'name is "log2"');
- assert.strictEqual(log2.length, 1, 'arity is 1');
- assert.ok(/native code/.test(log2), 'looks like native');
+ assert.isFunction(log2);
+ assert.name(log2, 'log2');
+ assert.arity(log2, 1);
+ assert.looksNative(log2);
assert.same(log2(''), log2(0));
assert.same(log2(NaN), NaN);
assert.same(log2(-1), NaN);
@@ -2543,16 +2522,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.sign', function(assert){
var sign;
sign = Math.sign;
- assert.ok(toString$.call(sign).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(sign.name, 'sign', 'name is "sign"');
- assert.strictEqual(sign.length, 1, 'arity is 1');
- assert.ok(/native code/.test(sign), 'looks like native');
+ assert.isFunction(sign);
+ assert.name(sign, 'sign');
+ assert.arity(sign, 1);
+ assert.looksNative(sign);
assert.same(sign(NaN), NaN);
assert.same(sign(), NaN);
assert.same(sign(-0), -0);
@@ -2568,16 +2547,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.sinh', function(assert){
var sinh;
sinh = Math.sinh;
- assert.ok(toString$.call(sinh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(sinh.name, 'sinh', 'name is "sinh"');
- assert.strictEqual(sinh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(sinh), 'looks like native');
+ assert.isFunction(sinh);
+ assert.name(sinh, 'sinh');
+ assert.arity(sinh, 1);
+ assert.looksNative(sinh);
assert.same(sinh(NaN), NaN);
assert.same(sinh(0), 0);
assert.same(sinh(-0), -0);
@@ -2591,16 +2570,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.tanh', function(assert){
var tanh;
tanh = Math.tanh;
- assert.ok(toString$.call(tanh).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(tanh.name, 'tanh', 'name is "tanh"');
- assert.strictEqual(tanh.length, 1, 'arity is 1');
- assert.ok(/native code/.test(tanh), 'looks like native');
+ assert.isFunction(tanh);
+ assert.name(tanh, 'tanh');
+ assert.arity(tanh, 1);
+ assert.looksNative(tanh);
assert.same(tanh(NaN), NaN);
assert.same(tanh(0), 0);
assert.same(tanh(-0), -0);
@@ -2612,16 +2591,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Math.trunc', function(assert){
var trunc;
trunc = Math.trunc;
- assert.ok(toString$.call(trunc).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(trunc.name, 'trunc', 'name is "trunc"');
- assert.strictEqual(trunc.length, 1, 'arity is 1');
- assert.ok(/native code/.test(trunc), 'looks like native');
+ assert.isFunction(trunc);
+ assert.name(trunc, 'trunc');
+ assert.arity(trunc, 1);
+ assert.looksNative(trunc);
assert.same(trunc(NaN), NaN, 'NaN -> NaN');
assert.same(trunc(-0), -0, '-0 -> -0');
assert.same(trunc(0), 0, '0 -> 0');
@@ -2658,10 +2637,10 @@
test('Number constructor: regression', function(assert){
var check, i, i$, x$, ref$, len$, n;
check = $check(assert);
- assert.ok(toString$.call(Number).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Number.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Number), 'looks like native');
- assert.strictEqual(Number.name, 'Number', 'name is "Number"');
+ assert.isFunction(Number);
+ assert.arity(Number, 1);
+ assert.name(Number, 'Number');
+ assert.looksNative(Number);
check(42, 42);
check(42.42, 42.42);
check(new Number(42), 42);
@@ -2825,17 +2804,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isFinite', function(assert){
var isFinite, create, i$, x$, ref$, len$, y$, e, results$ = [];
isFinite = Number.isFinite;
create = Object.create;
- assert.ok(toString$.call(isFinite).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isFinite.name, 'isFinite', 'name is "isFinite"');
- assert.strictEqual(isFinite.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isFinite), 'looks like native');
+ assert.isFunction(isFinite);
+ assert.name(isFinite, 'isFinite');
+ assert.arity(isFinite, 1);
+ assert.looksNative(isFinite);
for (i$ = 0, len$ = (ref$ = [1, 0.1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isFinite(x$), "isFinite " + typeof x$ + " " + x$);
@@ -2859,17 +2838,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isInteger', function(assert){
var isInteger, create, i$, x$, ref$, len$, y$, e, results$ = [];
isInteger = Number.isInteger;
create = Object.create;
- assert.ok(toString$.call(isInteger).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isInteger.name, 'isInteger', 'name is "isInteger"');
- assert.strictEqual(isInteger.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isInteger), 'looks like native');
+ assert.isFunction(isInteger);
+ assert.name(isInteger, 'isInteger');
+ assert.arity(isInteger, 1);
+ assert.looksNative(isInteger);
for (i$ = 0, len$ = (ref$ = [1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isInteger(x$), "isInteger " + typeof x$ + " " + x$);
@@ -2893,17 +2872,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isNaN', function(assert){
var isNaN, create, i$, x$, ref$, len$, e, results$ = [];
isNaN = Number.isNaN;
create = Object.create;
- assert.ok(toString$.call(isNaN).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isNaN.name, 'isNaN', 'name is "isNaN"');
- assert.strictEqual(isNaN.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isNaN), 'looks like native');
+ assert.isFunction(isNaN);
+ assert.name(isNaN, 'isNaN');
+ assert.arity(isNaN, 1);
+ assert.looksNative(isNaN);
assert.ok(isNaN(NaN), 'Number.isNaN NaN');
for (i$ = 0, len$ = (ref$ = [1, 0.1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0, Infinity, 'NaN', '5', false, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void 8, null, {}, fn$, create(null)]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
@@ -2924,17 +2903,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.isSafeInteger', function(assert){
var isSafeInteger, create, i$, x$, ref$, len$, y$, e, results$ = [];
isSafeInteger = Number.isSafeInteger;
create = Object.create;
- assert.ok(toString$.call(isSafeInteger).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isSafeInteger.name, 'isSafeInteger', 'name is "isSafeInteger"');
- assert.strictEqual(isSafeInteger.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isSafeInteger), 'looks like native');
+ assert.isFunction(isSafeInteger);
+ assert.name(isSafeInteger, 'isSafeInteger');
+ assert.arity(isSafeInteger, 1);
+ assert.looksNative(isSafeInteger);
for (i$ = 0, len$ = (ref$ = [1, -1, Math.pow(2, 16), Math.pow(2, 16) - 1, Math.pow(2, 31), Math.pow(2, 31) - 1, Math.pow(2, 32), Math.pow(2, 32) - 1, -0, 9007199254740991, -9007199254740991]).length; i$ < len$; ++i$) {
x$ = ref$[i$];
assert.ok(isSafeInteger(x$), "isSafeInteger " + typeof x$ + " " + x$);
@@ -2978,33 +2957,33 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.parseFloat', function(assert){
- assert.ok(toString$.call(Number.parseFloat).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Number.parseFloat.name, 'parseFloat', 'name is "parseFloat"');
- assert.strictEqual(Number.parseFloat.length, 1, 'arity is 1');
- return assert.ok(/native code/.test(Number.parseFloat), 'looks like native');
+ assert.isFunction(Number.parseFloat);
+ assert.name(Number.parseFloat, 'parseFloat');
+ assert.arity(Number.parseFloat, 1);
+ return assert.looksNative(Number.parseFloat);
});
}).call(this);
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Number.parseInt', function(assert){
- assert.ok(toString$.call(Number.parseInt).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Number.parseInt.name, 'parseInt', 'name is "parseInt"');
- assert.strictEqual(Number.parseInt.length, 2, 'arity is 2');
- return assert.ok(/native code/.test(Number.parseInt), 'looks like native');
+ assert.isFunction(Number.parseInt);
+ assert.name(Number.parseInt, 'parseInt');
+ assert.arity(Number.parseInt, 2);
+ return assert.looksNative(Number.parseInt);
});
}).call(this);
// Generated by LiveScript 1.3.1
(function(){
- var module, test, descriptors, toString$ = {}.toString;
+ var module, test, descriptors;
module = QUnit.module, test = QUnit.test;
module('ES6');
descriptors = function(){
@@ -3019,10 +2998,10 @@
test('Object.assign', function(assert){
var assign, keys, defineProperty, foo, str, c, d, D, ref$, O, string, i$, x$, len$;
assign = Object.assign, keys = Object.keys, defineProperty = Object.defineProperty;
- assert.ok(toString$.call(assign).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(assign.length, 2, 'arity is 2');
- assert.strictEqual(assign.name, 'assign', 'name is "assign"');
- assert.ok(/native code/.test(assign), 'looks like native');
+ assert.isFunction(assign);
+ assert.arity(assign, 2);
+ assert.name(assign, 'assign');
+ assert.looksNative(assign);
foo = {
q: 1
};
@@ -3101,16 +3080,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Object.is', function(assert){
var same;
same = Object.is;
- assert.ok(toString$.call(same).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(same.length, 2, 'arity is 2');
- assert.strictEqual(same.name, 'is', 'name is "is"');
- assert.ok(/native code/.test(same), 'looks like native');
+ assert.isFunction(same);
+ assert.arity(same, 2);
+ assert.name(same, 'is');
+ assert.looksNative(same);
assert.ok(same(1, 1), '1 is 1');
assert.ok(same(NaN, NaN), '1 is 1');
assert.ok(!same(0, -0), '0 isnt -0');
@@ -3120,17 +3099,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
if (Object.setPrototypeOf || '__proto__' in Object.prototype) {
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Object.setPrototypeOf', function(assert){
var setPrototypeOf, tmp;
setPrototypeOf = Object.setPrototypeOf;
- assert.ok(toString$.call(setPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(setPrototypeOf.length, 2, 'arity is 2');
- assert.strictEqual(setPrototypeOf.name, 'setPrototypeOf', 'name is "setPrototypeOf"');
- assert.ok(/native code/.test(setPrototypeOf), 'looks like native');
+ assert.isFunction(setPrototypeOf);
+ assert.arity(setPrototypeOf, 2);
+ assert.name(setPrototypeOf, 'setPrototypeOf');
+ assert.looksNative(setPrototypeOf);
assert.ok('apply' in setPrototypeOf({}, Function.prototype), 'Parent properties in target');
assert.strictEqual(setPrototypeOf({
a: 2
@@ -3208,9 +3187,9 @@
module('ES6');
test('Object#toString', function(assert){
var toString, Class;
- assert.strictEqual(Object.prototype.toString.length, 0, 'arity is 0');
- assert.strictEqual(Object.prototype.toString.name, 'toString', 'name is "toString"');
- assert.ok(/native code/.test(Object.prototype.toString), 'looks like native');
+ assert.arity(Object.prototype.toString, 0);
+ assert.name(Object.prototype.toString, 'toString');
+ assert.looksNative(Object.prototype.toString);
toString = Object.prototype.toString;
if (!function(){
return this;
@@ -3259,39 +3238,36 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, iterator, toString$ = {}.toString;
+ var module, test, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
iterator = Symbol.iterator;
test('Promise', function(assert){
- assert.ok(isFunction(((typeof global != 'undefined' && global !== null) && global || window).Promise), 'is function');
- assert.strictEqual(Promise.length, 1, 'arity is 1');
- assert.strictEqual(Promise.name, 'Promise', 'name is "Promise"');
- return assert.ok(/native code/.test(Promise), 'looks like native');
+ assert.isFunction(Promise);
+ assert.arity(Promise, 1);
+ assert.name(Promise, 'Promise');
+ return assert.looksNative(Promise);
});
test('Promise#then', function(assert){
- assert.ok(isFunction(Promise.prototype.then), 'is function');
- assert.strictEqual(Promise.prototype.then.length, 2, 'arity is 2');
- assert.strictEqual(Promise.prototype.then.name, 'then', 'name is "then"');
- return assert.ok(/native code/.test(Promise.prototype.then), 'looks like native');
+ assert.isFunction(Promise.prototype.then);
+ assert.arity(Promise.prototype.then, 2);
+ assert.name(Promise.prototype.then, 'then');
+ return assert.looksNative(Promise.prototype.then);
});
test('Promise#catch', function(assert){
- assert.ok(isFunction(Promise.prototype['catch']), 'is function');
- assert.strictEqual(Promise.prototype['catch'].length, 1, 'arity is 1');
- return assert.ok(/native code/.test(Promise.prototype.then), 'looks like native');
+ assert.isFunction(Promise.prototype['catch']);
+ assert.arity(Promise.prototype['catch'], 1);
+ return assert.looksNative(Promise.prototype.then);
});
test('Promise#@@toStringTag', function(assert){
return assert.ok(Promise.prototype[Symbol.toStringTag] === 'Promise', 'Promise::@@toStringTag is `Promise`');
});
test('Promise.all', function(assert){
var passed, iter, next, a, done;
- assert.ok(isFunction(Promise.all), 'is function');
- assert.strictEqual(Promise.all.length, 1, 'arity is 1');
- assert.strictEqual(Promise.all.name, 'all', 'name is "all"');
- assert.ok(/native code/.test(Promise.all), 'looks like native');
+ assert.isFunction(Promise.all);
+ assert.arity(Promise.all, 1);
+ assert.name(Promise.all, 'all');
+ assert.looksNative(Promise.all);
passed = false;
iter = [1, 2, 3].values();
next = bind$(iter, 'next');
@@ -3312,10 +3288,10 @@
});
test('Promise.race', function(assert){
var passed, iter, next, a, done;
- assert.ok(isFunction(Promise.race), 'is function');
- assert.strictEqual(Promise.race.length, 1, 'arity is 1');
- assert.strictEqual(Promise.race.name, 'race', 'name is "race"');
- assert.ok(/native code/.test(Promise.race), 'looks like native');
+ assert.isFunction(Promise.race);
+ assert.arity(Promise.race, 1);
+ assert.name(Promise.race, 'race');
+ assert.looksNative(Promise.race);
passed = false;
iter = [1, 2, 3].values();
next = bind$(iter, 'next');
@@ -3335,16 +3311,16 @@
return assert.ok(done);
});
test('Promise.resolve', function(assert){
- assert.ok(isFunction(Promise.resolve), 'is function');
- assert.strictEqual(Promise.resolve.length, 1, 'arity is 1');
- assert.strictEqual(Promise.resolve.name, 'resolve', 'name is "resolve"');
- return assert.ok(/native code/.test(Promise.resolve), 'looks like native');
+ assert.isFunction(Promise.resolve);
+ assert.arity(Promise.resolve, 1);
+ assert.name(Promise.resolve, 'resolve');
+ return assert.looksNative(Promise.resolve);
});
test('Promise.reject', function(assert){
- assert.ok(isFunction(Promise.reject), 'is function');
- assert.strictEqual(Promise.reject.length, 1, 'arity is 1');
- assert.strictEqual(Promise.reject.name, 'reject', 'name is "reject"');
- return assert.ok(/native code/.test(Promise.reject), 'looks like native');
+ assert.isFunction(Promise.reject);
+ assert.arity(Promise.reject, 1);
+ assert.name(Promise.reject, 'reject');
+ return assert.looksNative(Promise.reject);
});
if (Object.setPrototypeOf) {
test('Promise subclassing', function(assert){
@@ -3389,16 +3365,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.apply', function(assert){
var apply, C;
apply = Reflect.apply;
- assert.ok(toString$.call(apply).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(apply.length, 3, 'arity is 3');
- assert.ok(/native code/.test(apply), 'looks like native');
- assert.strictEqual(apply.name, 'apply', 'name is "apply"');
+ assert.isFunction(apply);
+ assert.arity(apply, 3);
+ assert.name(apply, 'apply');
+ assert.looksNative(apply);
assert.strictEqual(apply(Array.prototype.push, [1, 2], [3, 4, 5]), 5);
C = function(a, b, c){
return a + b + c;
@@ -3413,17 +3389,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, getPrototypeOf, toString$ = {}.toString;
+ var module, test, getPrototypeOf;
module = QUnit.module, test = QUnit.test;
module('ES6');
getPrototypeOf = Object.getPrototypeOf;
test('Reflect.construct', function(assert){
var construct, C, inst, f, e;
construct = Reflect.construct;
- assert.ok(toString$.call(construct).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(construct.length, 2, 'arity is 2');
- assert.ok(/native code/.test(construct), 'looks like native');
- assert.strictEqual(construct.name, 'construct', 'name is "construct"');
+ assert.isFunction(construct);
+ assert.arity(construct, 2);
+ assert.name(construct, 'construct');
+ assert.looksNative(construct);
C = function(a, b, c){
return this.qux = a + b + c;
};
@@ -3454,7 +3430,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, getOwnPropertyDescriptor, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, getOwnPropertyDescriptor, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
@@ -3470,10 +3446,10 @@
test('Reflect.defineProperty', function(assert){
var defineProperty, O;
defineProperty = Reflect.defineProperty;
- assert.ok(toString$.call(defineProperty).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(defineProperty.length, 3, 'arity is 3');
- assert.ok(/native code/.test(defineProperty), 'looks like native');
- assert.strictEqual(defineProperty.name, 'defineProperty', 'name is "defineProperty"');
+ assert.isFunction(defineProperty);
+ assert.arity(defineProperty, 3);
+ assert.name(defineProperty, 'defineProperty');
+ assert.looksNative(defineProperty);
O = {};
assert.strictEqual(defineProperty(O, 'foo', {
value: 123
@@ -3505,7 +3481,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty;
@@ -3521,10 +3497,10 @@
test('Reflect.deleteProperty', function(assert){
var deleteProperty, O;
deleteProperty = Reflect.deleteProperty;
- assert.ok(toString$.call(deleteProperty).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(deleteProperty.length, 2, 'arity is 2');
- assert.ok(/native code/.test(deleteProperty), 'looks like native');
- assert.strictEqual(deleteProperty.name, 'deleteProperty', 'name is "deleteProperty"');
+ assert.isFunction(deleteProperty);
+ assert.arity(deleteProperty, 2);
+ assert.name(deleteProperty, 'deleteProperty');
+ assert.looksNative(deleteProperty);
O = {
bar: 456
};
@@ -3548,7 +3524,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, from, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, from, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty;
@@ -3566,10 +3542,10 @@
var enumerate, iterator, obj, i, ref$;
enumerate = Reflect.enumerate;
iterator = Symbol.iterator;
- assert.ok(toString$.call(enumerate).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(enumerate.length, 1, 'arity is 1');
- assert.ok(/native code/.test(enumerate), 'looks like native');
- assert.strictEqual(enumerate.name, 'enumerate', 'name is "enumerate"');
+ assert.isFunction(enumerate);
+ assert.arity(enumerate, 1);
+ assert.name(enumerate, 'enumerate');
+ assert.looksNative(enumerate);
obj = {
foo: 1,
bar: 2
@@ -3603,16 +3579,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.getOwnPropertyDescriptor', function(assert){
var getOwnPropertyDescriptor, obj, desc;
getOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
- assert.ok(toString$.call(getOwnPropertyDescriptor).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getOwnPropertyDescriptor.length, 2, 'arity is 2');
- assert.ok(/native code/.test(getOwnPropertyDescriptor), 'looks like native');
- assert.strictEqual(getOwnPropertyDescriptor.name, 'getOwnPropertyDescriptor', 'name is "getOwnPropertyDescriptor"');
+ assert.isFunction(getOwnPropertyDescriptor);
+ assert.arity(getOwnPropertyDescriptor, 2);
+ assert.name(getOwnPropertyDescriptor, 'getOwnPropertyDescriptor');
+ assert.looksNative(getOwnPropertyDescriptor);
obj = {
baz: 789
};
@@ -3626,16 +3602,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.getPrototypeOf', function(assert){
var getPrototypeOf;
getPrototypeOf = Reflect.getPrototypeOf;
- assert.ok(toString$.call(getPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getPrototypeOf.length, 1, 'arity is 1');
- assert.ok(/native code/.test(getPrototypeOf), 'looks like native');
- assert.strictEqual(getPrototypeOf.name, 'getPrototypeOf', 'name is "getPrototypeOf"');
+ assert.isFunction(getPrototypeOf);
+ assert.arity(getPrototypeOf, 1);
+ assert.name(getPrototypeOf, 'getPrototypeOf');
+ assert.looksNative(getPrototypeOf);
assert.strictEqual(getPrototypeOf([]), Array.prototype);
return assert.throws(function(){
return getPrototypeOf(42);
@@ -3645,7 +3621,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, create, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, create, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, create = Object.create;
@@ -3661,9 +3637,9 @@
test('Reflect.get', function(assert){
var get, target, receiver;
get = Reflect.get;
- assert.ok(toString$.call(get).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(get), 'looks like native');
- assert.strictEqual(get.name, 'get', 'name is "get"');
+ assert.isFunction(get);
+ assert.name(get, 'get');
+ assert.looksNative(get);
assert.strictEqual(get({
qux: 987
}, 'qux'), 987);
@@ -3699,16 +3675,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.has', function(assert){
var has, O;
has = Reflect.has;
- assert.ok(toString$.call(has).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(has.length, 2, 'arity is 2');
- assert.ok(/native code/.test(has), 'looks like native');
- assert.strictEqual(has.name, 'has', 'name is "has"');
+ assert.isFunction(has);
+ assert.arity(has, 2);
+ assert.name(has, 'has');
+ assert.looksNative(has);
O = {
qux: 987
};
@@ -3723,7 +3699,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, preventExtensions, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, preventExtensions, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, preventExtensions = Object.preventExtensions;
@@ -3739,10 +3715,10 @@
test('Reflect.isExtensible', function(assert){
var isExtensible;
isExtensible = Reflect.isExtensible;
- assert.ok(toString$.call(isExtensible).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(isExtensible.length, 1, 'arity is 1');
- assert.ok(/native code/.test(isExtensible), 'looks like native');
- assert.strictEqual(isExtensible.name, 'isExtensible', 'name is "isExtensible"');
+ assert.isFunction(isExtensible);
+ assert.arity(isExtensible, 1);
+ assert.name(isExtensible, 'isExtensible');
+ assert.looksNative(isExtensible);
assert.ok(isExtensible({}));
if (MODERN) {
assert.ok(!isExtensible(preventExtensions({})));
@@ -3755,7 +3731,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, toString$ = {}.toString;
+ var module, test, defineProperty;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty;
@@ -3763,10 +3739,10 @@
var ownKeys, sym, O1, keys, O2;
ownKeys = Reflect.ownKeys;
sym = Symbol('c');
- assert.ok(toString$.call(ownKeys).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(ownKeys.length, 1, 'arity is 1');
- assert.ok(/native code/.test(ownKeys), 'looks like native');
- assert.strictEqual(ownKeys.name, 'ownKeys', 'name is "ownKeys"');
+ assert.isFunction(ownKeys);
+ assert.arity(ownKeys, 1);
+ assert.name(ownKeys, 'ownKeys');
+ assert.looksNative(ownKeys);
O1 = {
a: 1
};
@@ -3799,7 +3775,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, isExtensible, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, isExtensible, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, isExtensible = Object.isExtensible;
@@ -3815,10 +3791,10 @@
test('Reflect.preventExtensions', function(assert){
var preventExtensions, obj;
preventExtensions = Reflect.preventExtensions;
- assert.ok(toString$.call(preventExtensions).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(preventExtensions.length, 1, 'arity is 1');
- assert.ok(/native code/.test(preventExtensions), 'looks like native');
- assert.strictEqual(preventExtensions.name, 'preventExtensions', 'name is "preventExtensions"');
+ assert.isFunction(preventExtensions);
+ assert.arity(preventExtensions, 1);
+ assert.name(preventExtensions, 'preventExtensions');
+ assert.looksNative(preventExtensions);
obj = {};
assert.ok(preventExtensions(obj), true);
if (MODERN) {
@@ -3832,16 +3808,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
if (Object.setPrototypeOf || '__proto__' in {}) {
module = QUnit.module, test = QUnit.test;
module('ES6');
test('Reflect.setPrototypeOf', function(assert){
var setPrototypeOf, obj, o;
setPrototypeOf = Reflect.setPrototypeOf;
- assert.ok(toString$.call(setPrototypeOf).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(setPrototypeOf), 'looks like native');
- assert.strictEqual(setPrototypeOf.name, 'setPrototypeOf', 'name is "setPrototypeOf"');
+ assert.isFunction(setPrototypeOf);
+ assert.name(setPrototypeOf, 'setPrototypeOf');
+ assert.looksNative(setPrototypeOf);
obj = {};
assert.ok(setPrototypeOf(obj, Array.prototype), true);
assert.ok(obj instanceof Array);
@@ -3858,7 +3834,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, getOwnPropertyDescriptor, create, MODERN, toString$ = {}.toString;
+ var module, test, defineProperty, getOwnPropertyDescriptor, create, MODERN;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, create = Object.create;
@@ -3874,9 +3850,9 @@
test('Reflect.set', function(assert){
var set, obj, target, receiver, out;
set = Reflect.set;
- assert.ok(toString$.call(set).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(set), 'looks like native');
- assert.strictEqual(set.name, 'set', 'name is "set"');
+ assert.isFunction(set);
+ assert.name(set, 'set');
+ assert.looksNative(set);
obj = {};
assert.ok(set(obj, 'quux', 654), true);
assert.strictEqual(obj.quux, 654);
@@ -3955,10 +3931,10 @@
}()) {
test('RegExp constructor', function(assert){
var re, O, i$, len$, index, val, results$ = [];
- assert.strictEqual(toString$.call(RegExp).slice(8, -1), 'Function', 'is function');
- assert.strictEqual(RegExp.length, 2, 'arity is 2');
- assert.ok(/native code/.test(RegExp), 'looks like native');
- assert.strictEqual(RegExp.name, 'RegExp', 'name is "RegExp"');
+ assert.isFunction(RegExp);
+ assert.arity(RegExp, 2);
+ assert.name(RegExp, 'RegExp');
+ assert.looksNative(RegExp);
assert.strictEqual(toString$.call(RegExp()).slice(8, -1), 'RegExp');
assert.strictEqual(toString$.call(new RegExp()).slice(8, -1), 'RegExp');
re = /a/g;
@@ -4015,16 +3991,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, global, toString$ = {}.toString;
+ var module, test, global;
module = QUnit.module, test = QUnit.test;
module('ES6');
global = Function('return this')();
test('String#match regression', function(assert){
var instance, matched, expected, obj, str, x, e, reg, string, matches, i$, len$, i, re, num;
- assert.ok(toString$.call(''.match).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.match.length, 1, 'arity is 1');
- assert.ok(/native code/.test(''.match), 'looks like native');
- assert.strictEqual(''.match.name, 'match', 'name is "match"');
+ assert.isFunction(''.match);
+ assert.arity(''.match, 1);
+ assert.name(''.match, 'match');
+ assert.looksNative(''.match);
instance = Object(true);
instance.match = String.prototype.match;
assert.strictEqual(instance.match(true)[0], 'true', 'S15.5.4.10_A1_T1');
@@ -4227,8 +4203,8 @@
});
test('RegExp#@@match', function(assert){
var string, matches, i$, len$, i, results$ = [];
- assert.ok(toString$.call(/./[Symbol.match]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.match].length, 1, 'arity is 1');
+ assert.isFunction(/./[Symbol.match]);
+ assert.arity(/./[Symbol.match], 1);
string = "Boston, MA 02134";
matches = ['02134', '02134', void 8];
assert.strictEqual(/([\d]{5})([-\ ]?[\d]{4})?$/[Symbol.match](string).length, 3);
@@ -4271,15 +4247,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#replace regression', function(assert){
var instance, e;
- assert.ok(toString$.call(''.replace).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.replace.length, 2, 'arity is 2');
- assert.ok(/native code/.test(''.replace), 'looks like native');
- assert.strictEqual(''.replace.name, 'replace', 'name is "replace"');
+ assert.isFunction(''.replace);
+ assert.arity(''.replace, 2);
+ assert.name(''.replace, 'replace');
+ assert.looksNative(''.replace);
instance = Object(true);
instance.replace = String.prototype.replace;
assert.strictEqual(instance.replace(true, 1), '1', 'S15.5.4.11_A1_T1');
@@ -4386,8 +4362,8 @@
return assert.strictEqual('aaaaaaaaaa,aaaaaaaaaaaaaaa'.replace(/^(a+)\1*,\1+$/, '$1'), 'aaaaa', 'S15.5.4.11_A5_T1');
});
test('RegExp#@@replace', function(assert){
- assert.ok(toString$.call(/./[Symbol.replace]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.replace].length, 2, 'arity is 2');
+ assert.isFunction(/./[Symbol.replace]);
+ assert.arity(/./[Symbol.replace], 2);
return assert.strictEqual(/([a-z]+)([0-9]+)/[Symbol.replace]('abc12 def34', function(){
return arguments[2] + arguments[1];
}), '12abc def34');
@@ -4430,15 +4406,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#search regression', function(assert){
var instance, e, aString;
- assert.ok(toString$.call(''.search).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.search.length, 1, 'arity is 1');
- assert.ok(/native code/.test(''.search), 'looks like native');
- assert.strictEqual(''.search.name, 'search', 'name is "search"');
+ assert.isFunction(''.search);
+ assert.arity(''.search, 1);
+ assert.name(''.search, 'search');
+ assert.looksNative(''.search);
instance = Object(true);
instance.search = String.prototype.search;
assert.strictEqual(instance.search(true), 0, 'S15.5.4.12_A1_T1');
@@ -4505,8 +4481,8 @@
return assert.strictEqual(aString.search(/of/), aString.search(/of/g), 'S15.5.4.12_A3_T2');
});
test('RegExp#@@search', function(assert){
- assert.ok(toString$.call(/./[Symbol.search]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.search].length, 1, 'arity is 1');
+ assert.isFunction(/./[Symbol.search]);
+ assert.arity(/./[Symbol.search], 1);
assert.strictEqual(/four/[Symbol.search]('one two three four five'), 14);
return assert.strictEqual(/Four/[Symbol.search]('one two three four five'), -1);
});
@@ -4542,15 +4518,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#split regression', function(assert){
var instance, split, e, string, i$, to$, i, expected, results$ = [];
- assert.ok(toString$.call(''.split).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(''.split.length, 2, 'arity is 2');
- assert.ok(/native code/.test(''.split), 'looks like native');
- assert.strictEqual(''.split.name, 'split', 'name is "split"');
+ assert.isFunction(''.split);
+ assert.arity(''.split, 2);
+ assert.name(''.split, 'split');
+ assert.looksNative(''.split);
instance = Object(true);
instance.split = String.prototype.split;
split = instance.split(true, false);
@@ -5141,8 +5117,8 @@
return results$;
});
test('RegExp#@@split', function(assert){
- assert.ok(toString$.call(/./[Symbol.split]).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(/./[Symbol.split].length, 2, 'arity is 2');
+ assert.isFunction(/./[Symbol.split]);
+ assert.arity(/./[Symbol.split], 2);
assert.strictEqual(/\s/[Symbol.split]('a b c de f').length, 5);
assert.strictEqual(/\s/[Symbol.split]('a b c de f', void 8).length, 5);
assert.strictEqual(/\s/[Symbol.split]('a b c de f', 1).length, 1);
@@ -5186,14 +5162,11 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, same, getOwnPropertyDescriptor, freeze, iterator, toString$ = {}.toString;
+ var module, test, isIterator, same, getOwnPropertyDescriptor, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
same = function(a, b){
if (a === b) {
@@ -5206,10 +5179,10 @@
iterator = Symbol.iterator;
test('Set', function(assert){
var S, r, done, iter, _add, a;
- assert.ok(isFunction(Set), 'is function');
- assert.ok(/native code/.test(Set), 'looks like native');
- assert.strictEqual(Set.name, 'Set', 'name is "Set"');
- assert.strictEqual(Set.length, 0, 'arity is 0');
+ assert.isFunction(Set);
+ assert.name(Set, 'Set');
+ assert.arity(Set, 0);
+ assert.looksNative(Set);
assert.ok('add' in Set.prototype, 'add in Set.prototype');
assert.ok('clear' in Set.prototype, 'clear in Set.prototype');
assert.ok('delete' in Set.prototype, 'delete in Set.prototype');
@@ -5255,10 +5228,10 @@
});
test('Set#add', function(assert){
var a, S, chain, f;
- assert.ok(isFunction(Set.prototype.add), 'is function');
- assert.strictEqual(Set.prototype.add.name, 'add', 'name is "add"');
- assert.strictEqual(Set.prototype.add.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype.add), 'looks like native');
+ assert.isFunction(Set.prototype.add);
+ assert.name(Set.prototype.add, 'add');
+ assert.arity(Set.prototype.add, 1);
+ assert.looksNative(Set.prototype.add);
a = [];
S = new Set([NaN, 2, 3, 2, 1, a]);
assert.strictEqual(S.size, 5);
@@ -5278,10 +5251,10 @@
});
test('Set#clear', function(assert){
var S, f;
- assert.ok(isFunction(Set.prototype.clear), 'is function');
- assert.strictEqual(Set.prototype.clear.name, 'clear', 'name is "clear"');
- assert.strictEqual(Set.prototype.clear.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.clear), 'looks like native');
+ assert.isFunction(Set.prototype.clear);
+ assert.name(Set.prototype.clear, 'clear');
+ assert.arity(Set.prototype.clear, 0);
+ assert.looksNative(Set.prototype.clear);
S = new Set;
S.clear();
assert.strictEqual(S.size, 0);
@@ -5299,9 +5272,9 @@
});
test('Set#delete', function(assert){
var a, S, f;
- assert.ok(isFunction(Set.prototype['delete']), 'is function');
- assert.strictEqual(Set.prototype['delete'].length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype['delete']), 'looks like native');
+ assert.isFunction(Set.prototype['delete']);
+ assert.arity(Set.prototype['delete'], 1);
+ assert.looksNative(Set.prototype['delete']);
a = [];
S = new Set([NaN, 2, 3, 2, 1, a]);
assert.strictEqual(S.size, 5);
@@ -5320,10 +5293,10 @@
});
test('Set#forEach', function(assert){
var r, count, S, set, s;
- assert.ok(isFunction(Set.prototype.forEach), 'is function');
- assert.strictEqual(Set.prototype.forEach.name, 'forEach', 'name is "forEach"');
- assert.strictEqual(Set.prototype.forEach.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype.forEach), 'looks like native');
+ assert.isFunction(Set.prototype.forEach);
+ assert.name(Set.prototype.forEach, 'forEach');
+ assert.arity(Set.prototype.forEach, 1);
+ assert.looksNative(Set.prototype.forEach);
r = [];
count = 0;
S = new Set([1, 2, 3, 2, 1]);
@@ -5358,10 +5331,10 @@
});
test('Set#has', function(assert){
var a, f, S;
- assert.ok(isFunction(Set.prototype.has), 'is function');
- assert.strictEqual(Set.prototype.has.name, 'has', 'name is "has"');
- assert.strictEqual(Set.prototype.has.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Set.prototype.has), 'looks like native');
+ assert.isFunction(Set.prototype.has);
+ assert.name(Set.prototype.has, 'has');
+ assert.arity(Set.prototype.has, 1);
+ assert.looksNative(Set.prototype.has);
a = [];
f = freeze({});
S = new Set([NaN, 2, 3, 2, 1, f, a]);
@@ -5434,9 +5407,9 @@
test('Set#keys', function(assert){
var iter;
assert.ok(typeof Set.prototype.keys === 'function', 'is function');
- assert.strictEqual(Set.prototype.keys.name, 'values', 'name is "values"');
- assert.strictEqual(Set.prototype.keys.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.keys), 'looks like native');
+ assert.name(Set.prototype.keys, 'values');
+ assert.arity(Set.prototype.keys, 0);
+ assert.looksNative(Set.prototype.keys);
assert.strictEqual(Set.prototype.keys, Set.prototype.values);
iter = new Set(['q', 'w', 'e']).keys();
assert.ok(isIterator(iter), 'Return iterator');
@@ -5461,9 +5434,9 @@
test('Set#values', function(assert){
var iter;
assert.ok(typeof Set.prototype.values === 'function', 'is function');
- assert.strictEqual(Set.prototype.values.name, 'values', 'name is "values"');
- assert.strictEqual(Set.prototype.values.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.values), 'looks like native');
+ assert.name(Set.prototype.values, 'values');
+ assert.arity(Set.prototype.values, 0);
+ assert.looksNative(Set.prototype.values);
iter = new Set(['q', 'w', 'e']).values();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -5487,9 +5460,9 @@
test('Set#entries', function(assert){
var iter;
assert.ok(typeof Set.prototype.entries === 'function', 'is function');
- assert.strictEqual(Set.prototype.entries.name, 'entries', 'name is "entries"');
- assert.strictEqual(Set.prototype.entries.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.entries), 'looks like native');
+ assert.name(Set.prototype.entries, 'entries');
+ assert.arity(Set.prototype.entries, 0);
+ assert.looksNative(Set.prototype.entries);
iter = new Set(['q', 'w', 'e']).entries();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'Set Iterator');
@@ -5513,9 +5486,9 @@
test('Set#@@iterator', function(assert){
var iter;
assert.ok(typeof Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8] === 'function', 'is function');
- assert.strictEqual(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8].name, 'values', 'name is "values"');
- assert.strictEqual(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8].length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'looks like native');
+ assert.name(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], 'values');
+ assert.arity(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], 0);
+ assert.looksNative(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
assert.strictEqual(Set.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8], Set.prototype.values);
iter = new Set(['q', 'w', 'e'])[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
@@ -5542,14 +5515,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#codePointAt', function(assert){
- assert.ok(toString$.call(String.prototype.codePointAt).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.codePointAt.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.codePointAt), 'looks like native');
- assert.strictEqual(String.prototype.codePointAt.name, 'codePointAt', 'name is "codePointAt"');
+ assert.isFunction(String.prototype.codePointAt);
+ assert.arity(String.prototype.codePointAt, 1);
+ assert.name(String.prototype.codePointAt, 'codePointAt');
+ assert.looksNative(String.prototype.codePointAt);
assert.strictEqual('abc\uD834\uDF06def'.codePointAt(''), 0x61);
assert.strictEqual('abc\uD834\uDF06def'.codePointAt('_'), 0x61);
assert.strictEqual('abc\uD834\uDF06def'.codePointAt(), 0x61);
@@ -5615,15 +5588,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#endsWith', function(assert){
var re, e, O;
- assert.ok(toString$.call(String.prototype.endsWith).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.endsWith.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.endsWith), 'looks like native');
- assert.strictEqual(String.prototype.endsWith.name, 'endsWith', 'name is "endsWith"');
+ assert.isFunction(String.prototype.endsWith);
+ assert.arity(String.prototype.endsWith, 1);
+ assert.name(String.prototype.endsWith, 'endsWith');
+ assert.looksNative(String.prototype.endsWith);
assert.ok('undefined'.endsWith());
assert.ok(!'undefined'.endsWith(null));
assert.ok('abc'.endsWith(''));
@@ -5678,16 +5651,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String.fromCodePoint', function(assert){
var fromCodePoint, tmp, counter, result;
fromCodePoint = String.fromCodePoint;
- assert.ok(toString$.call(fromCodePoint).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(fromCodePoint.length, 1, 'arity is 1');
- assert.ok(/native code/.test(fromCodePoint), 'looks like native');
- assert.strictEqual(fromCodePoint.name, 'fromCodePoint', 'name is "fromCodePoint"');
+ assert.isFunction(fromCodePoint);
+ assert.arity(fromCodePoint, 1);
+ assert.name(fromCodePoint, 'fromCodePoint');
+ assert.looksNative(fromCodePoint);
assert.strictEqual(fromCodePoint(''), '\0');
assert.strictEqual(fromCodePoint(), '');
assert.strictEqual(fromCodePoint(-0), '\0');
@@ -5761,15 +5734,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#includes', function(assert){
var re, e, O;
- assert.ok(toString$.call(String.prototype.includes).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.includes.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.includes), 'looks like native');
- assert.strictEqual(String.prototype.includes.name, 'includes', 'name is "includes"');
+ assert.isFunction(String.prototype.includes);
+ assert.arity(String.prototype.includes, 1);
+ assert.name(String.prototype.includes, 'includes');
+ assert.looksNative(String.prototype.includes);
assert.ok(!'abc'.includes());
assert.ok('aundefinedb'.includes());
assert.ok('abcd'.includes('b', 1));
@@ -5815,18 +5788,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, isIterator, toString$ = {}.toString;
+ var module, test, isIterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
isIterator = function(it){
- return typeof it === 'object' && isFunction(it.next);
+ return typeof it === 'object' && typeof it.next === 'function';
};
test('String#@@iterator', function(assert){
var iter;
- assert.ok(isFunction(String.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]), 'is function');
+ assert.isFunction(String.prototype[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]);
iter = 'qwe'[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.iterator : void 8]();
assert.ok(isIterator(iter), 'Return iterator');
assert.strictEqual(iter[typeof Symbol != 'undefined' && Symbol !== null ? Symbol.toStringTag : void 8], 'String Iterator');
@@ -5869,16 +5839,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String.raw', function(assert){
var raw;
raw = String.raw;
- assert.ok(toString$.call(raw).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(raw.length, 1, 'arity is 1');
- assert.ok(/native code/.test(raw), 'looks like native');
- assert.strictEqual(raw.name, 'raw', 'name is "raw"');
+ assert.isFunction(raw);
+ assert.arity(raw, 1);
+ assert.name(raw, 'raw');
+ assert.looksNative(raw);
assert.strictEqual(raw({
raw: ['Hi\\n', '!']
}, 'Bob'), 'Hi\\nBob!', 'raw is array');
@@ -5902,14 +5872,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#repeat', function(assert){
- assert.ok(toString$.call(String.prototype.repeat).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.repeat.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.repeat), 'looks like native');
- assert.strictEqual(String.prototype.repeat.name, 'repeat', 'name is "repeat"');
+ assert.isFunction(String.prototype.repeat);
+ assert.arity(String.prototype.repeat, 1);
+ assert.name(String.prototype.repeat, 'repeat');
+ assert.looksNative(String.prototype.repeat);
assert.strictEqual('qwe'.repeat(3), 'qweqweqwe');
assert.strictEqual('qwe'.repeat(2.5), 'qweqwe');
assert.throws(function(){
@@ -5934,15 +5904,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#startsWith', function(assert){
var re, e, O;
- assert.ok(toString$.call(String.prototype.startsWith).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.startsWith.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.startsWith), 'looks like native');
- assert.strictEqual(String.prototype.startsWith.name, 'startsWith', 'name is "startsWith"');
+ assert.isFunction(String.prototype.startsWith);
+ assert.arity(String.prototype.startsWith, 1);
+ assert.name(String.prototype.startsWith, 'startsWith');
+ assert.looksNative(String.prototype.startsWith);
assert.ok('undefined'.startsWith());
assert.ok(!'undefined'.startsWith(null));
assert.ok('abc'.startsWith(''));
@@ -5997,14 +5967,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES6');
test('String#trim', function(assert){
- assert.ok(toString$.call(''.trim).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.trim.length, 0, 'arity is 0');
- assert.ok(/native code/.test(String.prototype.trim), 'looks like native');
- assert.strictEqual(String.prototype.trim.name, 'trim', 'name is "trim"');
+ assert.isFunction(''.trim);
+ assert.arity(String.prototype.trim, 0);
+ assert.name(String.prototype.trim, 'trim');
+ assert.looksNative(String.prototype.trim);
assert.strictEqual(' \n q w e \n '.trim(), 'q w e', 'removes whitespaces at left & right side of string');
assert.strictEqual('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'.trim(), '', 'removes all whitespaces');
assert.strictEqual('\u200b\u0085'.trim(), '\u200b\u0085', "shouldn't remove this symbols");
@@ -6023,16 +5993,10 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, defineProperty, getOwnPropertyDescriptor, create, isFunction, isNative, descriptors, G, i$, ref$, len$, key, toString$ = {}.toString;
+ var module, test, defineProperty, getOwnPropertyDescriptor, create, descriptors, G, i$, ref$, len$, key;
module = QUnit.module, test = QUnit.test;
module('ES6');
defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, create = Object.create;
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
- isNative = function(it){
- return /\[native code\]\s*\}\s*$/.test(it);
- };
descriptors = function(){
try {
return 2 === Object.defineProperty({}, 'a', {
@@ -6045,9 +6009,9 @@
G = (typeof global != 'undefined' && global !== null) && global || window;
test('Symbol', function(assert){
var s1, s2, O, count, i;
- assert.ok(isFunction(Symbol), 'is function');
- assert.strictEqual(Symbol.name, 'Symbol', 'name is "Symbol"');
- assert.ok(/native code/.test(Symbol), 'looks like native');
+ assert.isFunction(Symbol);
+ assert.name(Symbol, 'Symbol');
+ assert.looksNative(Symbol);
s1 = Symbol('foo');
s2 = Symbol('foo');
assert.ok(s1 !== s2, 'Symbol("foo") !== Symbol("foo")');
@@ -6074,10 +6038,10 @@
});
test('Global symbol registry', function(assert){
var symbol;
- assert.ok(isFunction(Symbol['for']), 'Symbol.for is function');
+ assert.isFunction(Symbol['for'], 'Symbol.for is function');
assert.strictEqual(Symbol['for'].length, 1, 'Symbol.for arity is 1');
assert.ok(/native code/.test(Symbol['for']), 'Symbol.for looks like native');
- assert.ok(isFunction(Symbol.keyFor), 'Symbol.keyFor is function');
+ assert.isFunction(Symbol.keyFor, 'Symbol.keyFor is function');
assert.strictEqual(Symbol.keyFor.length, 1, 'Symbol.keyFor arity is 1');
assert.strictEqual(Symbol.keyFor.name, 'keyFor', 'Symbol.keyFor.name is "keyFor"');
assert.ok(/native code/.test(Symbol.keyFor), 'Symbol.keyFor looks like native');
@@ -6091,10 +6055,10 @@
test('Object.getOwnPropertySymbols', function(assert){
var getOwnPropertySymbols, getOwnPropertyNames, obj, foo, ref$;
getOwnPropertySymbols = Object.getOwnPropertySymbols, getOwnPropertyNames = Object.getOwnPropertyNames;
- assert.ok(isFunction(getOwnPropertySymbols), 'is function');
+ assert.isFunction(getOwnPropertySymbols);
assert.strictEqual(getOwnPropertySymbols.length, 1, 'arity is 1');
- assert.strictEqual(getOwnPropertySymbols.name, 'getOwnPropertySymbols', 'name is "getOwnPropertySymbols"');
- assert.ok(/native code/.test(getOwnPropertySymbols), 'looks like native');
+ assert.name(getOwnPropertySymbols, 'getOwnPropertySymbols');
+ assert.looksNative(getOwnPropertySymbols);
obj = {
q: 1,
w: 2,
@@ -6304,20 +6268,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, freeze, iterator, toString$ = {}.toString;
+ var module, test, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
freeze = Object.freeze;
iterator = Symbol.iterator;
test('WeakMap', function(assert){
var a, b, f, M, done, iter;
- assert.ok(isFunction(WeakMap), 'is function');
- assert.ok(/native code/.test(WeakMap), 'looks like native');
- assert.strictEqual(WeakMap.name, 'WeakMap', 'name is "WeakMap"');
- assert.strictEqual(WeakMap.length, 0, 'arity is 0');
+ assert.isFunction(WeakMap);
+ assert.name(WeakMap, 'WeakMap');
+ assert.arity(WeakMap, 0);
+ assert.looksNative(WeakMap);
assert.ok('delete' in WeakMap.prototype, 'delete in WeakMap.prototype');
assert.ok('get' in WeakMap.prototype, 'get in WeakMap.prototype');
assert.ok('has' in WeakMap.prototype, 'has in WeakMap.prototype');
@@ -6354,8 +6315,8 @@
});
test('WeakMap#delete', function(assert){
var M, a, b;
- assert.ok(isFunction(WeakMap.prototype['delete']), 'is function');
- assert.ok(/native code/.test(WeakMap.prototype['delete']), 'looks like native');
+ assert.isFunction(WeakMap.prototype['delete']);
+ assert.looksNative(WeakMap.prototype['delete']);
M = new WeakMap().set(a = {}, 42).set(b = {}, 21);
assert.ok(M.has(a) && M.has(b), 'WeakMap has values before .delete()');
M['delete'](a);
@@ -6363,9 +6324,9 @@
});
test('WeakMap#get', function(assert){
var M, a;
- assert.ok(isFunction(WeakMap.prototype.get), 'is function');
- assert.strictEqual(WeakMap.prototype.get.name, 'get', 'name is "get"');
- assert.ok(/native code/.test(WeakMap.prototype.get), 'looks like native');
+ assert.isFunction(WeakMap.prototype.get);
+ assert.name(WeakMap.prototype.get, 'get');
+ assert.looksNative(WeakMap.prototype.get);
M = new WeakMap();
assert.strictEqual(M.get({}), void 8, 'WeakMap .get() before .set() return undefined');
M.set(a = {}, 42);
@@ -6375,9 +6336,9 @@
});
test('WeakMap#has', function(assert){
var M, a;
- assert.ok(isFunction(WeakMap.prototype.has), 'is function');
- assert.strictEqual(WeakMap.prototype.has.name, 'has', 'name is "has"');
- assert.ok(/native code/.test(WeakMap.prototype.has), 'looks like native');
+ assert.isFunction(WeakMap.prototype.has);
+ assert.name(WeakMap.prototype.has, 'has');
+ assert.looksNative(WeakMap.prototype.has);
M = new WeakMap();
assert.ok(!M.has({}), 'WeakMap .has() before .set() return false');
M.set(a = {}, 42);
@@ -6387,10 +6348,10 @@
});
test('WeakMap#set', function(assert){
var a, e;
- assert.ok(isFunction(WeakMap.prototype.set), 'is function');
- assert.strictEqual(WeakMap.prototype.set.name, 'set', 'name is "set"');
- assert.strictEqual(WeakMap.prototype.set.length, 2, 'arity is 2');
- assert.ok(/native code/.test(WeakMap.prototype.set), 'looks like native');
+ assert.isFunction(WeakMap.prototype.set);
+ assert.name(WeakMap.prototype.set, 'set');
+ assert.arity(WeakMap.prototype.set, 2);
+ assert.looksNative(WeakMap.prototype.set);
assert.ok(new WeakMap().set(a = {}, 42), 'WeakMap.prototype.set works with object as keys');
return assert.ok((function(){
try {
@@ -6409,20 +6370,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, freeze, iterator, toString$ = {}.toString;
+ var module, test, freeze, iterator;
module = QUnit.module, test = QUnit.test;
module('ES6');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
freeze = Object.freeze;
iterator = Symbol.iterator;
test('WeakSet', function(assert){
var a, f, S, done, iter;
- assert.ok(isFunction(WeakSet), 'is function');
- assert.ok(/native code/.test(WeakSet), 'looks like native');
- assert.strictEqual(WeakSet.name, 'WeakSet', 'name is "WeakSet"');
- assert.strictEqual(WeakSet.length, 0, 'arity is 0');
+ assert.isFunction(WeakSet);
+ assert.name(WeakSet, 'WeakSet');
+ assert.arity(WeakSet, 0);
+ assert.looksNative(WeakSet);
assert.ok('add' in WeakSet.prototype, 'add in WeakSet.prototype');
assert.ok('delete' in WeakSet.prototype, 'delete in WeakSet.prototype');
assert.ok('has' in WeakSet.prototype, 'has in WeakSet.prototype');
@@ -6456,10 +6414,10 @@
});
test('WeakSet#add', function(assert){
var a, e;
- assert.ok(isFunction(WeakSet.prototype.add), 'is function');
- assert.strictEqual(WeakSet.prototype.add.name, 'add', 'name is "add"');
- assert.strictEqual(WeakSet.prototype.add.length, 1, 'arity is 1');
- assert.ok(/native code/.test(WeakSet.prototype.add), 'looks like native');
+ assert.isFunction(WeakSet.prototype.add);
+ assert.name(WeakSet.prototype.add, 'add');
+ assert.arity(WeakSet.prototype.add, 1);
+ assert.looksNative(WeakSet.prototype.add);
assert.ok(new WeakSet().add(a = {}), 'WeakSet.prototype.add works with object as keys');
return assert.ok((function(){
try {
@@ -6473,9 +6431,9 @@
});
test('WeakSet#delete', function(assert){
var S, a, b;
- assert.ok(isFunction(WeakSet.prototype['delete']), 'is function');
- assert.strictEqual(WeakSet.prototype['delete'].length, 1, 'arity is 1');
- assert.ok(/native code/.test(WeakSet.prototype['delete']), 'looks like native');
+ assert.isFunction(WeakSet.prototype['delete']);
+ assert.arity(WeakSet.prototype['delete'], 1);
+ assert.looksNative(WeakSet.prototype['delete']);
S = new WeakSet().add(a = {}).add(b = {});
assert.ok(S.has(a) && S.has(b), 'WeakSet has values before .delete()');
S['delete'](a);
@@ -6483,10 +6441,10 @@
});
test('WeakSet#has', function(assert){
var M, a;
- assert.ok(isFunction(WeakSet.prototype.has), 'is function');
- assert.strictEqual(WeakSet.prototype.has.name, 'has', 'name is "has"');
- assert.strictEqual(WeakSet.prototype.has.length, 1, 'arity is 1');
- assert.ok(/native code/.test(WeakSet.prototype.has), 'looks like native');
+ assert.isFunction(WeakSet.prototype.has);
+ assert.name(WeakSet.prototype.has, 'has');
+ assert.arity(WeakSet.prototype.has, 1);
+ assert.looksNative(WeakSet.prototype.has);
M = new WeakSet();
assert.ok(!M.has({}), 'WeakSet has`nt value');
M.add(a = {});
@@ -6502,15 +6460,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Array#includes', function(assert){
var arr, o;
- assert.ok(toString$.call(Array.prototype.includes).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Array.prototype.includes.name, 'includes', 'name is "includes"');
- assert.strictEqual(Array.prototype.includes.length, 1, 'arity is 1');
- assert.ok(/native code/.test(Array.prototype.includes), 'looks like native');
+ assert.isFunction(Array.prototype.includes);
+ assert.name(Array.prototype.includes, 'includes');
+ assert.arity(Array.prototype.includes, 1);
+ assert.looksNative(Array.prototype.includes);
arr = [1, 2, 3, -0, o = {}];
assert.ok(arr.includes(1));
assert.ok(arr.includes(-0));
@@ -6537,14 +6495,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Map#toJSON', function(assert){
- assert.ok(toString$.call(Map.prototype.toJSON).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Map.prototype.toJSON.name, 'toJSON', 'name is "toJSON"');
- assert.strictEqual(Map.prototype.toJSON.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Map.prototype.toJSON), 'looks like native');
+ assert.isFunction(Map.prototype.toJSON);
+ assert.name(Map.prototype.toJSON, 'toJSON');
+ assert.arity(Map.prototype.toJSON, 0);
+ assert.looksNative(Map.prototype.toJSON);
if (typeof JSON != 'undefined' && JSON !== null) {
return assert.strictEqual(JSON.stringify(new Map([['a', 'b'], ['c', 'd']])), '[["a","b"],["c","d"]]', 'Works');
}
@@ -6553,16 +6511,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Object.entries', function(assert){
var entries, create, assign;
entries = Object.entries, create = Object.create, assign = Object.assign;
- assert.ok(toString$.call(entries).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(entries), 'looks like native');
- assert.strictEqual(entries.length, 1, 'arity is 1');
- assert.strictEqual(entries.name, 'entries', 'name is "entries"');
+ assert.isFunction(entries);
+ assert.arity(entries, 1);
+ assert.name(entries, 'entries');
+ assert.looksNative(entries);
assert.deepEqual(entries({
q: 1,
w: 2,
@@ -6586,7 +6544,7 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, descriptors, create, toString$ = {}.toString;
+ var module, test, descriptors, create;
module = QUnit.module, test = QUnit.test;
module('ES7');
descriptors = function(){
@@ -6602,10 +6560,10 @@
test('Object.getOwnPropertyDescriptors', function(assert){
var getOwnPropertyDescriptors, O, s, descs;
getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
- assert.ok(toString$.call(getOwnPropertyDescriptors).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(getOwnPropertyDescriptors.length, 1, 'arity is 1');
- assert.strictEqual(getOwnPropertyDescriptors.name, 'getOwnPropertyDescriptors', 'name is "getOwnPropertyDescriptors"');
- assert.ok(/native code/.test(getOwnPropertyDescriptors), 'looks like native');
+ assert.isFunction(getOwnPropertyDescriptors);
+ assert.arity(getOwnPropertyDescriptors, 1);
+ assert.name(getOwnPropertyDescriptors, 'getOwnPropertyDescriptors');
+ assert.looksNative(getOwnPropertyDescriptors);
O = create({
q: 1
}, {
@@ -6645,16 +6603,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Object.values', function(assert){
var values, create, assign;
values = Object.values, create = Object.create, assign = Object.assign;
- assert.ok(toString$.call(values).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(values), 'looks like native');
- assert.strictEqual(values.length, 1, 'arity is 1');
- assert.strictEqual(values.name, 'values', 'name is "values"');
+ assert.isFunction(values);
+ assert.arity(values, 1);
+ assert.name(values, 'values');
+ assert.looksNative(values);
assert.deepEqual(values({
q: 1,
w: 2,
@@ -6678,16 +6636,16 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('RegExp.escape', function(assert){
var escape;
escape = RegExp.escape;
- assert.ok(toString$.call(escape).slice(8, -1) === 'Function', 'is function');
- assert.ok(/native code/.test(escape), 'looks like native');
- assert.strictEqual(escape.length, 1, 'arity is 1');
- assert.strictEqual(escape.name, 'escape', 'name is "escape"');
+ assert.isFunction(escape);
+ assert.arity(escape, 1);
+ assert.name(escape, 'escape');
+ assert.looksNative(escape);
assert.strictEqual(escape('qwe asd'), 'qwe asd', "Don't change simple string");
return assert.strictEqual(escape('\\[]{}()*+?.^$|'), '\\\\\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\^\\$\\|', 'Escape all RegExp special chars');
});
@@ -6695,14 +6653,14 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('Set#toJSON', function(assert){
- assert.ok(toString$.call(Set.prototype.toJSON).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(Set.prototype.toJSON.name, 'toJSON', 'name is "toJSON"');
- assert.strictEqual(Set.prototype.toJSON.length, 0, 'arity is 0');
- assert.ok(/native code/.test(Set.prototype.toJSON), 'looks like native');
+ assert.isFunction(Set.prototype.toJSON);
+ assert.name(Set.prototype.toJSON, 'toJSON');
+ assert.arity(Set.prototype.toJSON, 0);
+ assert.looksNative(Set.prototype.toJSON);
if (typeof JSON != 'undefined' && JSON !== null) {
return assert.strictEqual(JSON.stringify(new Set([1, 2, 3, 2, 1])), '[1,2,3]', 'Works');
}
@@ -6712,15 +6670,15 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#at', function(assert){
var at;
- assert.ok(toString$.call(String.prototype.at).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.at.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.at), 'looks like native');
- assert.strictEqual(String.prototype.at.name, 'at', 'name is "at"');
+ assert.isFunction(String.prototype.at);
+ assert.arity(String.prototype.at, 1);
+ assert.name(String.prototype.at, 'at');
+ assert.looksNative(String.prototype.at);
assert.strictEqual('abc\uD834\uDF06def'.at(-Infinity), '');
assert.strictEqual('abc\uD834\uDF06def'.at(-1), '');
assert.strictEqual('abc\uD834\uDF06def'.at(-0), 'a');
@@ -6817,14 +6775,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#padLeft', function(assert){
- assert.ok(toString$.call(String.prototype.padLeft).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.padLeft.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.padLeft), 'looks like native');
- assert.strictEqual(String.prototype.padLeft.name, 'padLeft', 'name is "padLeft"');
+ assert.isFunction(String.prototype.padLeft);
+ assert.arity(String.prototype.padLeft, 1);
+ assert.name(String.prototype.padLeft, 'padLeft');
+ assert.looksNative(String.prototype.padLeft);
assert.strictEqual('abc'.padLeft(5), ' abc');
assert.strictEqual('abc'.padLeft(4, 'de'), 'dabc');
assert.strictEqual('abc'.padLeft(), 'abc');
@@ -6847,14 +6805,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#padRight', function(assert){
- assert.ok(toString$.call(String.prototype.padRight).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.padRight.length, 1, 'arity is 1');
- assert.ok(/native code/.test(String.prototype.padRight), 'looks like native');
- assert.strictEqual(String.prototype.padRight.name, 'padRight', 'name is "padRight"');
+ assert.isFunction(String.prototype.padRight);
+ assert.arity(String.prototype.padRight, 1);
+ assert.name(String.prototype.padRight, 'padRight');
+ assert.looksNative(String.prototype.padRight);
assert.strictEqual('abc'.padRight(5), 'abc ');
assert.strictEqual('abc'.padRight(4, 'de'), 'abcd');
assert.strictEqual('abc'.padRight(), 'abc');
@@ -6877,14 +6835,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#trimLeft', function(assert){
- assert.ok(toString$.call(''.trimLeft).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.trimLeft.length, 0, 'arity is 0');
- assert.ok(/native code/.test(String.prototype.trimLeft), 'looks like native');
- assert.strictEqual(String.prototype.trimLeft.name, 'trimLeft', 'name is "trimLeft"');
+ assert.isFunction(''.trimLeft);
+ assert.arity(String.prototype.trimLeft, 0);
+ assert.name(String.prototype.trimLeft, 'trimLeft');
+ assert.looksNative(String.prototype.trimLeft);
assert.strictEqual(' \n q w e \n '.trimLeft(), 'q w e \n ', 'removes whitespaces at left side of string');
assert.strictEqual('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'.trimLeft(), '', 'removes all whitespaces');
assert.strictEqual('\u200b\u0085'.trimLeft(), '\u200b\u0085', "shouldn't remove this symbols");
@@ -6904,14 +6862,14 @@
// Generated by LiveScript 1.3.1
(function(){
'use strict';
- var module, test, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('ES7');
test('String#trimRight', function(assert){
- assert.ok(toString$.call(''.trimRight).slice(8, -1) === 'Function', 'is function');
- assert.strictEqual(String.prototype.trimRight.length, 0, 'arity is 0');
- assert.ok(/native code/.test(String.prototype.trimRight), 'looks like native');
- assert.strictEqual(String.prototype.trimRight.name, 'trimRight', 'name is "trimRight"');
+ assert.isFunction(''.trimRight);
+ assert.arity(String.prototype.trimRight, 0);
+ assert.name(String.prototype.trimRight, 'trimRight');
+ assert.looksNative(String.prototype.trimRight);
assert.strictEqual(' \n q w e \n '.trimRight(), ' \n q w e', 'removes whitespaces at right side of string');
assert.strictEqual('\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'.trimRight(), '', 'removes all whitespaces');
assert.strictEqual('\u200b\u0085'.trimRight(), '\u200b\u0085', "shouldn't remove this symbols");
@@ -6930,18 +6888,15 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, slice, toString$ = {}.toString;
+ var module, test, slice, toString$ = {}.toString;
module = QUnit.module, test = QUnit.test;
module('Mozilla JavaScript Array statics');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
slice = Array.prototype.slice;
test('are functions', function(assert){
var i$, x$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = ['concat', 'join', 'pop', 'push', 'reverse', 'shift', 'slice', 'sort', 'splice', 'unshift', 'indexOf', 'lastIndexOf', 'every', 'some', 'forEach', 'map', 'filter', 'reduce', 'reduceRight', 'copyWithin', 'fill', 'find', 'findIndex', 'keys', 'values', 'entries', 'includes']).length; i$ < len$; ++i$) {
x$ = ref$[i$];
- results$.push(assert.ok(isFunction(Array[x$]), "Array." + x$ + " is function"));
+ results$.push(assert.isFunction(Array[x$], "Array." + x$ + " is function"));
}
return results$;
});
@@ -7377,7 +7332,6 @@
test('.keys', function(assert){
var keys, iter1, iter2;
keys = Array.keys;
- assert.ok(typeof keys === 'function', 'is function');
iter1 = keys(function(){
return arguments;
}('q', 'w', 'e'));
@@ -7420,7 +7374,6 @@
test('.values', function(assert){
var values, iter1, iter2;
values = Array.values;
- assert.ok(typeof values === 'function', 'is function');
iter1 = values(function(){
return arguments;
}('q', 'w', 'e'));
@@ -7463,7 +7416,6 @@
test('.entries', function(assert){
var entries, iter1, iter2;
entries = Array.entries;
- assert.ok(typeof entries === 'function', 'is function');
iter1 = entries(function(){
return arguments;
}('q', 'w', 'e'));
@@ -7506,7 +7458,6 @@
test('.includes', function(assert){
var includes, args, o, str;
includes = Array.includes;
- assert.ok(isFunction(includes), 'is function');
args = function(){
return arguments;
}(1, 2, 3, -0, NaN, o = {});
@@ -7526,20 +7477,17 @@
// Generated by LiveScript 1.3.1
(function(){
- var module, test, isFunction, toString$ = {}.toString;
+ var module, test;
module = QUnit.module, test = QUnit.test;
module('DOM iterable');
- isFunction = function(it){
- return toString$.call(it).slice(8, -1) === 'Function';
- };
if ((typeof NodeList != 'undefined' && NodeList !== null) && ((typeof document != 'undefined' && document !== null) && document.querySelectorAll) && document.querySelectorAll('div') instanceof NodeList) {
test('NodeList.prototype@@iterator', function(assert){
- return assert.ok(isFunction(document.querySelectorAll('div')[Symbol.iterator]), 'is function');
+ return assert.isFunction(document.querySelectorAll('div')[Symbol.iterator]);
});
}
if ((typeof HTMLCollection != 'undefined' && HTMLCollection !== null) && ((typeof document != 'undefined' && document !== null) && document.getElementsByTagName) && document.getElementsByTagName('div') instanceof HTMLCollection) {
test('HTMLCollection.prototype@@iterator', function(assert){
- return assert.ok(isFunction(document.getElementsByTagName('div')[Symbol.iterator]), 'is function');
+ return assert.isFunction(document.getElementsByTagName('div')[Symbol.iterator]);
});
}
}).call(this);
diff --git a/tests/tests/core.delay.ls b/tests/tests/core.delay.ls
index 1574aedc36e5..a335c94c651a 100644
--- a/tests/tests/core.delay.ls
+++ b/tests/tests/core.delay.ls
@@ -5,10 +5,10 @@ timeLimitedPromise = (time, fn)-> Promise.race [new Promise(fn), new Promise (re
test 'delay' (assert)->
assert.expect 6
- assert.ok typeof! delay is \Function, 'is function'
- assert.strictEqual delay.length, 1, 'arity is 1'
- assert.strictEqual delay.name, \delay, 'name is "delay"'
- assert.ok /native code/.test(delay), 'looks like native'
+ assert.isFunction delay
+ assert.arity delay, 1
+ assert.name delay, \delay
+ assert.looksNative delay
assert.ok delay(42) instanceof Promise, 'returns promises'
timeLimitedPromise(1e3, !(res)-> delay(10).then !-> res it)
diff --git a/tests/tests/core.dict.ls b/tests/tests/core.dict.ls
index a55ed3ef67f8..c0ecd1f44e24 100644
--- a/tests/tests/core.dict.ls
+++ b/tests/tests/core.dict.ls
@@ -1,16 +1,15 @@
{module, test} = QUnit
module \core-js
-isFunction = -> typeof! it is \Function
{keys, create, assign} = Object
{from} = Array
global = @
test 'Dict' (assert)->
- assert.ok isFunction(global.Dict), 'is function'
- assert.strictEqual Dict.length, 1, 'arity is 1'
- assert.strictEqual Dict.name, \Dict, 'name is "Dict"'
- assert.ok /native code/.test(Dict), 'looks like native'
+ assert.isFunction Dict
+ assert.arity Dict, 1
+ assert.name Dict, \Dict
+ assert.looksNative Dict
dict1 = Dict!
assert.ok dict1 not instanceof Object
assert.deepEqual keys(dict1), []
@@ -33,7 +32,7 @@ test 'Dict' (assert)->
test 'Dict.every' (assert)->
{every} = Dict
- assert.ok isFunction(every), 'is function'
+ assert.isFunction every
every obj = {q: 1} (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -45,7 +44,7 @@ test 'Dict.every' (assert)->
test 'Dict.filter' (assert)->
{filter} = Dict
- assert.ok isFunction(filter), 'is function'
+ assert.isFunction filter
filter obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -56,7 +55,7 @@ test 'Dict.filter' (assert)->
test 'Dict.find' (assert)->
{find} = Dict
- assert.ok isFunction(find), 'is function'
+ assert.isFunction find
find obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -67,7 +66,7 @@ test 'Dict.find' (assert)->
test 'Dict.findKey' (assert)->
{findKey} = Dict
- assert.ok isFunction(findKey), 'is function'
+ assert.isFunction findKey
findKey obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -78,7 +77,7 @@ test 'Dict.findKey' (assert)->
test 'Dict.forEach' (assert)->
{forEach} = Dict
- assert.ok isFunction(forEach), 'is function'
+ assert.isFunction forEach
forEach obj = {q: 1}, (val, key, that)!->
assert.ok val is 1
assert.ok key is \q
@@ -103,14 +102,14 @@ test 'Dict.forEach' (assert)->
test 'Dict.keyOf' (assert)->
{keyOf} = Dict
- assert.ok isFunction(keyOf), 'is function'
+ assert.isFunction keyOf
assert.ok keyOf({q:1 w:2 e:3} 2) is \w
assert.ok keyOf({q:1 w:2 e:3} 4) is void
assert.ok keyOf({q:1 w:2 e:NaN} NaN) is void
test 'Dict.map' (assert)->
{map} = Dict
- assert.ok isFunction(map), 'is function'
+ assert.isFunction map
map obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -121,7 +120,7 @@ test 'Dict.map' (assert)->
test 'Dict.mapPairs' (assert)->
{mapPairs} = Dict
- assert.ok isFunction(mapPairs), 'is function'
+ assert.isFunction mapPairs
mapPairs obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -132,7 +131,7 @@ test 'Dict.mapPairs' (assert)->
test 'Dict.reduce' (assert)->
{reduce} = Dict
- assert.ok isFunction(reduce), 'is function'
+ assert.isFunction reduce
reduce (obj = a:1), (memo, val, key, that)->
assert.ok memo is foo
assert.ok val is 1
@@ -151,7 +150,7 @@ test 'Dict.reduce' (assert)->
test 'Dict.some' (assert)->
{some} = Dict
- assert.ok isFunction(some), 'is function'
+ assert.isFunction some
some obj = {q: 1}, (val, key, that)->
assert.ok val is 1
assert.ok key is \q
@@ -163,7 +162,7 @@ test 'Dict.some' (assert)->
test 'Dict.includes' (assert)->
{includes} = Dict
- assert.ok isFunction(includes), 'is function'
+ assert.isFunction includes
dict = {q:1, w: NaN, e: -0, r: o = {}}
assert.ok includes dict, 1
assert.ok includes dict, -0
@@ -176,7 +175,7 @@ test 'Dict.includes' (assert)->
test 'Dict.has' (assert)->
{has} = Dict
- assert.ok isFunction(has), 'is function'
+ assert.isFunction has
assert.ok has q:1, \q
assert.ok not has q:1, \w
assert.ok has [1] 0
@@ -186,7 +185,7 @@ test 'Dict.has' (assert)->
test 'Dict.get' (assert)->
{get} = Dict
- assert.ok isFunction(get), 'is function'
+ assert.isFunction get
assert.ok get(q:1, \q) is 1
assert.ok get(q:1, \w) is void
assert.ok get([1] 0) is 1
@@ -196,7 +195,7 @@ test 'Dict.get' (assert)->
test 'Dict.values' (assert)->
{values} = Dict
- assert.ok isFunction(values), 'is function'
+ assert.isFunction values
iter = values {}
assert.ok iter[Symbol?toStringTag] is 'Dict Iterator'
assert.ok \next of iter
@@ -206,7 +205,7 @@ test 'Dict.values' (assert)->
test 'Dict.keys' (assert)->
{keys} = Dict
- assert.ok isFunction(keys), 'is function'
+ assert.isFunction keys
iter = keys {}
assert.ok iter[Symbol?toStringTag] is 'Dict Iterator'
assert.ok \next of iter
@@ -216,7 +215,7 @@ test 'Dict.keys' (assert)->
test 'Dict.entries' (assert)->
{entries} = Dict
- assert.ok isFunction(entries), 'is function'
+ assert.isFunction entries
iter = entries {}
assert.ok iter[Symbol?toStringTag] is 'Dict Iterator'
assert.ok \next of iter
diff --git a/tests/tests/core.function.part.ls b/tests/tests/core.function.part.ls
index 1c0f7f2a90fc..1ed49fd245b6 100644
--- a/tests/tests/core.function.part.ls
+++ b/tests/tests/core.function.part.ls
@@ -1,10 +1,8 @@
{module, test} = QUnit
module \core-js
-isFunction = -> typeof! it is \Function
-
test 'Function#part' (assert)->
- assert.ok isFunction(Function::part), 'is function'
+ assert.isFunction Function::part
assert.ok (-> typeof! it is \String)part(\qwe)!
obj = a: 42
obj.fn = (-> @a + it)part 21
@@ -12,7 +10,7 @@ test 'Function#part' (assert)->
$ = _
fn = -> Array::map.call(&, String).join ' '
part = fn.part $, \Саша, $, \шоссе, $, \сосала
- assert.ok isFunction(part), '.part with placeholders return function'
+ assert.isFunction part, '.part with placeholders return function'
assert.ok part(\Шла \по) is 'Шла Саша по шоссе undefined сосала', '.part with placeholders: args < placeholders'
assert.ok part(\Шла \по \и) is 'Шла Саша по шоссе и сосала', '.part with placeholders: args == placeholders'
assert.ok part(\Шла \по \и \сушку) is 'Шла Саша по шоссе и сосала сушку', '.part with placeholders: args > placeholders'
\ No newline at end of file
diff --git a/tests/tests/core.get-iterator-method.ls b/tests/tests/core.get-iterator-method.ls
index 3b300de9bcbf..01eb197a1fac 100644
--- a/tests/tests/core.get-iterator-method.ls
+++ b/tests/tests/core.get-iterator-method.ls
@@ -5,7 +5,7 @@ module \core-js
test 'core.getIteratorMethod' (assert)->
{getIteratorMethod} = core
- assert.ok typeof getIteratorMethod is \function, 'is function'
+ assert.isFunction getIteratorMethod
assert.strictEqual getIteratorMethod({}), void
iterFn = getIteratorMethod []
assert.ok typeof iterFn is \function
diff --git a/tests/tests/core.get-iterator.ls b/tests/tests/core.get-iterator.ls
index 7134e39be259..589ac31a05d8 100644
--- a/tests/tests/core.get-iterator.ls
+++ b/tests/tests/core.get-iterator.ls
@@ -5,7 +5,7 @@ module \core-js
test 'core.getIterator' (assert)->
{getIterator} = core
- assert.ok typeof getIterator is \function, 'is function'
+ assert.isFunction getIterator
assert.throws (!-> getIterator {}), TypeError
iter = getIterator []
assert.ok \next of iter
diff --git a/tests/tests/core.is-iterable.ls b/tests/tests/core.is-iterable.ls
index 96e460338022..280bead2f97d 100644
--- a/tests/tests/core.is-iterable.ls
+++ b/tests/tests/core.is-iterable.ls
@@ -3,7 +3,7 @@ module \core-js
test 'core.isIterable' (assert)->
{isIterable} = core
- assert.ok typeof isIterable is \function, 'is function'
+ assert.isFunction isIterable
assert.ok !isIterable {}
assert.ok isIterable []
assert.ok isIterable (->&)!
\ No newline at end of file
diff --git a/tests/tests/core.log.ls b/tests/tests/core.log.ls
index 4cd8b9ad4e0f..5a593c6293a0 100644
--- a/tests/tests/core.log.ls
+++ b/tests/tests/core.log.ls
@@ -1,16 +1,13 @@
{module, test} = QUnit
module \core-js
-isFunction = -> typeof! it is \Function
-isObject = -> it is Object it
-
methods = <[assert count debug dir dirxml error exception group groupEnd groupCollapsed groupEnd info log table trace warn markTimeline profile profileEnd time timeEnd timeStamp]>
test 'log is object' (assert)->
- assert.ok isObject(log), 'global.log is object'
+ assert.ok Object(log) == log, 'global.log is object'
test 'log.{..} are functions' (assert)->
- for methods => assert.ok isFunction(log[..]), "log.#{..} is function"
+ for methods => assert.isFunction log[..], "log.#{..} is function"
test 'call log.{..}' (assert)->
for m in methods => assert.ok (try
@@ -28,12 +25,12 @@ test 'call unbound log.#{..}' (assert)->
test 'log.{enable, disable}' (assert)->
{enable, disable} = log
- assert.ok isFunction(enable), 'log.enable is function'
- assert.ok isFunction(disable), 'log.disable is function'
+ assert.isFunction enable, 'log.enable is function'
+ assert.isFunction disable, 'log.disable is function'
assert.ok (try disable!; on), 'disable log'
assert.ok (try log.log('call disabled log') is void), 'call disabled log'
assert.ok (try enable!; on), 'enable log'
test 'log' (assert)->
- assert.ok isFunction(log), 'global.log is function'
+ assert.isFunction log
assert.ok (try log(42); on), 'call log'
\ No newline at end of file
diff --git a/tests/tests/core.number.iterator.ls b/tests/tests/core.number.iterator.ls
index b3c9ccaccacb..c91f7e5405d6 100644
--- a/tests/tests/core.number.iterator.ls
+++ b/tests/tests/core.number.iterator.ls
@@ -3,7 +3,7 @@ module \core-js
test 'Number#@@iterator' (assert)->
{iterator, toStringTag} = Symbol
- assert.ok typeof! Number::[iterator] is \Function, 'is function'
+ assert.isFunction Number::[iterator]
iter1 = 2[iterator]!
assert.ok iter1[toStringTag] is 'Number Iterator', '@@toStringTag'
assert.deepEqual iter1.next!, {done: no, value: 0}, '2 #1'
diff --git a/tests/tests/core.object.classof.ls b/tests/tests/core.object.classof.ls
index 5f11df14fc10..2a9862627b90 100644
--- a/tests/tests/core.object.classof.ls
+++ b/tests/tests/core.object.classof.ls
@@ -3,7 +3,7 @@ module \core-js
test 'Object.classof' (assert)->
{classof} = Object
- assert.ok typeof! classof is \Function, 'is function'
+ assert.isFunction classof
assert.ok classof(void) is \Undefined, 'classof undefined is `Undefined`'
assert.ok classof(null) is \Null, 'classof null is `Null`'
assert.ok classof(true) is \Boolean, 'classof bool is `Boolean`'
diff --git a/tests/tests/core.object.define.ls b/tests/tests/core.object.define.ls
index 3ce503415422..af9d7f5e35a1 100644
--- a/tests/tests/core.object.define.ls
+++ b/tests/tests/core.object.define.ls
@@ -3,7 +3,7 @@ module \core-js
test 'Object.define' (assert)->
{define, defineProperty} = Object
- assert.ok typeof! define is \Function, 'is function'
+ assert.isFunction define
foo = q:1
assert.ok foo is define foo, w:2
assert.ok foo.w is 2
diff --git a/tests/tests/core.object.is-object.ls b/tests/tests/core.object.is-object.ls
index f3df222d7757..9cf74d6bc663 100644
--- a/tests/tests/core.object.is-object.ls
+++ b/tests/tests/core.object.is-object.ls
@@ -3,7 +3,7 @@ module \core-js
test 'Object.isObject' (assert)->
{isObject} = Object
- assert.ok typeof! isObject is \Function, 'is function'
+ assert.isFunction isObject
assert.ok not isObject(void), 'isObject undefined return false'
assert.ok not isObject(null), 'isObject null return false'
assert.ok not isObject(1), 'isObject number return false'
diff --git a/tests/tests/core.object.make.ls b/tests/tests/core.object.make.ls
index 9233f984dfb4..da82b230a76f 100644
--- a/tests/tests/core.object.make.ls
+++ b/tests/tests/core.object.make.ls
@@ -3,7 +3,7 @@ module \core-js
test 'Object.make' (assert)->
{make} = Object
- assert.ok typeof! make is \Function, 'is function'
+ assert.isFunction make
object = make foo = {q:1}, {w:2}
assert.ok Object.getPrototypeOf(object) is foo
assert.ok object.w is 2
\ No newline at end of file
diff --git a/tests/tests/core.string.escape-html.ls b/tests/tests/core.string.escape-html.ls
index 3218f7daf889..f08d02aa0683 100644
--- a/tests/tests/core.string.escape-html.ls
+++ b/tests/tests/core.string.escape-html.ls
@@ -2,10 +2,10 @@
module \core-js
test 'String#escapeHTML' (assert)->
- assert.ok typeof! String::escapeHTML is \Function, 'is function'
- assert.ok /native code/.test(String::escapeHTML), 'looks like native'
- assert.strictEqual String::escapeHTML.length, 0, 'arity is 0'
- assert.strictEqual String::escapeHTML.name, \escapeHTML, 'name is "escapeHTML"'
+ assert.isFunction String::escapeHTML
+ assert.arity String::escapeHTML, 0
+ assert.name String::escapeHTML, \escapeHTML
+ assert.looksNative String::escapeHTML
assert.strictEqual 'qwe, asd'escapeHTML!, 'qwe, asd'
assert.strictEqual 'qwe
'escapeHTML!, '<div>qwe</div>'
assert.strictEqual "&<>\"'".escapeHTML!, '&<>"''
\ No newline at end of file
diff --git a/tests/tests/core.string.unescape-html.ls b/tests/tests/core.string.unescape-html.ls
index 6922dca45dd3..a2b8f95ccd88 100644
--- a/tests/tests/core.string.unescape-html.ls
+++ b/tests/tests/core.string.unescape-html.ls
@@ -2,10 +2,10 @@
module \core-js
test 'String#unescapeHTML' (assert)->
- assert.ok typeof! String::unescapeHTML is \Function, 'is function'
- assert.ok /native code/.test(String::unescapeHTML), 'looks like native'
- assert.strictEqual String::unescapeHTML.length, 0, 'arity is 0'
- assert.strictEqual String::unescapeHTML.name, \unescapeHTML, 'name is "unescapeHTML"'
+ assert.isFunction String::unescapeHTML
+ assert.arity String::unescapeHTML, 0
+ assert.name String::unescapeHTML, \unescapeHTML
+ assert.looksNative String::unescapeHTML
assert.strictEqual 'qwe, asd'.unescapeHTML!, 'qwe, asd'
assert.strictEqual '<div>qwe</div>'.unescapeHTML!, 'qwe
'
assert.strictEqual '&<>"''.unescapeHTML!, "&<>\"'"
\ No newline at end of file
diff --git a/tests/tests/es5.ls b/tests/tests/es5.ls
index ff8c649645a4..13d7a624d4e8 100644
--- a/tests/tests/es5.ls
+++ b/tests/tests/es5.ls
@@ -1,29 +1,27 @@
{module, test} = QUnit
module \ES5
-isFunction = -> typeof! it is \Function
-
test 'Object.getOwnPropertyDescriptor' (assert)->
{getOwnPropertyDescriptor} = Object
- assert.ok isFunction(getOwnPropertyDescriptor), 'is function'
+ assert.isFunction getOwnPropertyDescriptor
assert.deepEqual getOwnPropertyDescriptor(q:42, \q), {+writable, +enumerable, +configurable, value: 42}
assert.ok getOwnPropertyDescriptor({}, \toString) is void
test 'Object.defineProperty' (assert)->
{defineProperty} = Object
- assert.ok isFunction(defineProperty), 'is function'
+ assert.isFunction defineProperty
assert.ok (rez = defineProperty src = {}, \q, value: 42) is src
assert.ok rez.q is 42
test 'Object.defineProperties' (assert)->
{defineProperties} = Object
- assert.ok isFunction(defineProperties), 'is function'
+ assert.isFunction defineProperties
assert.ok (rez = defineProperties src = {}, q: {value: 42}, w: value: 33) is src
assert.ok rez.q is 42 and rez.w is 33
test 'Object.getPrototypeOf' (assert)->
{create, getPrototypeOf} = Object
- assert.ok isFunction(getPrototypeOf), 'is function'
+ assert.isFunction getPrototypeOf
assert.ok getPrototypeOf({}) is Object::
assert.ok getPrototypeOf([]) is Array::
assert.ok getPrototypeOf(new class fn) is fn::
@@ -39,7 +37,7 @@ test 'Object.getPrototypeOf' (assert)->
test 'Object.getOwnPropertyNames' (assert)->
{getOwnPropertyNames} = Object
- assert.ok isFunction(getOwnPropertyNames), 'is function'
+ assert.isFunction getOwnPropertyNames
fn1 = (@w = 2)->
fn2 = (@toString = 2)->
fn1::q = fn2::q = 1
@@ -65,7 +63,7 @@ test 'Object.create' (assert)->
for getOwnPropertyNames(object)
.. in result or result.push ..
result
- assert.ok isFunction(create), 'is function'
+ assert.isFunction create
assert.ok isPrototype obj = q:1, create(obj)
assert.ok create(obj)q is 1
fn = -> @a = 1
@@ -80,7 +78,7 @@ test 'Object.create' (assert)->
test 'Object.keys' (assert)->
{keys} = Object
- assert.ok isFunction(keys), 'is function'
+ assert.isFunction keys
fn1 = (@w = 2)->
fn2 = (@toString = 2)->
fn1::q = fn2::q = 1
@@ -91,36 +89,36 @@ test 'Object.keys' (assert)->
test 'Object.seal' (assert)->
{seal} = Object
- assert.ok isFunction(seal), 'is function'
+ assert.isFunction seal
assert.strictEqual seal(a = {}), a
test 'Object.freeze' (assert)->
{freeze} = Object
- assert.ok isFunction(freeze), 'is function'
+ assert.isFunction freeze
assert.strictEqual freeze(a = {}), a
test 'Object.preventExtensions' (assert)->
{preventExtensions} = Object
- assert.ok isFunction(preventExtensions), 'is function'
+ assert.isFunction preventExtensions
assert.strictEqual preventExtensions(a = {}), a
test 'Object.isSealed' (assert)->
{isSealed} = Object
- assert.ok isFunction(isSealed), 'is function'
+ assert.isFunction isSealed
assert.strictEqual isSealed({}), no
test 'Object.isFrozen' (assert)->
{isFrozen} = Object
- assert.ok isFunction(isFrozen), 'is function'
+ assert.isFunction isFrozen
assert.strictEqual isFrozen({}), no
test 'Object.isExtensible' (assert)->
{isExtensible} = Object
- assert.ok isFunction(isExtensible), 'is function'
+ assert.isFunction isExtensible
assert.strictEqual isExtensible({}), on
test 'Function#bind' (assert)->
- assert.ok isFunction(Function::bind), 'is function'
+ assert.isFunction Function::bind
obj = a: 42
assert.ok 42 is (-> @a)bind(obj)!
assert.ok void is new ((->)bind obj)!a
@@ -140,14 +138,14 @@ test 'Function#bind' (assert)->
test 'Array.isArray' (assert)->
{isArray} = Array
- assert.ok isFunction(isArray), 'is function'
+ assert.isFunction isArray
assert.ok not isArray {}
assert.ok not isArray do -> &
assert.ok isArray []
test 'ES5 Array prototype methods are functions' (assert)->
for <[indexOf lastIndexOf every some forEach map filter reduce reduceRight]>
- assert.ok isFunction(Array::[..]), "Array::#{..} is function"
+ assert.isFunction Array::[..], "Array::#{..} is function"
test 'Array#slice' (assert)->
{slice} = Array::
@@ -291,11 +289,11 @@ test 'Array#reduceRight' (assert)->
test 'Date.now' (assert)->
{now} = Date
- assert.ok isFunction(now), 'is function'
+ assert.isFunction now
assert.ok +new Date - now! < 10, 'Date.now() ~ +new Date'
test 'Date#toISOString' (assert)->
- assert.ok isFunction(Date::toISOString), 'is function'
+ assert.isFunction Date::toISOString
assert.strictEqual new Date(0).toISOString(), '1970-01-01T00:00:00.000Z'
assert.strictEqual new Date(1e12+1).toISOString(), '2001-09-09T01:46:40.001Z'
assert.strictEqual new Date(-5e13-1).toISOString(), '0385-07-25T07:06:39.999Z'
diff --git a/tests/tests/es6.array.copy-within.ls b/tests/tests/es6.array.copy-within.ls
index 95d225b36a2d..6c40892a2533 100644
--- a/tests/tests/es6.array.copy-within.ls
+++ b/tests/tests/es6.array.copy-within.ls
@@ -3,10 +3,10 @@
module \ES6
test 'Array#copyWithin' (assert)->
- assert.ok typeof! Array::copyWithin is \Function, 'is function'
- assert.strictEqual Array::copyWithin.length, 2, 'arity is 2'
- assert.ok /native code/.test(Array::copyWithin), 'looks like native'
- assert.strictEqual Array::copyWithin.name, \copyWithin, 'name is "copyWithin"'
+ assert.isFunction Array::copyWithin
+ assert.arity Array::copyWithin, 2
+ assert.name Array::copyWithin, \copyWithin
+ assert.looksNative Array::copyWithin
assert.strictEqual (a = [1]copyWithin(0)), a
assert.deepEqual [1 2 3 4 5]copyWithin(0 3), [4 5 3 4 5]
assert.deepEqual [1 2 3 4 5]copyWithin(1 3), [1 4 5 4 5]
diff --git a/tests/tests/es6.array.fill.ls b/tests/tests/es6.array.fill.ls
index b5570d2dc3ae..1b8e25c779ad 100644
--- a/tests/tests/es6.array.fill.ls
+++ b/tests/tests/es6.array.fill.ls
@@ -3,10 +3,10 @@
module \ES6
test 'Array#fill' (assert)->
- assert.ok typeof! Array::fill is \Function, 'is function'
- assert.strictEqual Array::fill.length, 1, 'arity is 1'
- assert.ok /native code/.test(Array::fill), 'looks like native'
- assert.strictEqual Array::fill.name, \fill, 'name is "fill"'
+ assert.isFunction Array::fill
+ assert.arity Array::fill, 1
+ assert.name Array::fill, \fill
+ assert.looksNative Array::fill
assert.strictEqual (a = Array(5)fill(5)), a
assert.deepEqual Array(5)fill(5), [5 5 5 5 5]
assert.deepEqual Array(5)fill(5 1), [void 5 5 5 5]
diff --git a/tests/tests/es6.array.find-index.ls b/tests/tests/es6.array.find-index.ls
index b868beefd3ad..db8cc73ed39d 100644
--- a/tests/tests/es6.array.find-index.ls
+++ b/tests/tests/es6.array.find-index.ls
@@ -3,10 +3,10 @@
module \ES6
test 'Array#findIndex' (assert)->
- assert.ok typeof! Array::findIndex is \Function, 'is function'
- assert.strictEqual Array::findIndex.length, 1, 'arity is 1'
- assert.ok /native code/.test(Array::findIndex), 'looks like native'
- assert.strictEqual Array::findIndex.name, \findIndex, 'name is "findIndex"'
+ assert.isFunction Array::findIndex
+ assert.arity Array::findIndex, 1
+ assert.name Array::findIndex, \findIndex
+ assert.looksNative Array::findIndex
(arr = [1])findIndex (val, key, that)->
assert.strictEqual @, ctx
assert.strictEqual val, 1
diff --git a/tests/tests/es6.array.find.ls b/tests/tests/es6.array.find.ls
index 81992a0a3ecd..40a82b417c23 100644
--- a/tests/tests/es6.array.find.ls
+++ b/tests/tests/es6.array.find.ls
@@ -3,10 +3,10 @@
module \ES6
test 'Array#find' (assert)->
- assert.ok typeof! Array::find is \Function, 'is function'
- assert.strictEqual Array::find.length, 1, 'arity is 1'
- assert.ok /native code/.test(Array::find), 'looks like native'
- assert.strictEqual Array::find.name, \find, 'name is "find"'
+ assert.isFunction Array::find
+ assert.arity Array::find, 1
+ assert.name Array::find, \find
+ assert.looksNative Array::find
(arr = [1])find (val, key, that)->
assert.strictEqual @, ctx
assert.strictEqual val, 1
diff --git a/tests/tests/es6.array.from.ls b/tests/tests/es6.array.from.ls
index 42b1c7126f69..00a4f51baf30 100644
--- a/tests/tests/es6.array.from.ls
+++ b/tests/tests/es6.array.from.ls
@@ -4,10 +4,10 @@ module \ES6
test 'Array.from' (assert)->
{from} = Array
{iterator} = Symbol
- assert.ok typeof! from is \Function, 'is function'
- assert.strictEqual Array.from.length, 1, 'arity is 1'
- assert.ok /native code/.test(Array.from), 'looks like native'
- assert.strictEqual Array.from.name, \from, 'name is "from"'
+ assert.isFunction from
+ assert.arity from, 1
+ assert.name from, \from
+ assert.looksNative from
assert.deepEqual from(\123), <[1 2 3]>
assert.deepEqual from({length: 3, 0: 1, 1: 2, 2: 3}), [1 2 3]
from al = (-> &)(1), (val, key)->
diff --git a/tests/tests/es6.array.iterator.ls b/tests/tests/es6.array.iterator.ls
index b21435249e53..2c75990f5fd8 100644
--- a/tests/tests/es6.array.iterator.ls
+++ b/tests/tests/es6.array.iterator.ls
@@ -1,14 +1,13 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
test 'Array#keys' (assert)->
- assert.ok isFunction(Array::keys), 'is function'
- assert.strictEqual Array::keys.length, 0, 'arity is 0'
- assert.strictEqual Array::keys.name, \keys, 'name is "keys"'
- assert.ok /native code/.test(Array::keys), 'looks like native'
+ assert.isFunction Array::keys
+ assert.arity Array::keys, 0
+ assert.name Array::keys, \keys
+ assert.looksNative Array::keys
iter = <[q w e]>keys!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
@@ -19,10 +18,10 @@ test 'Array#keys' (assert)->
assert.ok \keys of Array::[Symbol?unscopables], 'In Array#@@unscopables'
test 'Array#values' (assert)->
- assert.ok isFunction(Array::values), 'is function'
- assert.strictEqual Array::values.length, 0, 'arity is 0'
- #assert.strictEqual Array::values.name, \values, 'name is "values"' # fails in V8
- assert.ok /native code/.test(Array::values), 'looks like native'
+ assert.isFunction Array::values
+ assert.arity Array::values, 0
+ #assert.name Array::values, \values # fails in V8
+ assert.looksNative Array::values
iter = <[q w e]>values!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
@@ -33,10 +32,10 @@ test 'Array#values' (assert)->
assert.ok \values of Array::[Symbol?unscopables], 'In Array#@@unscopables'
test 'Array#entries' (assert)->
- assert.ok isFunction(Array::entries), 'is function'
- assert.strictEqual Array::entries.length, 0, 'arity is 0'
- assert.strictEqual Array::entries.name, \entries, 'name is "entries"'
- assert.ok /native code/.test(Array::entries), 'looks like native'
+ assert.isFunction Array::entries
+ assert.arity Array::entries, 0
+ assert.name Array::entries, \entries
+ assert.looksNative Array::entries
iter = <[q w e]>entries!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Array Iterator'
@@ -47,10 +46,10 @@ test 'Array#entries' (assert)->
assert.ok \entries of Array::[Symbol?unscopables], 'In Array#@@unscopables'
test 'Array#@@iterator' (assert)->
- assert.ok isFunction(Array::[Symbol?iterator]), 'is function'
- assert.strictEqual Array::[Symbol?iterator].length, 0, 'arity is 0'
- #assert.strictEqual Array::[Symbol?iterator].name, \values, 'name is "values"' # fails in V8
- assert.ok /native code/.test(Array::[Symbol?iterator]), 'looks like native'
+ assert.isFunction Array::[Symbol?iterator]
+ assert.arity Array::[Symbol?iterator], 0
+ #assert.name Array::[Symbol?iterator], \values # fails in V8
+ assert.looksNative Array::[Symbol?iterator]
assert.strictEqual Array::[Symbol?iterator], Array::values
iter = <[q w e]>[Symbol?iterator]!
assert.ok isIterator(iter), 'Return iterator'
diff --git a/tests/tests/es6.array.of.ls b/tests/tests/es6.array.of.ls
index 023f4094d4be..dabd6e7f7f45 100644
--- a/tests/tests/es6.array.of.ls
+++ b/tests/tests/es6.array.of.ls
@@ -2,10 +2,10 @@
module \ES6
test 'Array.of' (assert)->
- assert.ok typeof! Array.of is \Function, 'is function'
- assert.strictEqual Array.of.length, 0, 'arity is 0'
- assert.ok /native code/.test(Array.of), 'looks like native'
- assert.strictEqual Array.of.name, \of, 'name is "of"'
+ assert.isFunction Array.of
+ assert.arity Array.of, 0
+ assert.name Array.of, \of
+ assert.looksNative Array.of
assert.deepEqual Array.of(1), [1]
assert.deepEqual Array.of(1 2 3), [1 2 3]
# generic
diff --git a/tests/tests/es6.map.ls b/tests/tests/es6.map.ls
index ca677820c687..b7907222c6ff 100644
--- a/tests/tests/es6.map.ls
+++ b/tests/tests/es6.map.ls
@@ -1,18 +1,17 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
same = (a, b)-> if a is b => a isnt 0 or 1 / a is 1 / b else a !~= a and b !~= b
{getOwnPropertyDescriptor, freeze} = Object
{iterator} = Symbol
test 'Map' (assert)->
- assert.ok isFunction(Map), 'is function'
- assert.ok /native code/.test(Map), 'looks like native'
- assert.strictEqual Map.name, \Map, 'name is "Map"'
- assert.strictEqual Map.length, 0, 'arity is 0'
+ assert.isFunction Map
+ assert.arity Map, 0
+ assert.name Map, \Map
+ assert.looksNative Map
assert.ok \clear of Map::, 'clear in Map.prototype'
assert.ok \delete of Map::, 'delete in Map.prototype'
assert.ok \forEach of Map::, 'forEach in Map.prototype'
@@ -39,10 +38,10 @@ test 'Map' (assert)->
assert.ok done
test 'Map#clear' (assert)->
- assert.ok isFunction(Map::clear), 'is function'
- assert.strictEqual Map::clear.name, \clear, 'name is "clear"'
- assert.strictEqual Map::clear.length, 0, 'arity is 0'
- assert.ok /native code/.test(Map::clear), 'looks like native'
+ assert.isFunction Map::clear
+ assert.arity Map::clear, 0
+ assert.name Map::clear, \clear
+ assert.looksNative Map::clear
M = new Map
M.clear!
assert.strictEqual M.size, 0
@@ -58,10 +57,10 @@ test 'Map#clear' (assert)->
assert.ok !M.has f
test 'Map#delete' (assert)->
- assert.ok isFunction(Map::delete), 'is function'
- #assert.strictEqual Map::delete.name, \delete, 'name is "delete"' # can't be polyfilled in some environments
- assert.strictEqual Map::delete.length, 1, 'arity is 1'
- assert.ok /native code/.test(Map::delete), 'looks like native'
+ assert.isFunction Map::delete
+ assert.arity Map::delete, 1
+ #assert.name Map::delete, \delete # can't be polyfilled in some environments
+ assert.looksNative Map::delete
a = []
M = new Map!set NaN, 1 .set 2 1 .set 3 1 .set 2 5 .set 1 4 .set a, {}
assert.strictEqual M.size, 5
@@ -79,10 +78,10 @@ test 'Map#delete' (assert)->
assert.strictEqual M.size, 3
test 'Map#forEach' (assert)->
- assert.ok isFunction(Map::forEach), 'is function'
- assert.strictEqual Map::forEach.name, \forEach, 'name is "forEach"'
- assert.strictEqual Map::forEach.length, 1, 'arity is 1'
- assert.ok /native code/.test(Map::forEach), 'looks like native'
+ assert.isFunction Map::forEach
+ assert.arity Map::forEach, 1
+ assert.name Map::forEach, \forEach
+ assert.looksNative Map::forEach
r = {}
var T
count = 0
@@ -111,10 +110,10 @@ test 'Map#forEach' (assert)->
assert.strictEqual s, \1
test 'Map#get' (assert)->
- assert.ok isFunction(Map::get), 'is function'
- assert.strictEqual Map::get.name, \get, 'name is "get"'
- assert.strictEqual Map::get.length, 1, 'arity is 1'
- assert.ok /native code/.test(Map::get), 'looks like native'
+ assert.isFunction Map::get
+ assert.name Map::get, \get
+ assert.arity Map::get, 1
+ assert.looksNative Map::get
o = {}
f = freeze {}
M = new Map [[NaN, 1], [2 1], [3 1], [2 5], [1 4], [f, 42], [o, o]]
@@ -126,10 +125,10 @@ test 'Map#get' (assert)->
assert.strictEqual M.get(2), 5
test 'Map#has' (assert)->
- assert.ok isFunction(Map::has), 'is function'
- assert.strictEqual Map::has.name, \has, 'name is "has"'
- assert.strictEqual Map::has.length, 1, 'arity is 1'
- assert.ok /native code/.test(Map::has), 'looks like native'
+ assert.isFunction Map::has
+ assert.name Map::has, \has
+ assert.arity Map::has, 1
+ assert.looksNative Map::has
o = {}
f = freeze {}
M = new Map [[NaN, 1], [2 1], [3 1], [2 5], [1 4], [f, 42], [o, o]]
@@ -141,10 +140,10 @@ test 'Map#has' (assert)->
assert.ok not M.has {}
test 'Map#set' (assert)->
- assert.ok isFunction(Map::set), 'is function'
- assert.strictEqual Map::set.name, \set, 'name is "set"'
- assert.strictEqual Map::set.length, 2, 'arity is 2'
- assert.ok /native code/.test(Map::set), 'looks like native'
+ assert.isFunction Map::set
+ assert.name Map::set, \set
+ assert.arity Map::set, 2
+ assert.looksNative Map::set
o = {}
M = new Map!set NaN, 1 .set 2 1 .set 3 1 .set 2 5 .set 1 4 .set o, o
assert.ok M.size is 5
@@ -213,10 +212,10 @@ test 'Map Iterator' (assert)->
assert.deepEqual keys, <[a d e]>
test 'Map#keys' (assert)->
- assert.ok typeof Map::keys is \function, 'is function'
- assert.strictEqual Map::keys.name, \keys, 'name is "keys"'
- assert.strictEqual Map::keys.length, 0, 'arity is 0'
- assert.ok /native code/.test(Map::keys), 'looks like native'
+ assert.isFunction Map::keys
+ assert.name Map::keys, \keys
+ assert.arity Map::keys, 0
+ assert.looksNative Map::keys
iter = new Map([[\a \q],[\s \w],[\d \e]])keys!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Map Iterator'
@@ -226,10 +225,10 @@ test 'Map#keys' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Map#values' (assert)->
- assert.ok typeof Map::values is \function, 'is function'
- assert.strictEqual Map::values.name, \values, 'name is "values"'
- assert.strictEqual Map::values.length, 0, 'arity is 0'
- assert.ok /native code/.test(Map::values), 'looks like native'
+ assert.isFunction Map::values
+ assert.name Map::values, \values
+ assert.arity Map::values, 0
+ assert.looksNative Map::values
iter = new Map([[\a \q],[\s \w],[\d \e]])values!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Map Iterator'
@@ -239,10 +238,10 @@ test 'Map#values' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Map#entries' (assert)->
- assert.ok typeof Map::entries is \function, 'is function'
- assert.strictEqual Map::entries.name, \entries, 'name is "entries"'
- assert.strictEqual Map::entries.length, 0, 'arity is 0'
- assert.ok /native code/.test(Map::entries), 'looks like native'
+ assert.isFunction Map::entries
+ assert.name Map::entries, \entries
+ assert.arity Map::entries, 0
+ assert.looksNative Map::entries
iter = new Map([[\a \q],[\s \w],[\d \e]])entries!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Map Iterator'
@@ -252,10 +251,10 @@ test 'Map#entries' (assert)->
assert.deepEqual iter.next!, {value: void, done: on}
test 'Map#@@iterator' (assert)->
- assert.ok typeof Map::[Symbol?iterator] is \function, 'is function'
- assert.strictEqual Map::entries.name, \entries, 'name is "entries"'
- assert.strictEqual Map::entries.length, 0, 'arity is 0'
- assert.ok /native code/.test(Map::[Symbol?iterator]), 'looks like native'
+ assert.isFunction Map::[Symbol?iterator]
+ assert.name Map::entries, \entries
+ assert.arity Map::entries, 0
+ assert.looksNative Map::[Symbol?iterator]
assert.strictEqual Map::[Symbol?iterator], Map::entries
iter = new Map([[\a \q],[\s \w],[\d \e]])[Symbol?iterator]!
assert.ok isIterator(iter), 'Return iterator'
diff --git a/tests/tests/es6.math.acosh.ls b/tests/tests/es6.math.acosh.ls
index f2948499f6b2..000a61ade586 100644
--- a/tests/tests/es6.math.acosh.ls
+++ b/tests/tests/es6.math.acosh.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the inverse hyperbolic cosine of x.
test 'Math.acosh' (assert)->
{acosh} = Math
- assert.ok typeof! acosh is \Function, 'is function'
- assert.strictEqual acosh.name, \acosh, 'name is "acosh"'
- assert.strictEqual acosh.length, 1, 'arity is 1'
- assert.ok /native code/.test(acosh), 'looks like native'
+ assert.isFunction acosh
+ assert.name acosh, \acosh
+ assert.arity acosh, 1
+ assert.looksNative acosh
assert.same acosh(NaN), NaN
assert.same acosh(0.5), NaN
assert.same acosh(-1), NaN
diff --git a/tests/tests/es6.math.asinh.ls b/tests/tests/es6.math.asinh.ls
index ebafda9cf821..47ad58a542a3 100644
--- a/tests/tests/es6.math.asinh.ls
+++ b/tests/tests/es6.math.asinh.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the inverse hyperbolic sine of x.
test 'Math.asinh' (assert)->
{asinh} = Math
- assert.ok typeof! asinh is \Function, 'is function'
- assert.strictEqual asinh.name, \asinh, 'name is "asinh"'
- assert.strictEqual asinh.length, 1, 'arity is 1'
- assert.ok /native code/.test(asinh), 'looks like native'
+ assert.isFunction asinh
+ assert.name asinh, \asinh
+ assert.arity asinh, 1
+ assert.looksNative asinh
assert.same asinh(NaN), NaN
assert.same asinh(0), 0
assert.same asinh(-0), -0
diff --git a/tests/tests/es6.math.atanh.ls b/tests/tests/es6.math.atanh.ls
index e15ddaa67e7a..ee542233d86c 100644
--- a/tests/tests/es6.math.atanh.ls
+++ b/tests/tests/es6.math.atanh.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the inverse hyperbolic tangent of x.
test 'Math.atanh' (assert)->
{atanh} = Math
- assert.ok typeof! atanh is \Function, 'is function'
- assert.strictEqual atanh.name, \atanh, 'name is "atanh"'
- assert.strictEqual atanh.length, 1, 'arity is 1'
- assert.ok /native code/.test(atanh), 'looks like native'
+ assert.isFunction atanh
+ assert.name atanh, \atanh
+ assert.arity atanh, 1
+ assert.looksNative atanh
assert.same atanh(NaN), NaN
assert.same atanh(-2), NaN
assert.same atanh(-1.5), NaN
diff --git a/tests/tests/es6.math.cbrt.ls b/tests/tests/es6.math.cbrt.ls
index 26703292cac3..f5e2696696c3 100644
--- a/tests/tests/es6.math.cbrt.ls
+++ b/tests/tests/es6.math.cbrt.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the cube root of x.
test 'Math.cbrt' (assert)->
{cbrt} = Math
- assert.ok typeof! cbrt is \Function, 'is function'
- assert.strictEqual cbrt.name, \cbrt, 'name is "cbrt"'
- assert.strictEqual cbrt.length, 1, 'arity is 1'
- assert.ok /native code/.test(cbrt), 'looks like native'
+ assert.isFunction cbrt
+ assert.name cbrt, \cbrt
+ assert.arity cbrt, 1
+ assert.looksNative cbrt
assert.same cbrt(NaN), NaN
assert.same cbrt(0), 0
assert.same cbrt(-0), -0
diff --git a/tests/tests/es6.math.clz32.ls b/tests/tests/es6.math.clz32.ls
index e53bc1f38177..2d9018258a17 100644
--- a/tests/tests/es6.math.clz32.ls
+++ b/tests/tests/es6.math.clz32.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Math.clz32' (assert)->
{clz32} = Math
- assert.ok typeof! clz32 is \Function, 'is function'
- assert.strictEqual clz32.name, \clz32, 'name is "clz32"'
- assert.strictEqual clz32.length, 1, 'arity is 1'
- assert.ok /native code/.test(clz32), 'looks like native'
+ assert.isFunction clz32
+ assert.name clz32, \clz32
+ assert.arity clz32, 1
+ assert.looksNative clz32
assert.strictEqual clz32(0), 32
assert.strictEqual clz32(1), 31
assert.same clz32(-1), 0
diff --git a/tests/tests/es6.math.cosh.ls b/tests/tests/es6.math.cosh.ls
index 88e0c376558a..46820913dd59 100644
--- a/tests/tests/es6.math.cosh.ls
+++ b/tests/tests/es6.math.cosh.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the hyperbolic cosine of x.
test 'Math.cosh' (assert)->
{cosh} = Math
- assert.ok typeof! cosh is \Function, 'is function'
- assert.strictEqual cosh.name, \cosh, 'name is "cosh"'
- assert.strictEqual cosh.length, 1, 'arity is 1'
- assert.ok /native code/.test(cosh), 'looks like native'
+ assert.isFunction cosh
+ assert.name cosh, \cosh
+ assert.arity cosh, 1
+ assert.looksNative cosh
assert.same cosh(NaN), NaN
assert.strictEqual cosh(0), 1
assert.strictEqual cosh(-0), 1
diff --git a/tests/tests/es6.math.expm1.ls b/tests/tests/es6.math.expm1.ls
index f4ce0dfe88a1..4e7c8254a803 100644
--- a/tests/tests/es6.math.expm1.ls
+++ b/tests/tests/es6.math.expm1.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to subtracting 1 from the exponential function of x
test 'Math.expm1' (assert)->
{expm1} = Math
- assert.ok typeof! expm1 is \Function, 'is function'
- assert.strictEqual expm1.name, \expm1, 'name is "expm1"'
- assert.strictEqual expm1.length, 1, 'arity is 1'
- assert.ok /native code/.test(expm1), 'looks like native'
+ assert.isFunction expm1
+ assert.name expm1, \expm1
+ assert.arity expm1, 1
+ assert.looksNative expm1
assert.same expm1(NaN), NaN
assert.same expm1(0), 0
assert.same expm1(-0), -0
diff --git a/tests/tests/es6.math.fround.ls b/tests/tests/es6.math.fround.ls
index 2d27cc448e66..0652a41b1968 100644
--- a/tests/tests/es6.math.fround.ls
+++ b/tests/tests/es6.math.fround.ls
@@ -4,10 +4,10 @@ module \ES6
test 'Math.fround' (assert)->
# https://github.com/paulmillr/es6-shim/blob/master/test/math.js
{fround} = Math
- assert.ok typeof! fround is \Function, 'is function'
- assert.strictEqual fround.name, \fround, 'name is "fround"'
- assert.strictEqual fround.length, 1, 'arity is 1'
- assert.ok /native code/.test(fround), 'looks like native'
+ assert.isFunction fround
+ assert.name fround, \fround
+ assert.arity fround, 1
+ assert.looksNative fround
assert.same fround(void), NaN
assert.same fround(NaN), NaN
assert.same fround(0), 0
diff --git a/tests/tests/es6.math.hypot.ls b/tests/tests/es6.math.hypot.ls
index 91b949d6a6d0..e69572ea997e 100644
--- a/tests/tests/es6.math.hypot.ls
+++ b/tests/tests/es6.math.hypot.ls
@@ -3,10 +3,10 @@ module \ES6
# Math.hypot returns an implementation-dependent approximation of the square root of the sum of squares of its arguments.
test 'Math.hypot' (assert)->
{hypot, sqrt} = Math
- assert.ok typeof! hypot is \Function, 'is function'
- assert.strictEqual hypot.name, \hypot, 'name is "hypot"'
- assert.strictEqual hypot.length, 2, 'arity is 2'
- assert.ok /native code/.test(hypot), 'looks like native'
+ assert.isFunction hypot
+ assert.name hypot, \hypot
+ assert.arity hypot, 2
+ assert.looksNative hypot
assert.strictEqual hypot!, 0
assert.strictEqual hypot(1), 1
assert.same hypot('', 0), 0
diff --git a/tests/tests/es6.math.imul.ls b/tests/tests/es6.math.imul.ls
index 093a2efb0229..dbb7d28592ec 100644
--- a/tests/tests/es6.math.imul.ls
+++ b/tests/tests/es6.math.imul.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Math.imul' (assert)->
{imul} = Math
- assert.ok typeof! imul is \Function, 'is function'
- assert.strictEqual imul.name, \imul, 'name is "imul"'
- assert.strictEqual imul.length, 2, 'arity is 2'
- assert.ok /native code/.test(imul), 'looks like native'
+ assert.isFunction imul
+ assert.name imul, \imul
+ assert.arity imul, 2
+ assert.looksNative imul
assert.same imul(0, 0), 0
assert.strictEqual imul(123, 456), 56088
assert.strictEqual imul(-123, 456), -56088
diff --git a/tests/tests/es6.math.log10.ls b/tests/tests/es6.math.log10.ls
index 4aed5da28d15..b9b28ea593ea 100644
--- a/tests/tests/es6.math.log10.ls
+++ b/tests/tests/es6.math.log10.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the base 10 logarithm of x.
test 'Math.log10' (assert)->
{log10} = Math
- assert.ok typeof! log10 is \Function, 'is function'
- assert.strictEqual log10.name, \log10, 'name is "log10"'
- assert.strictEqual log10.length, 1, 'arity is 1'
- assert.ok /native code/.test(log10), 'looks like native'
+ assert.isFunction log10
+ assert.name log10, \log10
+ assert.arity log10, 1
+ assert.looksNative log10
assert.same log10(''), log10 0
assert.same log10(NaN), NaN
assert.same log10(-1), NaN
diff --git a/tests/tests/es6.math.log1p.ls b/tests/tests/es6.math.log1p.ls
index 5f523f00b33f..e9f87c0a94d6 100644
--- a/tests/tests/es6.math.log1p.ls
+++ b/tests/tests/es6.math.log1p.ls
@@ -4,10 +4,10 @@ module \ES6
# The result is computed in a way that is accurate even when the value of x is close to zero.
test 'Math.log1p' (assert)->
{log1p} = Math
- assert.ok typeof! log1p is \Function, 'is function'
- assert.strictEqual log1p.name, \log1p, 'name is "log1p"'
- assert.strictEqual log1p.length, 1, 'arity is 1'
- assert.ok /native code/.test(log1p), 'looks like native'
+ assert.isFunction log1p
+ assert.name log1p, \log1p
+ assert.arity log1p, 1
+ assert.looksNative log1p
assert.same log1p(''), log1p 0
assert.same log1p(NaN), NaN
assert.same log1p(-2), NaN
diff --git a/tests/tests/es6.math.log2.ls b/tests/tests/es6.math.log2.ls
index b8a8c975f82d..7c8e6b889ab5 100644
--- a/tests/tests/es6.math.log2.ls
+++ b/tests/tests/es6.math.log2.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the base 2 logarithm of x.
test 'Math.log2' (assert)->
{log2} = Math
- assert.ok typeof! log2 is \Function, 'is function'
- assert.strictEqual log2.name, \log2, 'name is "log2"'
- assert.strictEqual log2.length, 1, 'arity is 1'
- assert.ok /native code/.test(log2), 'looks like native'
+ assert.isFunction log2
+ assert.name log2, \log2
+ assert.arity log2, 1
+ assert.looksNative log2
assert.same log2(''), log2 0
assert.same log2(NaN), NaN
assert.same log2(-1), NaN
diff --git a/tests/tests/es6.math.sign.ls b/tests/tests/es6.math.sign.ls
index 0b2f33768751..7c592925a971 100644
--- a/tests/tests/es6.math.sign.ls
+++ b/tests/tests/es6.math.sign.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns the sign of the x, indicating whether x is positive, negative or zero.
test 'Math.sign' (assert)->
{sign} = Math
- assert.ok typeof! sign is \Function, 'is function'
- assert.strictEqual sign.name, \sign, 'name is "sign"'
- assert.strictEqual sign.length, 1, 'arity is 1'
- assert.ok /native code/.test(sign), 'looks like native'
+ assert.isFunction sign
+ assert.name sign, \sign
+ assert.arity sign, 1
+ assert.looksNative sign
assert.same sign(NaN), NaN
assert.same sign!, NaN
assert.same sign(-0), -0
diff --git a/tests/tests/es6.math.sinh.ls b/tests/tests/es6.math.sinh.ls
index 1f13635be908..5566b4f90ebd 100644
--- a/tests/tests/es6.math.sinh.ls
+++ b/tests/tests/es6.math.sinh.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the hyperbolic sine of x.
test 'Math.sinh' (assert)->
{sinh} = Math
- assert.ok typeof! sinh is \Function, 'is function'
- assert.strictEqual sinh.name, \sinh, 'name is "sinh"'
- assert.strictEqual sinh.length, 1, 'arity is 1'
- assert.ok /native code/.test(sinh), 'looks like native'
+ assert.isFunction sinh
+ assert.name sinh, \sinh
+ assert.arity sinh, 1
+ assert.looksNative sinh
assert.same sinh(NaN), NaN
assert.same sinh(0), 0
assert.same sinh(-0), -0
diff --git a/tests/tests/es6.math.tanh.ls b/tests/tests/es6.math.tanh.ls
index ed8017e9c8b1..aadfb28d2fea 100644
--- a/tests/tests/es6.math.tanh.ls
+++ b/tests/tests/es6.math.tanh.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns an implementation-dependent approximation to the hyperbolic tangent of x.
test 'Math.tanh' (assert)->
{tanh} = Math
- assert.ok typeof! tanh is \Function, 'is function'
- assert.strictEqual tanh.name, \tanh, 'name is "tanh"'
- assert.strictEqual tanh.length, 1, 'arity is 1'
- assert.ok /native code/.test(tanh), 'looks like native'
+ assert.isFunction tanh
+ assert.name tanh, \tanh
+ assert.arity tanh, 1
+ assert.looksNative tanh
assert.same tanh(NaN), NaN
assert.same tanh(0), 0
assert.same tanh(-0), -0
diff --git a/tests/tests/es6.math.trunc.ls b/tests/tests/es6.math.trunc.ls
index 163d6c0b35b6..719643dafa17 100644
--- a/tests/tests/es6.math.trunc.ls
+++ b/tests/tests/es6.math.trunc.ls
@@ -3,10 +3,10 @@ module \ES6
# Returns the integral part of the number x, removing any fractional digits. If x is already an integer, the result is x.
test 'Math.trunc' (assert)->
{trunc} = Math
- assert.ok typeof! trunc is \Function, 'is function'
- assert.strictEqual trunc.name, \trunc, 'name is "trunc"'
- assert.strictEqual trunc.length, 1, 'arity is 1'
- assert.ok /native code/.test(trunc), 'looks like native'
+ assert.isFunction trunc
+ assert.name trunc, \trunc
+ assert.arity trunc, 1
+ assert.looksNative trunc
assert.same trunc(NaN), NaN, 'NaN -> NaN'
assert.same trunc(-0), -0, '-0 -> -0'
assert.same trunc(0), 0, '0 -> 0'
diff --git a/tests/tests/es6.number.constructor.ls b/tests/tests/es6.number.constructor.ls
index 60d1af7eb2b9..e66779f16f9f 100644
--- a/tests/tests/es6.number.constructor.ls
+++ b/tests/tests/es6.number.constructor.ls
@@ -10,10 +10,10 @@ $check = (assert)-> (a, b)->
test 'Number constructor: regression' (assert)->
check = $check assert
- assert.ok typeof! Number is \Function, 'is function'
- assert.strictEqual Number.length, 1, 'arity is 1'
- assert.ok /native code/.test(Number), 'looks like native'
- assert.strictEqual Number.name, \Number, 'name is "Number"'
+ assert.isFunction Number
+ assert.arity Number, 1
+ assert.name Number, \Number
+ assert.looksNative Number
check 42, 42
check 42.42, 42.42
check new Number(42), 42
diff --git a/tests/tests/es6.number.is-finite.ls b/tests/tests/es6.number.is-finite.ls
index 715d05ba7207..a9be7fb557b9 100644
--- a/tests/tests/es6.number.is-finite.ls
+++ b/tests/tests/es6.number.is-finite.ls
@@ -4,10 +4,10 @@ module \ES6
test 'Number.isFinite' (assert)->
{isFinite} = Number
{create} = Object
- assert.ok typeof! isFinite is \Function, 'is function'
- assert.strictEqual isFinite.name, \isFinite, 'name is "isFinite"'
- assert.strictEqual isFinite.length, 1, 'arity is 1'
- assert.ok /native code/.test(isFinite), 'looks like native'
+ assert.isFunction isFinite
+ assert.name isFinite, \isFinite
+ assert.arity isFinite, 1
+ assert.looksNative isFinite
for [1 0.1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0]
assert.ok isFinite(..), "isFinite #{typeof ..} #{..}"
for [NaN, Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
diff --git a/tests/tests/es6.number.is-integer.ls b/tests/tests/es6.number.is-integer.ls
index 899eb5957f55..ce3bc5bb0beb 100644
--- a/tests/tests/es6.number.is-integer.ls
+++ b/tests/tests/es6.number.is-integer.ls
@@ -4,10 +4,10 @@ module \ES6
test 'Number.isInteger' (assert)->
{isInteger} = Number
{create} = Object
- assert.ok typeof! isInteger is \Function, 'is function'
- assert.strictEqual isInteger.name, \isInteger, 'name is "isInteger"'
- assert.strictEqual isInteger.length, 1, 'arity is 1'
- assert.ok /native code/.test(isInteger), 'looks like native'
+ assert.isFunction isInteger
+ assert.name isInteger, \isInteger
+ assert.arity isInteger, 1
+ assert.looksNative isInteger
for [1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0]
assert.ok isInteger(..), "isInteger #{typeof ..} #{..}"
for [NaN, 0.1, Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
diff --git a/tests/tests/es6.number.is-nan.ls b/tests/tests/es6.number.is-nan.ls
index 5efe0f94c88a..a36db7617b85 100644
--- a/tests/tests/es6.number.is-nan.ls
+++ b/tests/tests/es6.number.is-nan.ls
@@ -4,10 +4,10 @@ module \ES6
test 'Number.isNaN' (assert)->
{isNaN} = Number
{create} = Object
- assert.ok typeof! isNaN is \Function, 'is function'
- assert.strictEqual isNaN.name, \isNaN, 'name is "isNaN"'
- assert.strictEqual isNaN.length, 1, 'arity is 1'
- assert.ok /native code/.test(isNaN), 'looks like native'
+ assert.isFunction isNaN
+ assert.name isNaN, \isNaN
+ assert.arity isNaN, 1
+ assert.looksNative isNaN
assert.ok isNaN(NaN), 'Number.isNaN NaN'
for [1 0.1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0 Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
assert.ok not isNaN(..), "not Number.isNaN #{typeof ..} #{try String(..) catch e => 'Object.create(null)'}"
\ No newline at end of file
diff --git a/tests/tests/es6.number.is-safe-integer.ls b/tests/tests/es6.number.is-safe-integer.ls
index 86029bbc0982..9aa7861a437f 100644
--- a/tests/tests/es6.number.is-safe-integer.ls
+++ b/tests/tests/es6.number.is-safe-integer.ls
@@ -4,10 +4,10 @@ module \ES6
test 'Number.isSafeInteger' (assert)->
{isSafeInteger} = Number
{create} = Object
- assert.ok typeof! isSafeInteger is \Function, 'is function'
- assert.strictEqual isSafeInteger.name, \isSafeInteger, 'name is "isSafeInteger"'
- assert.strictEqual isSafeInteger.length, 1, 'arity is 1'
- assert.ok /native code/.test(isSafeInteger), 'looks like native'
+ assert.isFunction isSafeInteger
+ assert.name isSafeInteger, \isSafeInteger
+ assert.arity isSafeInteger, 1
+ assert.looksNative isSafeInteger
for [1 -1 2^16 2^16 - 1 2^31 2^31 - 1 2^32 2^32 - 1 -0 16~1fffffffffffff -16~1fffffffffffff]
assert.ok isSafeInteger(..), "isSafeInteger #{typeof ..} #{..}"
for [16~20000000000000 -16~20000000000000 NaN, 0.1, Infinity, \NaN, \5, no, new Number(NaN), new Number(Infinity), new Number(5), new Number(0.1), void, null, {}, ->, create(null)]
diff --git a/tests/tests/es6.number.parse-float.ls b/tests/tests/es6.number.parse-float.ls
index c7dc20d6767e..5b6a01a980f5 100644
--- a/tests/tests/es6.number.parse-float.ls
+++ b/tests/tests/es6.number.parse-float.ls
@@ -2,7 +2,7 @@
module \ES6
test 'Number.parseFloat' (assert)->
- assert.ok typeof! Number.parseFloat is \Function, 'is function'
- assert.strictEqual Number.parseFloat.name, \parseFloat, 'name is "parseFloat"'
- assert.strictEqual Number.parseFloat.length, 1, 'arity is 1'
- assert.ok /native code/.test(Number.parseFloat), 'looks like native'
\ No newline at end of file
+ assert.isFunction Number.parseFloat
+ assert.name Number.parseFloat, \parseFloat
+ assert.arity Number.parseFloat, 1
+ assert.looksNative Number.parseFloat
\ No newline at end of file
diff --git a/tests/tests/es6.number.parse-int.ls b/tests/tests/es6.number.parse-int.ls
index 3971cd7e1f0b..9f2d5ebbaa7d 100644
--- a/tests/tests/es6.number.parse-int.ls
+++ b/tests/tests/es6.number.parse-int.ls
@@ -2,7 +2,7 @@
module \ES6
test 'Number.parseInt' (assert)->
- assert.ok typeof! Number.parseInt is \Function, 'is function'
- assert.strictEqual Number.parseInt.name, \parseInt, 'name is "parseInt"'
- assert.strictEqual Number.parseInt.length, 2, 'arity is 2'
- assert.ok /native code/.test(Number.parseInt), 'looks like native'
\ No newline at end of file
+ assert.isFunction Number.parseInt
+ assert.name Number.parseInt, \parseInt
+ assert.arity Number.parseInt, 2
+ assert.looksNative Number.parseInt
\ No newline at end of file
diff --git a/tests/tests/es6.object.assign.ls b/tests/tests/es6.object.assign.ls
index d8fd365620ab..53803b495c97 100644
--- a/tests/tests/es6.object.assign.ls
+++ b/tests/tests/es6.object.assign.ls
@@ -5,10 +5,10 @@ descriptors = (-> try 2 == Object.defineProperty({}, \a, get: -> 2)a)!
test 'Object.assign' (assert)->
{assign, keys, defineProperty} = Object
- assert.ok typeof! assign is \Function, 'is function'
- assert.strictEqual assign.length, 2, 'arity is 2'
- assert.strictEqual assign.name, \assign, 'name is "assign"'
- assert.ok /native code/.test(assign), 'looks like native'
+ assert.isFunction assign
+ assert.arity assign, 2
+ assert.name assign, \assign
+ assert.looksNative assign
foo = q: 1
assert.strictEqual foo, assign(foo, bar: 2), 'assign return target'
assert.strictEqual foo.bar, 2, 'assign define properties'
diff --git a/tests/tests/es6.object.is.ls b/tests/tests/es6.object.is.ls
index 7a7bf5373246..46c62c885f26 100644
--- a/tests/tests/es6.object.is.ls
+++ b/tests/tests/es6.object.is.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Object.is' (assert)->
same = Object.is
- assert.ok typeof! same is \Function, 'is function'
- assert.strictEqual same.length, 2, 'arity is 2'
- assert.strictEqual same.name, \is, 'name is "is"'
- assert.ok /native code/.test(same), 'looks like native'
+ assert.isFunction same
+ assert.arity same, 2
+ assert.name same, \is
+ assert.looksNative same
assert.ok same(1 1), '1 is 1'
assert.ok same(NaN, NaN), '1 is 1'
assert.ok not same(0 -0), '0 isnt -0'
diff --git a/tests/tests/es6.object.set-prototype-of.ls b/tests/tests/es6.object.set-prototype-of.ls
index cfb0b8d8f0fc..bf2b6452bd8a 100644
--- a/tests/tests/es6.object.set-prototype-of.ls
+++ b/tests/tests/es6.object.set-prototype-of.ls
@@ -4,10 +4,10 @@ if Object.setPrototypeOf or '__proto__' of Object::
test 'Object.setPrototypeOf' (assert)->
{setPrototypeOf} = Object
- assert.ok typeof! setPrototypeOf is \Function, 'is function'
- assert.strictEqual setPrototypeOf.length, 2, 'arity is 2'
- assert.strictEqual setPrototypeOf.name, \setPrototypeOf, 'name is "setPrototypeOf"'
- assert.ok /native code/.test(setPrototypeOf), 'looks like native'
+ assert.isFunction setPrototypeOf
+ assert.arity setPrototypeOf, 2
+ assert.name setPrototypeOf, \setPrototypeOf
+ assert.looksNative setPrototypeOf
assert.ok \apply of setPrototypeOf({} Function::), 'Parent properties in target'
assert.strictEqual setPrototypeOf(a:2, {b: -> @a^2})b!, 4, 'Child and parent properties in target'
assert.strictEqual setPrototypeOf(tmp = {}, {a: 1}), tmp, 'setPrototypeOf return target'
diff --git a/tests/tests/es6.object.to-string.ls b/tests/tests/es6.object.to-string.ls
index 3dd2a1aeaaa9..cc0335943a71 100644
--- a/tests/tests/es6.object.to-string.ls
+++ b/tests/tests/es6.object.to-string.ls
@@ -4,9 +4,9 @@
module \ES6
test 'Object#toString' (assert)->
- assert.strictEqual Object::toString.length, 0, 'arity is 0'
- assert.strictEqual Object::toString.name, \toString, 'name is "toString"'
- assert.ok /native code/.test(Object::toString), 'looks like native'
+ assert.arity Object::toString, 0
+ assert.name Object::toString, \toString
+ assert.looksNative Object::toString
{toString} = Object::
if !(-> @)!
assert.strictEqual toString.call(null), '[object Null]', 'classof null is `Null`'
diff --git a/tests/tests/es6.promise.ls b/tests/tests/es6.promise.ls
index 3d07a378054b..e70ca94fbad0 100644
--- a/tests/tests/es6.promise.ls
+++ b/tests/tests/es6.promise.ls
@@ -1,35 +1,34 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
{iterator} = Symbol
test 'Promise' (assert)->
- assert.ok isFunction((global? && global || window)Promise), 'is function'
- assert.strictEqual Promise.length, 1, 'arity is 1'
- assert.strictEqual Promise.name, \Promise, 'name is "Promise"'
- assert.ok /native code/.test(Promise), 'looks like native'
+ assert.isFunction Promise
+ assert.arity Promise, 1
+ assert.name Promise, \Promise
+ assert.looksNative Promise
test 'Promise#then' (assert)->
- assert.ok isFunction(Promise::then), 'is function'
- assert.strictEqual Promise::then.length, 2, 'arity is 2'
- assert.strictEqual Promise::then.name, \then, 'name is "then"'
- assert.ok /native code/.test(Promise::then), 'looks like native'
+ assert.isFunction Promise::then
+ assert.arity Promise::then, 2
+ assert.name Promise::then, \then
+ assert.looksNative Promise::then
test 'Promise#catch' (assert)->
- assert.ok isFunction(Promise::catch), 'is function'
- assert.strictEqual Promise::catch.length, 1, 'arity is 1'
- #assert.strictEqual Promise::catch.name, \catch, 'name is "catch"' # can't be polyfilled in some environments
- assert.ok /native code/.test(Promise::then), 'looks like native'
+ assert.isFunction Promise::catch
+ assert.arity Promise::catch, 1
+ #assert.name Promise::catch, \catch # can't be polyfilled in some environments
+ assert.looksNative Promise::then
test 'Promise#@@toStringTag' (assert)->
assert.ok Promise::[Symbol.toStringTag] is \Promise, 'Promise::@@toStringTag is `Promise`'
test 'Promise.all' (assert)->
- assert.ok isFunction(Promise.all), 'is function'
- assert.strictEqual Promise.all.length, 1, 'arity is 1'
- assert.strictEqual Promise.all.name, \all, 'name is "all"'
- assert.ok /native code/.test(Promise.all), 'looks like native'
+ assert.isFunction Promise.all
+ assert.arity Promise.all, 1
+ assert.name Promise.all, \all
+ assert.looksNative Promise.all
# works with iterables
passed = no
iter = [1 2 3].values!
@@ -49,10 +48,10 @@ test 'Promise.all' (assert)->
assert.ok done
test 'Promise.race' (assert)->
- assert.ok isFunction(Promise.race), 'is function'
- assert.strictEqual Promise.race.length, 1, 'arity is 1'
- assert.strictEqual Promise.race.name, \race, 'name is "race"'
- assert.ok /native code/.test(Promise.race), 'looks like native'
+ assert.isFunction Promise.race
+ assert.arity Promise.race, 1
+ assert.name Promise.race, \race
+ assert.looksNative Promise.race
# works with iterables
passed = no
iter = [1 2 3].values!
@@ -72,16 +71,16 @@ test 'Promise.race' (assert)->
assert.ok done
test 'Promise.resolve' (assert)->
- assert.ok isFunction(Promise.resolve), 'is function'
- assert.strictEqual Promise.resolve.length, 1, 'arity is 1'
- assert.strictEqual Promise.resolve.name, \resolve, 'name is "resolve"'
- assert.ok /native code/.test(Promise.resolve), 'looks like native'
+ assert.isFunction Promise.resolve
+ assert.arity Promise.resolve, 1
+ assert.name Promise.resolve, \resolve
+ assert.looksNative Promise.resolve
test 'Promise.reject' (assert)->
- assert.ok isFunction(Promise.reject), 'is function'
- assert.strictEqual Promise.reject.length, 1, 'arity is 1'
- assert.strictEqual Promise.reject.name, \reject, 'name is "reject"'
- assert.ok /native code/.test(Promise.reject), 'looks like native'
+ assert.isFunction Promise.reject
+ assert.arity Promise.reject, 1
+ assert.name Promise.reject, \reject
+ assert.looksNative Promise.reject
if Object.setPrototypeOf
test 'Promise subclassing' (assert)->
diff --git a/tests/tests/es6.reflect.apply.ls b/tests/tests/es6.reflect.apply.ls
index 2018184b6c83..783a7bee04bc 100644
--- a/tests/tests/es6.reflect.apply.ls
+++ b/tests/tests/es6.reflect.apply.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Reflect.apply' (assert)->
{apply} = Reflect
- assert.ok typeof! apply is \Function, 'is function'
- assert.strictEqual apply.length, 3, 'arity is 3'
- assert.ok /native code/.test(apply), 'looks like native'
- assert.strictEqual apply.name, \apply, 'name is "apply"'
+ assert.isFunction apply
+ assert.arity apply, 3
+ assert.name apply, \apply
+ assert.looksNative apply
assert.strictEqual apply(Array::push, [1 2], [3 4 5]), 5
C = (a, b, c)-> a + b + c
C.apply = 42
diff --git a/tests/tests/es6.reflect.construct.ls b/tests/tests/es6.reflect.construct.ls
index 1bcd041eb587..70d87d251468 100644
--- a/tests/tests/es6.reflect.construct.ls
+++ b/tests/tests/es6.reflect.construct.ls
@@ -5,10 +5,10 @@ module \ES6
test 'Reflect.construct' (assert)->
{construct} = Reflect
- assert.ok typeof! construct is \Function, 'is function'
- assert.strictEqual construct.length, 2, 'arity is 2'
- assert.ok /native code/.test(construct), 'looks like native'
- assert.strictEqual construct.name, \construct, 'name is "construct"'
+ assert.isFunction construct
+ assert.arity construct, 2
+ assert.name construct, \construct
+ assert.looksNative construct
C = (a, b, c)-> @qux = a + b + c
assert.strictEqual construct(C, <[foo bar baz]>).qux, \foobarbaz, \basic
C.apply = 42
diff --git a/tests/tests/es6.reflect.define-property.ls b/tests/tests/es6.reflect.define-property.ls
index c0c78ae1ee5f..9e90979b428d 100644
--- a/tests/tests/es6.reflect.define-property.ls
+++ b/tests/tests/es6.reflect.define-property.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.defineProperty' (assert)->
{defineProperty} = Reflect
- assert.ok typeof! defineProperty is \Function, 'is function'
- assert.strictEqual defineProperty.length, 3, 'arity is 3'
- assert.ok /native code/.test(defineProperty), 'looks like native'
- assert.strictEqual defineProperty.name, \defineProperty, 'name is "defineProperty"'
+ assert.isFunction defineProperty
+ assert.arity defineProperty, 3
+ assert.name defineProperty, \defineProperty
+ assert.looksNative defineProperty
O = {}
assert.strictEqual defineProperty(O, \foo, {value: 123}), on
assert.strictEqual O.foo, 123
diff --git a/tests/tests/es6.reflect.delete-property.ls b/tests/tests/es6.reflect.delete-property.ls
index 9fb08c3dc3ee..da4c63f10ffb 100644
--- a/tests/tests/es6.reflect.delete-property.ls
+++ b/tests/tests/es6.reflect.delete-property.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.deleteProperty' (assert)->
{deleteProperty} = Reflect
- assert.ok typeof! deleteProperty is \Function, 'is function'
- assert.strictEqual deleteProperty.length, 2, 'arity is 2'
- assert.ok /native code/.test(deleteProperty), 'looks like native'
- assert.strictEqual deleteProperty.name, \deleteProperty, 'name is "deleteProperty"'
+ assert.isFunction deleteProperty
+ assert.arity deleteProperty, 2
+ assert.name deleteProperty, \deleteProperty
+ assert.looksNative deleteProperty
O = {bar: 456}
assert.strictEqual deleteProperty(O, \bar), on
assert.ok \bar not in O
diff --git a/tests/tests/es6.reflect.enumerate.ls b/tests/tests/es6.reflect.enumerate.ls
index 8dd0567c9e33..daebeffe7659 100644
--- a/tests/tests/es6.reflect.enumerate.ls
+++ b/tests/tests/es6.reflect.enumerate.ls
@@ -8,10 +8,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.enumerate' (assert)->
{enumerate} = Reflect
{iterator} = Symbol
- assert.ok typeof! enumerate is \Function, 'is function'
- assert.strictEqual enumerate.length, 1, 'arity is 1'
- assert.ok /native code/.test(enumerate), 'looks like native'
- assert.strictEqual enumerate.name, \enumerate, 'name is "enumerate"'
+ assert.isFunction enumerate
+ assert.arity enumerate, 1
+ assert.name enumerate, \enumerate
+ assert.looksNative enumerate
obj = {foo: 1, bar: 2}
i = enumerate obj
assert.ok iterator of i, 'returns iterator'
diff --git a/tests/tests/es6.reflect.get-own-property-descriptor.ls b/tests/tests/es6.reflect.get-own-property-descriptor.ls
index 0246d1a875a8..b294d4530afb 100644
--- a/tests/tests/es6.reflect.get-own-property-descriptor.ls
+++ b/tests/tests/es6.reflect.get-own-property-descriptor.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Reflect.getOwnPropertyDescriptor' (assert)->
{getOwnPropertyDescriptor} = Reflect
- assert.ok typeof! getOwnPropertyDescriptor is \Function, 'is function'
- assert.strictEqual getOwnPropertyDescriptor.length, 2, 'arity is 2'
- assert.ok /native code/.test(getOwnPropertyDescriptor), 'looks like native'
- assert.strictEqual getOwnPropertyDescriptor.name, \getOwnPropertyDescriptor, 'name is "getOwnPropertyDescriptor"'
+ assert.isFunction getOwnPropertyDescriptor
+ assert.arity getOwnPropertyDescriptor, 2
+ assert.name getOwnPropertyDescriptor, \getOwnPropertyDescriptor
+ assert.looksNative getOwnPropertyDescriptor
obj = {baz: 789}
desc = getOwnPropertyDescriptor obj, \baz
assert.strictEqual desc.value, 789
diff --git a/tests/tests/es6.reflect.get-prototype-of.ls b/tests/tests/es6.reflect.get-prototype-of.ls
index 9ea13122bb62..edca034eae1d 100644
--- a/tests/tests/es6.reflect.get-prototype-of.ls
+++ b/tests/tests/es6.reflect.get-prototype-of.ls
@@ -3,9 +3,9 @@ module \ES6
test 'Reflect.getPrototypeOf' (assert)->
{getPrototypeOf} = Reflect
- assert.ok typeof! getPrototypeOf is \Function, 'is function'
- assert.strictEqual getPrototypeOf.length, 1, 'arity is 1'
- assert.ok /native code/.test(getPrototypeOf), 'looks like native'
- assert.strictEqual getPrototypeOf.name, \getPrototypeOf, 'name is "getPrototypeOf"'
+ assert.isFunction getPrototypeOf
+ assert.arity getPrototypeOf, 1
+ assert.name getPrototypeOf, \getPrototypeOf
+ assert.looksNative getPrototypeOf
assert.strictEqual getPrototypeOf([]), Array::
assert.throws (-> getPrototypeOf 42), TypeError, 'throws on primitive'
\ No newline at end of file
diff --git a/tests/tests/es6.reflect.get.ls b/tests/tests/es6.reflect.get.ls
index cae9c33559f8..12a0cbf51684 100644
--- a/tests/tests/es6.reflect.get.ls
+++ b/tests/tests/es6.reflect.get.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.get' (assert)->
{get} = Reflect
- assert.ok typeof! get is \Function, 'is function'
- #assert.strictEqual get.length, 2, 'arity is 2' # fails in MS Edge
- assert.ok /native code/.test(get), 'looks like native'
- assert.strictEqual get.name, \get, 'name is "get"'
+ assert.isFunction get
+ #assert.arity get, 2 # fails in MS Edge
+ assert.name get, \get
+ assert.looksNative get
assert.strictEqual get({qux: 987}, \qux), 987
if MODERN
target = create defineProperty({z:3}, \w, {get: -> @}), do
diff --git a/tests/tests/es6.reflect.has.ls b/tests/tests/es6.reflect.has.ls
index 91de94ff44ef..6364377ec915 100644
--- a/tests/tests/es6.reflect.has.ls
+++ b/tests/tests/es6.reflect.has.ls
@@ -3,10 +3,10 @@ module \ES6
test 'Reflect.has' (assert)->
{has} = Reflect
- assert.ok typeof! has is \Function, 'is function'
- assert.strictEqual has.length, 2, 'arity is 2'
- assert.ok /native code/.test(has), 'looks like native'
- assert.strictEqual has.name, \has, 'name is "has"'
+ assert.isFunction has
+ assert.arity has, 2
+ assert.name has, \has
+ assert.looksNative has
O = {qux: 987}
assert.strictEqual has(O, \qux), on
assert.strictEqual has(O, \qwe), no
diff --git a/tests/tests/es6.reflect.is-extensible.ls b/tests/tests/es6.reflect.is-extensible.ls
index 16d1cd6d37d1..7065be6fc210 100644
--- a/tests/tests/es6.reflect.is-extensible.ls
+++ b/tests/tests/es6.reflect.is-extensible.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.isExtensible' (assert)->
{isExtensible} = Reflect
- assert.ok typeof! isExtensible is \Function, 'is function'
- assert.strictEqual isExtensible.length, 1, 'arity is 1'
- assert.ok /native code/.test(isExtensible), 'looks like native'
- assert.strictEqual isExtensible.name, \isExtensible, 'name is "isExtensible"'
+ assert.isFunction isExtensible
+ assert.arity isExtensible, 1
+ assert.name isExtensible, \isExtensible
+ assert.looksNative isExtensible
assert.ok isExtensible {}
if MODERN
assert.ok !isExtensible preventExtensions {}
diff --git a/tests/tests/es6.reflect.own-keys.ls b/tests/tests/es6.reflect.own-keys.ls
index a3948a1476f8..c4922baf8bc0 100644
--- a/tests/tests/es6.reflect.own-keys.ls
+++ b/tests/tests/es6.reflect.own-keys.ls
@@ -6,10 +6,10 @@ module \ES6
test 'Reflect.ownKeys' (assert)->
{ownKeys} = Reflect
sym = Symbol \c
- assert.ok typeof! ownKeys is \Function, 'is function'
- assert.strictEqual ownKeys.length, 1, 'arity is 1'
- assert.ok /native code/.test(ownKeys), 'looks like native'
- assert.strictEqual ownKeys.name, \ownKeys, 'name is "ownKeys"'
+ assert.isFunction ownKeys
+ assert.arity ownKeys, 1
+ assert.name ownKeys, \ownKeys
+ assert.looksNative ownKeys
O1 = {a: 1}
defineProperty O1, \b, value: 2
O1[sym] = 3
diff --git a/tests/tests/es6.reflect.prevent-extensions.ls b/tests/tests/es6.reflect.prevent-extensions.ls
index 00a1782b2d43..5f502700920c 100644
--- a/tests/tests/es6.reflect.prevent-extensions.ls
+++ b/tests/tests/es6.reflect.prevent-extensions.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.preventExtensions' (assert)->
{preventExtensions} = Reflect
- assert.ok typeof! preventExtensions is \Function, 'is function'
- assert.strictEqual preventExtensions.length, 1, 'arity is 1'
- assert.ok /native code/.test(preventExtensions), 'looks like native'
- assert.strictEqual preventExtensions.name, \preventExtensions, 'name is "preventExtensions"'
+ assert.isFunction preventExtensions
+ assert.arity preventExtensions, 1
+ assert.name preventExtensions, \preventExtensions
+ assert.looksNative preventExtensions
obj = {}
assert.ok preventExtensions(obj), on
if MODERN
diff --git a/tests/tests/es6.reflect.set-prototype-of.ls b/tests/tests/es6.reflect.set-prototype-of.ls
index 2d183171acef..13831902eac9 100644
--- a/tests/tests/es6.reflect.set-prototype-of.ls
+++ b/tests/tests/es6.reflect.set-prototype-of.ls
@@ -4,10 +4,10 @@ if Object.setPrototypeOf || '__proto__' of {}
test 'Reflect.setPrototypeOf' (assert)->
{setPrototypeOf} = Reflect
- assert.ok typeof! setPrototypeOf is \Function, 'is function'
- #assert.strictEqual setPrototypeOf.length, 2, 'arity is 2' # fails in MS Edge
- assert.ok /native code/.test(setPrototypeOf), 'looks like native'
- assert.strictEqual setPrototypeOf.name, \setPrototypeOf, 'name is "setPrototypeOf"'
+ assert.isFunction setPrototypeOf
+ #assert.arity setPrototypeOf, 2 # fails in MS Edge
+ assert.name setPrototypeOf, \setPrototypeOf
+ assert.looksNative setPrototypeOf
obj = {}
assert.ok setPrototypeOf(obj, Array::), on
assert.ok obj instanceof Array
diff --git a/tests/tests/es6.reflect.set.ls b/tests/tests/es6.reflect.set.ls
index 68b3a8747869..c70c1a9fcf3e 100644
--- a/tests/tests/es6.reflect.set.ls
+++ b/tests/tests/es6.reflect.set.ls
@@ -6,10 +6,10 @@ MODERN = (-> try 2 == defineProperty({}, \a, get: -> 2)a)!
test 'Reflect.set' (assert)->
{set} = Reflect
- assert.ok typeof! set is \Function, 'is function'
- #assert.strictEqual set.length, 3, 'arity is 3' # fails in MS Edge
- assert.ok /native code/.test(set), 'looks like native'
- assert.strictEqual set.name, \set, 'name is "set"'
+ assert.isFunction set
+ #assert.arity set, 3 # fails in MS Edge
+ assert.name set, \set
+ assert.looksNative set
obj = {}
assert.ok set(obj, \quux, 654), on
assert.strictEqual obj.quux, 654
diff --git a/tests/tests/es6.regexp.constructor.ls b/tests/tests/es6.regexp.constructor.ls
index 26ccc6aa88e3..a1ecda9d91ba 100644
--- a/tests/tests/es6.regexp.constructor.ls
+++ b/tests/tests/es6.regexp.constructor.ls
@@ -3,10 +3,10 @@ module \ES6
if (-> try 2 == Object.defineProperty({}, \a, get: -> 2)a)!
test 'RegExp constructor' (assert)->
- assert.strictEqual typeof! RegExp, \Function, 'is function'
- assert.strictEqual RegExp.length, 2, 'arity is 2'
- assert.ok /native code/.test(RegExp), 'looks like native'
- assert.strictEqual RegExp.name, \RegExp, 'name is "RegExp"'
+ assert.isFunction RegExp
+ assert.arity RegExp, 2
+ assert.name RegExp, \RegExp
+ assert.looksNative RegExp
assert.strictEqual typeof! RegExp!, \RegExp
assert.strictEqual typeof! new RegExp!, \RegExp
re = /a/g
diff --git a/tests/tests/es6.regexp.match.ls b/tests/tests/es6.regexp.match.ls
index e2a29a51ee2d..20af83f5d7d4 100644
--- a/tests/tests/es6.regexp.match.ls
+++ b/tests/tests/es6.regexp.match.ls
@@ -4,10 +4,10 @@ module \ES6
global = Function('return this')!
test 'String#match regression' (assert)->
- assert.ok typeof! ''match is \Function, 'is function'
- assert.strictEqual ''match.length, 1, 'arity is 1'
- assert.ok /native code/.test(''match), 'looks like native'
- assert.strictEqual ''match.name, \match, 'name is "match"'
+ assert.isFunction ''match
+ assert.arity ''match, 1
+ assert.name ''match, \match
+ assert.looksNative ''match
# based on https://github.com/tc39/test262/tree/master/test/built-ins/String/prototype/match
instance = Object on
instance.match = String::match
@@ -165,8 +165,8 @@ test 'String#match regression' (assert)->
assert.strictEqual ''match.call(num, re)input, String(num), 'S15.5.4.10_A2_T18 #4'
test 'RegExp#@@match' (assert)->
- assert.ok typeof! /./[Symbol.match] is \Function, 'is function'
- assert.strictEqual /./[Symbol.match].length, 1, 'arity is 1'
+ assert.isFunction /./[Symbol.match]
+ assert.arity /./[Symbol.match], 1
string = "Boston, MA 02134"
matches = [\02134 \02134 void]
assert.strictEqual /([\d]{5})([-\ ]?[\d]{4})?$/[Symbol.match](string).length, 3
diff --git a/tests/tests/es6.regexp.replace.ls b/tests/tests/es6.regexp.replace.ls
index d8938967ce3c..f76fa69bf010 100644
--- a/tests/tests/es6.regexp.replace.ls
+++ b/tests/tests/es6.regexp.replace.ls
@@ -2,10 +2,10 @@
module \ES6
test 'String#replace regression' (assert)->
- assert.ok typeof! ''replace is \Function, 'is function'
- assert.strictEqual ''replace.length, 2, 'arity is 2'
- assert.ok /native code/.test(''replace), 'looks like native'
- assert.strictEqual ''replace.name, \replace, 'name is "replace"'
+ assert.isFunction ''replace
+ assert.arity ''replace, 2
+ assert.name ''replace, \replace
+ assert.looksNative ''replace
# based on https://github.com/tc39/test262/tree/master/test/built-ins/String/prototype/replace
instance = Object true
instance.replace = String::replace
@@ -69,8 +69,8 @@ test 'String#replace regression' (assert)->
assert.strictEqual 'aaaaaaaaaa,aaaaaaaaaaaaaaa'replace(/^(a+)\1*,\1+$/, '$1'), \aaaaa, 'S15.5.4.11_A5_T1'
test 'RegExp#@@replace' (assert)->
- assert.ok typeof! /./[Symbol.replace] is \Function, 'is function'
- assert.strictEqual /./[Symbol.replace].length, 2, 'arity is 2'
+ assert.isFunction /./[Symbol.replace]
+ assert.arity /./[Symbol.replace], 2
assert.strictEqual /([a-z]+)([0-9]+)/[Symbol.replace]('abc12 def34', -> &.2 + &.1), '12abc def34'
test '@@replace logic' (assert)->
diff --git a/tests/tests/es6.regexp.search.ls b/tests/tests/es6.regexp.search.ls
index 9aae6268edb7..6841fdab619d 100644
--- a/tests/tests/es6.regexp.search.ls
+++ b/tests/tests/es6.regexp.search.ls
@@ -2,10 +2,10 @@
module \ES6
test 'String#search regression' (assert)->
- assert.ok typeof! ''search is \Function, 'is function'
- assert.strictEqual ''search.length, 1, 'arity is 1'
- assert.ok /native code/.test(''search), 'looks like native'
- assert.strictEqual ''search.name, \search, 'name is "search"'
+ assert.isFunction ''search
+ assert.arity ''search, 1
+ assert.name ''search, \search
+ assert.looksNative ''search
# based on https://github.com/tc39/test262/tree/master/test/built-ins/String/prototype/search
instance = Object on
instance.search = String::search
@@ -45,8 +45,8 @@ test 'String#search regression' (assert)->
assert.strictEqual aString.search(/of/), aString.search(/of/g), 'S15.5.4.12_A3_T2'
test 'RegExp#@@search' (assert)->
- assert.ok typeof! /./[Symbol.search] is \Function, 'is function'
- assert.strictEqual /./[Symbol.search].length, 1, 'arity is 1'
+ assert.isFunction /./[Symbol.search]
+ assert.arity /./[Symbol.search], 1
assert.strictEqual /four/[Symbol.search]('one two three four five'), 14
assert.strictEqual /Four/[Symbol.search]('one two three four five'), -1
diff --git a/tests/tests/es6.regexp.split.ls b/tests/tests/es6.regexp.split.ls
index a86ea6c09ba9..f1cd89963fd1 100644
--- a/tests/tests/es6.regexp.split.ls
+++ b/tests/tests/es6.regexp.split.ls
@@ -2,10 +2,10 @@
module \ES6
test 'String#split regression' (assert)->
- assert.ok typeof! ''split is \Function, 'is function'
- assert.strictEqual ''split.length, 2, 'arity is 2'
- assert.ok /native code/.test(''split), 'looks like native'
- assert.strictEqual ''split.name, \split, 'name is "split"'
+ assert.isFunction ''split
+ assert.arity ''split, 2
+ assert.name ''split, \split
+ assert.looksNative ''split
# based on https://github.com/tc39/test262/tree/master/test/built-ins/String/prototype/split
instance = Object on
instance.split = String::split
@@ -518,8 +518,8 @@ test 'String#split regression' (assert)->
*/
test 'RegExp#@@split' (assert)->
- assert.ok typeof! /./[Symbol.split] is \Function, 'is function'
- assert.strictEqual /./[Symbol.split].length, 2, 'arity is 2'
+ assert.isFunction /./[Symbol.split]
+ assert.arity /./[Symbol.split], 2
assert.strictEqual /\s/[Symbol.split]('a b c de f').length, 5
assert.strictEqual /\s/[Symbol.split]('a b c de f' void).length, 5
assert.strictEqual /\s/[Symbol.split]('a b c de f' 1).length, 1
diff --git a/tests/tests/es6.set.ls b/tests/tests/es6.set.ls
index bd4fc86231cc..b2f835436ea4 100644
--- a/tests/tests/es6.set.ls
+++ b/tests/tests/es6.set.ls
@@ -1,18 +1,17 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
same = (a, b)-> if a is b => a isnt 0 or 1 / a is 1 / b else a !~= a and b !~= b
{getOwnPropertyDescriptor, freeze} = Object
{iterator} = Symbol
test 'Set' (assert)->
- assert.ok isFunction(Set), 'is function'
- assert.ok /native code/.test(Set), 'looks like native'
- assert.strictEqual Set.name, \Set, 'name is "Set"'
- assert.strictEqual Set.length, 0, 'arity is 0'
+ assert.isFunction Set
+ assert.name Set, \Set
+ assert.arity Set, 0
+ assert.looksNative Set
assert.ok \add of Set::, 'add in Set.prototype'
assert.ok \clear of Set::, 'clear in Set.prototype'
assert.ok \delete of Set::, 'delete in Set.prototype'
@@ -48,10 +47,10 @@ test 'Set' (assert)->
assert.ok done
test 'Set#add' (assert)->
- assert.ok isFunction(Set::add), 'is function'
- assert.strictEqual Set::add.name, \add, 'name is "add"'
- assert.strictEqual Set::add.length, 1, 'arity is 1'
- assert.ok /native code/.test(Set::add), 'looks like native'
+ assert.isFunction Set::add
+ assert.name Set::add, \add
+ assert.arity Set::add, 1
+ assert.looksNative Set::add
a = []
S = new Set [NaN, 2 3 2 1 a]
assert.strictEqual S.size, 5
@@ -70,10 +69,10 @@ test 'Set#add' (assert)->
assert.ok S.has f
test 'Set#clear' (assert)->
- assert.ok isFunction(Set::clear), 'is function'
- assert.strictEqual Set::clear.name, \clear, 'name is "clear"'
- assert.strictEqual Set::clear.length, 0, 'arity is 0'
- assert.ok /native code/.test(Set::clear), 'looks like native'
+ assert.isFunction Set::clear
+ assert.name Set::clear, \clear
+ assert.arity Set::clear, 0
+ assert.looksNative Set::clear
S = new Set
S.clear!
assert.strictEqual S.size, 0
@@ -90,10 +89,10 @@ test 'Set#clear' (assert)->
assert.ok !S.has f
test 'Set#delete' (assert)->
- assert.ok isFunction(Set::delete), 'is function'
- #assert.strictEqual Set::delete.name, \delete, 'name is "delete"' # can't be polyfilled in some environments
- assert.strictEqual Set::delete.length, 1, 'arity is 1'
- assert.ok /native code/.test(Set::delete), 'looks like native'
+ assert.isFunction Set::delete
+ #assert.name Set::delete, \delete # can't be polyfilled in some environments
+ assert.arity Set::delete, 1
+ assert.looksNative Set::delete
a = []
S = new Set [NaN, 2 3 2 1 a]
assert.strictEqual S.size, 5
@@ -111,10 +110,10 @@ test 'Set#delete' (assert)->
assert.strictEqual S.size, 3
test 'Set#forEach' (assert)->
- assert.ok isFunction(Set::forEach), 'is function'
- assert.strictEqual Set::forEach.name, \forEach, 'name is "forEach"'
- assert.strictEqual Set::forEach.length, 1, 'arity is 1'
- assert.ok /native code/.test(Set::forEach), 'looks like native'
+ assert.isFunction Set::forEach
+ assert.name Set::forEach, \forEach
+ assert.arity Set::forEach, 1
+ assert.looksNative Set::forEach
r = []
count = 0
S = new Set [1 2 3 2 1]
@@ -142,10 +141,10 @@ test 'Set#forEach' (assert)->
assert.strictEqual s, \0
test 'Set#has' (assert)->
- assert.ok isFunction(Set::has), 'is function'
- assert.strictEqual Set::has.name, \has, 'name is "has"'
- assert.strictEqual Set::has.length, 1, 'arity is 1'
- assert.ok /native code/.test(Set::has), 'looks like native'
+ assert.isFunction Set::has
+ assert.name Set::has, \has
+ assert.arity Set::has, 1
+ assert.looksNative Set::has
a = []
f = freeze {}
S = new Set [NaN, 2 3 2 1 f, a]
@@ -201,9 +200,9 @@ test 'Set Iterator' (assert)->
test 'Set#keys' (assert)->
assert.ok typeof Set::keys is \function, 'is function'
- assert.strictEqual Set::keys.name, \values, 'name is "values"'
- assert.strictEqual Set::keys.length, 0, 'arity is 0'
- assert.ok /native code/.test(Set::keys), 'looks like native'
+ assert.name Set::keys, \values
+ assert.arity Set::keys, 0
+ assert.looksNative Set::keys
assert.strictEqual Set::keys, Set::values
iter = new Set(<[q w e]>)keys!
assert.ok isIterator(iter), 'Return iterator'
@@ -215,9 +214,9 @@ test 'Set#keys' (assert)->
test 'Set#values' (assert)->
assert.ok typeof Set::values is \function, 'is function'
- assert.strictEqual Set::values.name, \values, 'name is "values"'
- assert.strictEqual Set::values.length, 0, 'arity is 0'
- assert.ok /native code/.test(Set::values), 'looks like native'
+ assert.name Set::values, \values
+ assert.arity Set::values, 0
+ assert.looksNative Set::values
iter = new Set(<[q w e]>)values!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Set Iterator'
@@ -228,9 +227,9 @@ test 'Set#values' (assert)->
test 'Set#entries' (assert)->
assert.ok typeof Set::entries is \function, 'is function'
- assert.strictEqual Set::entries.name, \entries, 'name is "entries"'
- assert.strictEqual Set::entries.length, 0, 'arity is 0'
- assert.ok /native code/.test(Set::entries), 'looks like native'
+ assert.name Set::entries, \entries
+ assert.arity Set::entries, 0
+ assert.looksNative Set::entries
iter = new Set(<[q w e]>)entries!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'Set Iterator'
@@ -241,9 +240,9 @@ test 'Set#entries' (assert)->
test 'Set#@@iterator' (assert)->
assert.ok typeof Set::[Symbol?iterator] is \function, 'is function'
- assert.strictEqual Set::[Symbol?iterator].name, \values, 'name is "values"'
- assert.strictEqual Set::[Symbol?iterator].length, 0, 'arity is 0'
- assert.ok /native code/.test(Set::[Symbol?iterator]), 'looks like native'
+ assert.name Set::[Symbol?iterator], \values
+ assert.arity Set::[Symbol?iterator], 0
+ assert.looksNative Set::[Symbol?iterator]
assert.strictEqual Set::[Symbol?iterator], Set::values
iter = new Set(<[q w e]>)[Symbol?iterator]!
assert.ok isIterator(iter), 'Return iterator'
diff --git a/tests/tests/es6.string.code-point-at.ls b/tests/tests/es6.string.code-point-at.ls
index 9fdb3e42b833..cae41ff9c458 100644
--- a/tests/tests/es6.string.code-point-at.ls
+++ b/tests/tests/es6.string.code-point-at.ls
@@ -3,10 +3,10 @@
module \ES6
test 'String#codePointAt' (assert)->
- assert.ok typeof! String::codePointAt is \Function, 'is function'
- assert.strictEqual String::codePointAt.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::codePointAt), 'looks like native'
- assert.strictEqual String::codePointAt.name, \codePointAt, 'name is "codePointAt"'
+ assert.isFunction String::codePointAt
+ assert.arity String::codePointAt, 1
+ assert.name String::codePointAt, \codePointAt
+ assert.looksNative String::codePointAt
# tests from https://github.com/mathiasbynens/String.prototype.codePointAt/blob/master/tests/tests.js
assert.strictEqual 'abc\uD834\uDF06def'codePointAt(''), 0x61
assert.strictEqual 'abc\uD834\uDF06def'codePointAt(\_), 0x61
diff --git a/tests/tests/es6.string.ends-with.ls b/tests/tests/es6.string.ends-with.ls
index 3318e9650c43..cd9e9e1f0131 100644
--- a/tests/tests/es6.string.ends-with.ls
+++ b/tests/tests/es6.string.ends-with.ls
@@ -3,10 +3,10 @@
module \ES6
test 'String#endsWith' (assert)->
- assert.ok typeof! String::endsWith is \Function, 'is function'
- assert.strictEqual String::endsWith.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::endsWith), 'looks like native'
- assert.strictEqual String::endsWith.name, \endsWith, 'name is "endsWith"'
+ assert.isFunction String::endsWith
+ assert.arity String::endsWith, 1
+ assert.name String::endsWith, \endsWith
+ assert.looksNative String::endsWith
assert.ok 'undefined'endsWith!
assert.ok not 'undefined'endsWith null
assert.ok 'abc'endsWith ''
diff --git a/tests/tests/es6.string.from-code-point.ls b/tests/tests/es6.string.from-code-point.ls
index bb966e0ccbc6..95f47387e6b2 100644
--- a/tests/tests/es6.string.from-code-point.ls
+++ b/tests/tests/es6.string.from-code-point.ls
@@ -3,10 +3,10 @@ module \ES6
test 'String.fromCodePoint' (assert)->
{fromCodePoint} = String
- assert.ok typeof! fromCodePoint is \Function, 'is function'
- assert.strictEqual fromCodePoint.length, 1, 'arity is 1'
- assert.ok /native code/.test(fromCodePoint), 'looks like native'
- assert.strictEqual fromCodePoint.name, \fromCodePoint, 'name is "fromCodePoint"'
+ assert.isFunction fromCodePoint
+ assert.arity fromCodePoint, 1
+ assert.name fromCodePoint, \fromCodePoint
+ assert.looksNative fromCodePoint
# tests from https://github.com/mathiasbynens/String.fromCodePoint/blob/master/tests/tests.js
assert.strictEqual fromCodePoint(''), '\0'
assert.strictEqual fromCodePoint!, ''
diff --git a/tests/tests/es6.string.includes.ls b/tests/tests/es6.string.includes.ls
index fef6a3551d55..afc46c46452c 100644
--- a/tests/tests/es6.string.includes.ls
+++ b/tests/tests/es6.string.includes.ls
@@ -3,10 +3,10 @@
module \ES6
test 'String#includes' (assert)->
- assert.ok typeof! String::includes is \Function, 'is function'
- assert.strictEqual String::includes.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::includes), 'looks like native'
- assert.strictEqual String::includes.name, \includes, 'name is "includes"'
+ assert.isFunction String::includes
+ assert.arity String::includes, 1
+ assert.name String::includes, \includes
+ assert.looksNative String::includes
assert.ok not 'abc'includes!
assert.ok 'aundefinedb'includes!
assert.ok 'abcd'includes \b 1
diff --git a/tests/tests/es6.string.iterator.ls b/tests/tests/es6.string.iterator.ls
index ffb4c238b429..8046b7ff5107 100644
--- a/tests/tests/es6.string.iterator.ls
+++ b/tests/tests/es6.string.iterator.ls
@@ -1,11 +1,10 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-isIterator = -> typeof it is \object && isFunction it.next
+isIterator = -> typeof it is \object && typeof it.next is \function
test 'String#@@iterator' (assert)->
- assert.ok isFunction(String::[Symbol?iterator]), 'is function'
+ assert.isFunction String::[Symbol?iterator]
iter = 'qwe'[Symbol?iterator]!
assert.ok isIterator(iter), 'Return iterator'
assert.strictEqual iter[Symbol?toStringTag], 'String Iterator'
diff --git a/tests/tests/es6.string.raw.ls b/tests/tests/es6.string.raw.ls
index 73c475715d19..45cfeec05e61 100644
--- a/tests/tests/es6.string.raw.ls
+++ b/tests/tests/es6.string.raw.ls
@@ -3,10 +3,10 @@ module \ES6
test 'String.raw' (assert)->
{raw} = String
- assert.ok typeof! raw is \Function, 'is function'
- assert.strictEqual raw.length, 1, 'arity is 1'
- assert.ok /native code/.test(raw), 'looks like native'
- assert.strictEqual raw.name, \raw, 'name is "raw"'
+ assert.isFunction raw
+ assert.arity raw, 1
+ assert.name raw, \raw
+ assert.looksNative raw
assert.strictEqual raw({raw: ['Hi\\n', '!']} , \Bob), 'Hi\\nBob!', 'raw is array'
assert.strictEqual raw({raw: \test}, 0, 1, 2), 't0e1s2t', 'raw is string'
assert.strictEqual raw({raw: \test}, 0), 't0est', 'lacks substituting'
diff --git a/tests/tests/es6.string.repeat.ls b/tests/tests/es6.string.repeat.ls
index 157ce6d4f5f1..99a169a47d92 100644
--- a/tests/tests/es6.string.repeat.ls
+++ b/tests/tests/es6.string.repeat.ls
@@ -3,10 +3,10 @@
module \ES6
test 'String#repeat' (assert)->
- assert.ok typeof! String::repeat is \Function, 'is function'
- assert.strictEqual String::repeat.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::repeat), 'looks like native'
- assert.strictEqual String::repeat.name, \repeat, 'name is "repeat"'
+ assert.isFunction String::repeat
+ assert.arity String::repeat, 1
+ assert.name String::repeat, \repeat
+ assert.looksNative String::repeat
assert.strictEqual 'qwe'repeat(3), \qweqweqwe
assert.strictEqual 'qwe'repeat(2.5), \qweqwe
assert.throws (-> 'qwe'repeat -1), RangeError
diff --git a/tests/tests/es6.string.starts-with.ls b/tests/tests/es6.string.starts-with.ls
index b294c5661d54..188c90e56758 100644
--- a/tests/tests/es6.string.starts-with.ls
+++ b/tests/tests/es6.string.starts-with.ls
@@ -3,10 +3,10 @@
module \ES6
test 'String#startsWith' (assert)->
- assert.ok typeof! String::startsWith is \Function, 'is function'
- assert.strictEqual String::startsWith.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::startsWith), 'looks like native'
- assert.strictEqual String::startsWith.name, \startsWith, 'name is "startsWith"'
+ assert.isFunction String::startsWith
+ assert.arity String::startsWith, 1
+ assert.name String::startsWith, \startsWith
+ assert.looksNative String::startsWith
assert.ok 'undefined'startsWith!
assert.ok not 'undefined'startsWith null
assert.ok 'abc'startsWith ''
diff --git a/tests/tests/es6.string.trim.ls b/tests/tests/es6.string.trim.ls
index 86a26f98492b..edf72cea7931 100644
--- a/tests/tests/es6.string.trim.ls
+++ b/tests/tests/es6.string.trim.ls
@@ -3,10 +3,10 @@
module \ES6
test 'String#trim' (assert)->
- assert.ok typeof! ''trim is \Function, 'is function'
- assert.strictEqual String::trim.length, 0, 'arity is 0'
- assert.ok /native code/.test(String::trim), 'looks like native'
- assert.strictEqual String::trim.name, \trim, 'name is "trim"'
+ assert.isFunction ''trim
+ assert.arity String::trim, 0
+ assert.name String::trim, \trim
+ assert.looksNative String::trim
assert.strictEqual ' \n q w e \n 'trim!, 'q w e', 'removes whitespaces at left & right side of string'
assert.strictEqual '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'trim!, '', 'removes all whitespaces'
assert.strictEqual '\u200b\u0085'trim!, '\u200b\u0085', "shouldn't remove this symbols"
diff --git a/tests/tests/es6.symbol.ls b/tests/tests/es6.symbol.ls
index ed8f2da32590..bbbb52b09186 100644
--- a/tests/tests/es6.symbol.ls
+++ b/tests/tests/es6.symbol.ls
@@ -2,17 +2,15 @@
module \ES6
{defineProperty, getOwnPropertyDescriptor, create} = Object
-isFunction = -> typeof! it is \Function
-isNative = -> /\[native code\]\s*\}\s*$/.test it
descriptors = (-> try 2 == Object.defineProperty({}, \a, get: -> 2)a)!
G = global? && global || window
test 'Symbol' (assert)->
- assert.ok isFunction(Symbol), 'is function'
+ assert.isFunction Symbol
#assert.strictEqual Symbol.length, 0 'arity is 0' # fails in most engines
- assert.strictEqual Symbol.name, \Symbol, 'name is "Symbol"'
- assert.ok /native code/.test(Symbol), 'looks like native'
+ assert.name Symbol, \Symbol
+ assert.looksNative Symbol
s1 = Symbol 'foo'
s2 = Symbol 'foo'
assert.ok s1 isnt s2, 'Symbol("foo") !== Symbol("foo")'
@@ -31,11 +29,11 @@ test 'Well-known Symbols' (assert)->
assert.ok Object(Symbol[..]) instanceof Symbol, "Symbol.#{..} is symbol"
test 'Global symbol registry' (assert)->
- assert.ok isFunction(Symbol.for), 'Symbol.for is function'
+ assert.isFunction Symbol.for, 'Symbol.for is function'
assert.strictEqual Symbol.for.length, 1 'Symbol.for arity is 1'
#assert.strictEqual Symbol.for.name, \for, 'Symbol.for.name is "for"' # can't be polyfilled in some environments
assert.ok /native code/.test(Symbol.for), 'Symbol.for looks like native'
- assert.ok isFunction(Symbol.keyFor), 'Symbol.keyFor is function'
+ assert.isFunction Symbol.keyFor, 'Symbol.keyFor is function'
assert.strictEqual Symbol.keyFor.length, 1 'Symbol.keyFor arity is 1'
assert.strictEqual Symbol.keyFor.name, \keyFor, 'Symbol.keyFor.name is "keyFor"'
assert.ok /native code/.test(Symbol.keyFor), 'Symbol.keyFor looks like native'
@@ -48,10 +46,10 @@ test 'Symbol#@@toStringTag' (assert)->
test 'Object.getOwnPropertySymbols' (assert)->
{getOwnPropertySymbols, getOwnPropertyNames} = Object
- assert.ok isFunction(getOwnPropertySymbols), 'is function'
+ assert.isFunction getOwnPropertySymbols
assert.strictEqual getOwnPropertySymbols.length, 1 'arity is 1'
- assert.strictEqual getOwnPropertySymbols.name, \getOwnPropertySymbols, 'name is "getOwnPropertySymbols"'
- assert.ok /native code/.test(getOwnPropertySymbols), 'looks like native'
+ assert.name getOwnPropertySymbols, \getOwnPropertySymbols
+ assert.looksNative getOwnPropertySymbols
obj = {q: 1, w: 2, e: 3}
obj[Symbol()] = 42
obj[Symbol()] = 43
diff --git a/tests/tests/es6.weak-map.ls b/tests/tests/es6.weak-map.ls
index e8b91f557a88..62711cc58b28 100644
--- a/tests/tests/es6.weak-map.ls
+++ b/tests/tests/es6.weak-map.ls
@@ -1,16 +1,14 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-
{freeze} = Object
{iterator} = Symbol
test 'WeakMap' (assert)->
- assert.ok isFunction(WeakMap), 'is function'
- assert.ok /native code/.test(WeakMap), 'looks like native'
- assert.strictEqual WeakMap.name, \WeakMap, 'name is "WeakMap"'
- assert.strictEqual WeakMap.length, 0, 'arity is 0'
+ assert.isFunction WeakMap
+ assert.name WeakMap, \WeakMap
+ assert.arity WeakMap, 0
+ assert.looksNative WeakMap
assert.ok \delete of WeakMap::, 'delete in WeakMap.prototype'
assert.ok \get of WeakMap::, 'get in WeakMap.prototype'
assert.ok \has of WeakMap::, 'has in WeakMap.prototype'
@@ -43,10 +41,10 @@ test 'WeakMap' (assert)->
assert.ok done
test 'WeakMap#delete' (assert)->
- assert.ok isFunction(WeakMap::delete), 'is function'
- #assert.strictEqual WeakMap::delete.name, \delete, 'name is "delete"' # can't be polyfilled in some environments
- #assert.strictEqual WeakMap::delete.length, 1, 'arity is 1'
- assert.ok /native code/.test(WeakMap::delete), 'looks like native'
+ assert.isFunction WeakMap::delete
+ #assert.name WeakMap::delete, \delete # can't be polyfilled in some environments
+ #assert.arity WeakMap::delete, 1
+ assert.looksNative WeakMap::delete
M = new WeakMap!
.set a = {}, 42
.set b = {}, 21
@@ -55,10 +53,10 @@ test 'WeakMap#delete' (assert)->
assert.ok !M.has(a) && M.has(b), 'WeakMap hasn`t value after .delete()'
test 'WeakMap#get' (assert)->
- assert.ok isFunction(WeakMap::get), 'is function'
- assert.strictEqual WeakMap::get.name, \get, 'name is "get"'
- #assert.strictEqual WeakMap::get.length, 1, 'arity is 1'
- assert.ok /native code/.test(WeakMap::get), 'looks like native'
+ assert.isFunction WeakMap::get
+ assert.name WeakMap::get, \get
+ #assert.arity WeakMap::get, 1
+ assert.looksNative WeakMap::get
M = new WeakMap!
assert.strictEqual M.get({}), void, 'WeakMap .get() before .set() return undefined'
M.set a = {}, 42
@@ -67,10 +65,10 @@ test 'WeakMap#get' (assert)->
assert.strictEqual M.get(a), void, 'WeakMap .get() after .delete() return undefined'
test 'WeakMap#has' (assert)->
- assert.ok isFunction(WeakMap::has), 'is function'
- assert.strictEqual WeakMap::has.name, \has, 'name is "has"'
- #assert.strictEqual WeakMap::has.length, 1, 'arity is 1'
- assert.ok /native code/.test(WeakMap::has), 'looks like native'
+ assert.isFunction WeakMap::has
+ assert.name WeakMap::has, \has
+ #assert.arity WeakMap::has, 1
+ assert.looksNative WeakMap::has
M = new WeakMap!
assert.ok !M.has({}), 'WeakMap .has() before .set() return false'
M.set a = {}, 42
@@ -79,10 +77,10 @@ test 'WeakMap#has' (assert)->
assert.ok !M.has(a), 'WeakMap .has() after .delete() return false'
test 'WeakMap#set' (assert)->
- assert.ok isFunction(WeakMap::set), 'is function'
- assert.strictEqual WeakMap::set.name, \set, 'name is "set"'
- assert.strictEqual WeakMap::set.length, 2, 'arity is 2'
- assert.ok /native code/.test(WeakMap::set), 'looks like native'
+ assert.isFunction WeakMap::set
+ assert.name WeakMap::set, \set
+ assert.arity WeakMap::set, 2
+ assert.looksNative WeakMap::set
assert.ok new WeakMap!set(a = {}, 42), 'WeakMap.prototype.set works with object as keys'
assert.ok (try new WeakMap!set(42, 42); no; catch => on), 'WeakMap.prototype.set throw with primitive keys'
diff --git a/tests/tests/es6.weak-set.ls b/tests/tests/es6.weak-set.ls
index 022b52f823cb..b8f7435ece4a 100644
--- a/tests/tests/es6.weak-set.ls
+++ b/tests/tests/es6.weak-set.ls
@@ -1,16 +1,14 @@
{module, test} = QUnit
module \ES6
-isFunction = -> typeof! it is \Function
-
{freeze} = Object
{iterator} = Symbol
test 'WeakSet' (assert)->
- assert.ok isFunction(WeakSet), 'is function'
- assert.ok /native code/.test(WeakSet), 'looks like native'
- assert.strictEqual WeakSet.name, \WeakSet, 'name is "WeakSet"'
- assert.strictEqual WeakSet.length, 0, 'arity is 0'
+ assert.isFunction WeakSet
+ assert.name WeakSet, \WeakSet
+ assert.arity WeakSet, 0
+ assert.looksNative WeakSet
assert.ok \add of WeakSet::, 'add in WeakSet.prototype'
assert.ok \delete of WeakSet::, 'delete in WeakSet.prototype'
assert.ok \has of WeakSet::, 'has in WeakSet.prototype'
@@ -40,18 +38,18 @@ test 'WeakSet' (assert)->
assert.ok done
test 'WeakSet#add' (assert)->
- assert.ok isFunction(WeakSet::add), 'is function'
- assert.strictEqual WeakSet::add.name, \add, 'name is "add"'
- assert.strictEqual WeakSet::add.length, 1, 'arity is 1'
- assert.ok /native code/.test(WeakSet::add), 'looks like native'
+ assert.isFunction WeakSet::add
+ assert.name WeakSet::add, \add
+ assert.arity WeakSet::add, 1
+ assert.looksNative WeakSet::add
assert.ok new WeakSet!add(a = {}), 'WeakSet.prototype.add works with object as keys'
assert.ok (try new WeakSet!add(42); no; catch => on), 'WeakSet.prototype.add throw with primitive keys'
test 'WeakSet#delete' (assert)->
- assert.ok isFunction(WeakSet::delete), 'is function'
- #assert.strictEqual WeakSet::delete.name, \delete, 'name is "delete"' # can't be polyfilled in some environments
- assert.strictEqual WeakSet::delete.length, 1, 'arity is 1'
- assert.ok /native code/.test(WeakSet::delete), 'looks like native'
+ assert.isFunction WeakSet::delete
+ #assert.name WeakSet::delete, \delete # can't be polyfilled in some environments
+ assert.arity WeakSet::delete, 1
+ assert.looksNative WeakSet::delete
S = new WeakSet!
.add a = {}
.add b = {}
@@ -60,10 +58,10 @@ test 'WeakSet#delete' (assert)->
assert.ok !S.has(a) && S.has(b), 'WeakSet has`nt value after .delete()'
test 'WeakSet#has' (assert)->
- assert.ok isFunction(WeakSet::has), 'is function'
- assert.strictEqual WeakSet::has.name, \has, 'name is "has"'
- assert.strictEqual WeakSet::has.length, 1, 'arity is 1'
- assert.ok /native code/.test(WeakSet::has), 'looks like native'
+ assert.isFunction WeakSet::has
+ assert.name WeakSet::has, \has
+ assert.arity WeakSet::has, 1
+ assert.looksNative WeakSet::has
M = new WeakSet!
assert.ok not M.has({}), 'WeakSet has`nt value'
M.add a = {}
diff --git a/tests/tests/es7.array.includes.ls b/tests/tests/es7.array.includes.ls
index e644a28e53ff..23714b60bf78 100644
--- a/tests/tests/es7.array.includes.ls
+++ b/tests/tests/es7.array.includes.ls
@@ -3,10 +3,10 @@
module \ES7
test 'Array#includes' (assert)->
- assert.ok typeof! Array::includes is \Function, 'is function'
- assert.strictEqual Array::includes.name, \includes, 'name is "includes"'
- assert.strictEqual Array::includes.length, 1, 'arity is 1'
- assert.ok /native code/.test(Array::includes), 'looks like native'
+ assert.isFunction Array::includes
+ assert.name Array::includes, \includes
+ assert.arity Array::includes, 1
+ assert.looksNative Array::includes
arr = [1 2 3 -0 o = {}]
assert.ok arr.includes 1
assert.ok arr.includes -0
diff --git a/tests/tests/es7.map.to-json.ls b/tests/tests/es7.map.to-json.ls
index 206ab4932543..61bd08ac4294 100644
--- a/tests/tests/es7.map.to-json.ls
+++ b/tests/tests/es7.map.to-json.ls
@@ -2,9 +2,9 @@
module \ES7
test 'Map#toJSON' (assert)->
- assert.ok typeof! Map::toJSON is \Function, 'is function'
- assert.strictEqual Map::toJSON.name, \toJSON, 'name is "toJSON"'
- assert.strictEqual Map::toJSON.length, 0, 'arity is 0'
- assert.ok /native code/.test(Map::toJSON), 'looks like native'
+ assert.isFunction Map::toJSON
+ assert.name Map::toJSON, \toJSON
+ assert.arity Map::toJSON, 0
+ assert.looksNative Map::toJSON
if JSON?
assert.strictEqual JSON.stringify(new Map [[\a \b], [\c \d]] ), '[["a","b"],["c","d"]]', 'Works'
\ No newline at end of file
diff --git a/tests/tests/es7.object.entries.ls b/tests/tests/es7.object.entries.ls
index 9c55151ed7c0..28f4c00264e2 100644
--- a/tests/tests/es7.object.entries.ls
+++ b/tests/tests/es7.object.entries.ls
@@ -3,10 +3,10 @@ module \ES7
test 'Object.entries' (assert)->
{entries, create, assign} = Object
- assert.ok typeof! entries is \Function, 'is function'
- assert.ok /native code/.test(entries), 'looks like native'
- assert.strictEqual entries.length, 1, 'arity is 1'
- assert.strictEqual entries.name, \entries, 'name is "entries"'
+ assert.isFunction entries
+ assert.arity entries, 1
+ assert.name entries, \entries
+ assert.looksNative entries
assert.deepEqual entries({q:1, w:2, e:3}), [[\q 1] [\w 2] [\e 3]]
assert.deepEqual entries(new String \qwe), [[\0 \q] [\1 \w] [\2 \e]]
assert.deepEqual entries(assign create({q:1, w:2, e:3}), {a:4, s:5, d:6}), [[\a 4] [\s 5] [\d 6]]
diff --git a/tests/tests/es7.object.get-own-property-descriptors.ls b/tests/tests/es7.object.get-own-property-descriptors.ls
index 15a4f0989ee9..9cace4c47515 100644
--- a/tests/tests/es7.object.get-own-property-descriptors.ls
+++ b/tests/tests/es7.object.get-own-property-descriptors.ls
@@ -6,10 +6,10 @@ descriptors = (-> try 2 == Object.defineProperty({}, \a, get: -> 2)a)!
test 'Object.getOwnPropertyDescriptors' (assert)->
{getOwnPropertyDescriptors} = Object
- assert.ok typeof! getOwnPropertyDescriptors is \Function, 'is function'
- assert.strictEqual getOwnPropertyDescriptors.length, 1, 'arity is 1'
- assert.strictEqual getOwnPropertyDescriptors.name, \getOwnPropertyDescriptors, 'name is "getOwnPropertyDescriptors"'
- assert.ok /native code/.test(getOwnPropertyDescriptors), 'looks like native'
+ assert.isFunction getOwnPropertyDescriptors
+ assert.arity getOwnPropertyDescriptors, 1
+ assert.name getOwnPropertyDescriptors, \getOwnPropertyDescriptors
+ assert.looksNative getOwnPropertyDescriptors
O = create {q: 1}, e: value: 3
O.w = 2
s = Symbol \s
diff --git a/tests/tests/es7.object.values.ls b/tests/tests/es7.object.values.ls
index ecd9f2396f3b..a57208dce1ea 100644
--- a/tests/tests/es7.object.values.ls
+++ b/tests/tests/es7.object.values.ls
@@ -3,10 +3,10 @@ module \ES7
test 'Object.values' (assert)->
{values, create, assign} = Object
- assert.ok typeof! values is \Function, 'is function'
- assert.ok /native code/.test(values), 'looks like native'
- assert.strictEqual values.length, 1, 'arity is 1'
- assert.strictEqual values.name, \values, 'name is "values"'
+ assert.isFunction values
+ assert.arity values, 1
+ assert.name values, \values
+ assert.looksNative values
assert.deepEqual values({q:1, w:2, e:3}), [1 2 3]
assert.deepEqual values(new String \qwe), [\q \w \e]
assert.deepEqual values(assign create({q:1, w:2, e:3}), {a:4, s:5, d:6}), [4 5 6]
diff --git a/tests/tests/es7.regexp.escape.ls b/tests/tests/es7.regexp.escape.ls
index 690e014de5e8..7c1bcd6ad1c8 100644
--- a/tests/tests/es7.regexp.escape.ls
+++ b/tests/tests/es7.regexp.escape.ls
@@ -3,9 +3,9 @@ module \ES7
test 'RegExp.escape' (assert)->
{escape} = RegExp
- assert.ok typeof! escape is \Function, 'is function'
- assert.ok /native code/.test(escape), 'looks like native'
- assert.strictEqual escape.length, 1, 'arity is 1'
- assert.strictEqual escape.name, \escape, 'name is "escape"'
+ assert.isFunction escape
+ assert.arity escape, 1
+ assert.name escape, \escape
+ assert.looksNative escape
assert.strictEqual escape('qwe asd'), 'qwe asd', "Don't change simple string"
assert.strictEqual escape('\\[]{}()*+?.^$|'), '\\\\\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\^\\$\\|', 'Escape all RegExp special chars'
\ No newline at end of file
diff --git a/tests/tests/es7.set.to-json.ls b/tests/tests/es7.set.to-json.ls
index 9a91f12c412b..09898a95e6dc 100644
--- a/tests/tests/es7.set.to-json.ls
+++ b/tests/tests/es7.set.to-json.ls
@@ -2,9 +2,9 @@
module \ES7
test 'Set#toJSON' (assert)->
- assert.ok typeof! Set::toJSON is \Function, 'is function'
- assert.strictEqual Set::toJSON.name, \toJSON, 'name is "toJSON"'
- assert.strictEqual Set::toJSON.length, 0, 'arity is 0'
- assert.ok /native code/.test(Set::toJSON), 'looks like native'
+ assert.isFunction Set::toJSON
+ assert.name Set::toJSON, \toJSON
+ assert.arity Set::toJSON, 0
+ assert.looksNative Set::toJSON
if JSON?
assert.strictEqual JSON.stringify(new Set [1 2 3 2 1] ), '[1,2,3]', 'Works'
\ No newline at end of file
diff --git a/tests/tests/es7.string.at.ls b/tests/tests/es7.string.at.ls
index eb3123e06ead..4c067eb2e31f 100644
--- a/tests/tests/es7.string.at.ls
+++ b/tests/tests/es7.string.at.ls
@@ -3,10 +3,10 @@
module \ES7
test 'String#at' (assert)->
- assert.ok typeof! String::at is \Function, 'is function'
- assert.strictEqual String::at.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::at), 'looks like native'
- assert.strictEqual String::at.name, \at, 'name is "at"'
+ assert.isFunction String::at
+ assert.arity String::at, 1
+ assert.name String::at, \at
+ assert.looksNative String::at
# Tests from https://github.com/mathiasbynens/String.prototype.at/blob/master/tests/tests.js
# String that starts with a BMP symbol
assert.strictEqual 'abc\uD834\uDF06def'at(-Infinity), ''
diff --git a/tests/tests/es7.string.pad-left.ls b/tests/tests/es7.string.pad-left.ls
index 859f70730c5d..ea627b7209b8 100644
--- a/tests/tests/es7.string.pad-left.ls
+++ b/tests/tests/es7.string.pad-left.ls
@@ -3,10 +3,10 @@
module \ES7
test 'String#padLeft' (assert)->
- assert.ok typeof! String::padLeft is \Function, 'is function'
- assert.strictEqual String::padLeft.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::padLeft), 'looks like native'
- assert.strictEqual String::padLeft.name, \padLeft, 'name is "padLeft"'
+ assert.isFunction String::padLeft
+ assert.arity String::padLeft, 1
+ assert.name String::padLeft, \padLeft
+ assert.looksNative String::padLeft
assert.strictEqual 'abc'padLeft(5), ' abc'
assert.strictEqual 'abc'padLeft(4 \de), \dabc
assert.strictEqual 'abc'padLeft!, \abc
diff --git a/tests/tests/es7.string.pad-right.ls b/tests/tests/es7.string.pad-right.ls
index 8679dc34ba91..300491aba97b 100644
--- a/tests/tests/es7.string.pad-right.ls
+++ b/tests/tests/es7.string.pad-right.ls
@@ -3,10 +3,10 @@
module \ES7
test 'String#padRight' (assert)->
- assert.ok typeof! String::padRight is \Function, 'is function'
- assert.strictEqual String::padRight.length, 1, 'arity is 1'
- assert.ok /native code/.test(String::padRight), 'looks like native'
- assert.strictEqual String::padRight.name, \padRight, 'name is "padRight"'
+ assert.isFunction String::padRight
+ assert.arity String::padRight, 1
+ assert.name String::padRight, \padRight
+ assert.looksNative String::padRight
assert.strictEqual 'abc'padRight(5), 'abc '
assert.strictEqual 'abc'padRight(4, \de), \abcd
assert.strictEqual 'abc'padRight!, \abc
diff --git a/tests/tests/es7.string.trim-left.ls b/tests/tests/es7.string.trim-left.ls
index da99d97b7fc4..34661694f46d 100644
--- a/tests/tests/es7.string.trim-left.ls
+++ b/tests/tests/es7.string.trim-left.ls
@@ -3,10 +3,10 @@
module \ES7
test 'String#trimLeft' (assert)->
- assert.ok typeof! ''trimLeft is \Function, 'is function'
- assert.strictEqual String::trimLeft.length, 0, 'arity is 0'
- assert.ok /native code/.test(String::trimLeft), 'looks like native'
- assert.strictEqual String::trimLeft.name, \trimLeft, 'name is "trimLeft"'
+ assert.isFunction ''trimLeft
+ assert.arity String::trimLeft, 0
+ assert.name String::trimLeft, \trimLeft
+ assert.looksNative String::trimLeft
assert.strictEqual ' \n q w e \n 'trimLeft!, 'q w e \n ', 'removes whitespaces at left side of string'
assert.strictEqual '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'trimLeft!, '', 'removes all whitespaces'
assert.strictEqual '\u200b\u0085'trimLeft!, '\u200b\u0085', "shouldn't remove this symbols"
diff --git a/tests/tests/es7.string.trim-right.ls b/tests/tests/es7.string.trim-right.ls
index cae2dc379eed..22950792b2a2 100644
--- a/tests/tests/es7.string.trim-right.ls
+++ b/tests/tests/es7.string.trim-right.ls
@@ -3,10 +3,10 @@
module \ES7
test 'String#trimRight' (assert)->
- assert.ok typeof! ''trimRight is \Function, 'is function'
- assert.strictEqual String::trimRight.length, 0, 'arity is 0'
- assert.ok /native code/.test(String::trimRight), 'looks like native'
- assert.strictEqual String::trimRight.name, \trimRight, 'name is "trimRight"'
+ assert.isFunction ''trimRight
+ assert.arity String::trimRight, 0
+ assert.name String::trimRight, \trimRight
+ assert.looksNative String::trimRight
assert.strictEqual ' \n q w e \n 'trimRight!, ' \n q w e', 'removes whitespaces at right side of string'
assert.strictEqual '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'trimRight!, '', 'removes all whitespaces'
assert.strictEqual '\u200b\u0085'trimRight!, '\u200b\u0085', "shouldn't remove this symbols"
diff --git a/tests/tests/js.array.statics.ls b/tests/tests/js.array.statics.ls
index 2fd7628311ca..67cfb302a581 100644
--- a/tests/tests/js.array.statics.ls
+++ b/tests/tests/js.array.statics.ls
@@ -1,12 +1,11 @@
{module, test} = QUnit
module 'Mozilla JavaScript Array statics'
-isFunction = -> typeof! it is \Function
{slice} = Array::
test 'are functions' (assert)->
for <[concat join pop push reverse shift slice sort splice unshift indexOf lastIndexOf every some forEach map filter reduce reduceRight copyWithin fill find findIndex keys values entries includes]>
- assert.ok isFunction(Array[..]), "Array.#{..} is function"
+ assert.isFunction Array[..], "Array.#{..} is function"
test '.join' (assert)->
{join} = Array
@@ -222,7 +221,6 @@ test '.findIndex' (assert)->
test '.keys' (assert)->
{keys} = Array
- assert.ok typeof keys is \function, 'is function'
iter1 = keys (->&)(\q \w \e)
assert.ok typeof iter1 is \object, 'Iterator is object'
assert.ok typeof iter1.next is \function, 'Iterator has .next method'
@@ -238,7 +236,6 @@ test '.keys' (assert)->
test '.values' (assert)->
{values} = Array
- assert.ok typeof values is \function, 'is function'
iter1 = values (->&)(\q \w \e)
assert.ok typeof iter1 is \object, 'Iterator is object'
assert.ok typeof iter1.next is \function, 'Iterator has .next method'
@@ -254,7 +251,6 @@ test '.values' (assert)->
test '.entries' (assert)->
{entries} = Array
- assert.ok typeof entries is \function, 'is function'
iter1 = entries (->&)(\q \w \e)
assert.ok typeof iter1 is \object, 'Iterator is object'
assert.ok typeof iter1.next is \function, 'Iterator has .next method'
@@ -270,7 +266,6 @@ test '.entries' (assert)->
test '.includes' (assert)->
{includes} = Array
- assert.ok isFunction(includes), 'is function'
args = (->&)(1 2 3 -0 NaN, o = {})
assert.ok includes args, 1
assert.ok includes args, -0
diff --git a/tests/tests/web.dom.itarable.ls b/tests/tests/web.dom.itarable.ls
index bf7cc4c39b65..29356954bce1 100644
--- a/tests/tests/web.dom.itarable.ls
+++ b/tests/tests/web.dom.itarable.ls
@@ -1,12 +1,10 @@
{module, test} = QUnit
module 'DOM iterable'
-isFunction = -> typeof! it is \Function
-
if NodeList? and document?querySelectorAll and document.querySelectorAll(\div) instanceof NodeList
test 'NodeList.prototype@@iterator' (assert)->
- assert.ok isFunction(document.querySelectorAll(\div)[Symbol.iterator]), 'is function'
+ assert.isFunction document.querySelectorAll(\div)[Symbol.iterator]
if HTMLCollection? and document?getElementsByTagName and document.getElementsByTagName(\div) instanceof HTMLCollection
test 'HTMLCollection.prototype@@iterator' (assert)->
- assert.ok isFunction(document.getElementsByTagName(\div)[Symbol.iterator]), 'is function' # Buggy in some Chromium versions
\ No newline at end of file
+ assert.isFunction document.getElementsByTagName(\div)[Symbol.iterator] # Buggy in some Chromium versions
\ No newline at end of file