| errors += ("bad result: calling " + type.name + " as a function did not throw\n"); |
| if (typeof type !== "function") |
| errors += ("bad result: typeof " + type.name + " is not function. Was " + (typeof type) + "\n"); |
| // According to the spec, the constructors of the following types "are not intended to be |
| // called as a function and will throw an exception". However, as constructors, their |
| // type should be "function". |
| // https://tc39.github.io/ecma262/#sec-typedarray-constructors |
| // https://tc39.github.io/ecma262/#sec-map-constructor |
| // https://tc39.github.io/ecma262/#sec-set-constructor |
| // https://tc39.github.io/ecma262/#sec-weakmap-constructor |
| // https://tc39.github.io/ecma262/#sec-weakset-constructor |
| // https://tc39.github.io/ecma262/#sec-arraybuffer-constructor |
| // https://tc39.github.io/ecma262/#sec-dataview-constructor |
| // https://tc39.github.io/ecma262/#sec-promise-constructor |
| // https://tc39.github.io/ecma262/#sec-proxy-constructor |
| let expectedNumTests = 34; |
| if (numTests != expectedNumTests) { |
| errors += "Not all tests were run: ran " + numTests + " out of " + expectedNumTests + " \n"; |