Bug 1059454 - Enable commented out constructor test in string-iterator-surfaces.js. r=till

This commit is contained in:
André Bargull 2016-10-07 00:53:14 -07:00
Родитель 0b6952c8ea
Коммит 48c5ad2d8b
1 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -31,18 +31,26 @@ function assertBuiltinFunction(o, name, arity) {
assertEq(typeof fn, "function");
assertEq(Object.getPrototypeOf(fn), Function.prototype);
// FIXME: Proxy should only have [[Construct]] if target has [[Construct]] (bug 929467)
// assertEq(isConstructor(fn), false);
assertEq(isConstructor(fn), false);
arraysEqual(Object.getOwnPropertyNames(fn).sort(), ["length", "name", "arguments", "caller"].sort());
assertEq(arraysEqual(Object.getOwnPropertyNames(fn).sort(), ["length", "name"].sort()), true);
// Also test "name", "arguments" and "caller" in addition to "length"?
assertDataDescriptor(Object.getOwnPropertyDescriptor(fn, "length"), {
value: arity,
writable: false,
enumerable: false,
configurable: true
});
var functionName = typeof name === "symbol"
? String(name).replace(/^Symbol\((.+)\)$/, "[$1]")
: name;
assertDataDescriptor(Object.getOwnPropertyDescriptor(fn, "name"), {
value: functionName,
writable: false,
enumerable: false,
configurable: true
});
}
@ -59,7 +67,7 @@ assertEq(Object.getPrototypeOf(iterProto),
Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
// Own properties for StringIterator.prototype: "next"
arraysEqual(Object.getOwnPropertyNames(iterProto).sort(), ["next"]);
assertEq(arraysEqual(Object.getOwnPropertyNames(iterProto).sort(), ["next"]), true);
// StringIterator.prototype.next is a built-in function
assertBuiltinFunction(iterProto, "next", 0);