зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1059454 - Enable commented out constructor test in string-iterator-surfaces.js. r=till
This commit is contained in:
Родитель
0b6952c8ea
Коммит
48c5ad2d8b
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче