summaryrefslogtreecommitdiff
path: root/harness
diff options
context:
space:
mode:
authorAndré Bargull <andre.bargull@gmail.com>2017-12-21 12:08:30 -0800
committerRick Waldron <waldron.rick@gmail.com>2017-12-21 16:46:56 -0500
commit266e0ffb668e085ced28c146818766f3a62547cc (patch)
treebfe5ee6c8a699328ad9ec16acc8af9c8c6f8cfd4 /harness
parent60692bb6e06680cabb4f603883d274d8339d09fe (diff)
downloadqtdeclarative-testsuites-266e0ffb668e085ced28c146818766f3a62547cc.tar.gz
Remove harness/testBuiltInObject.js file
Diffstat (limited to 'harness')
-rw-r--r--harness/testBuiltInObject.js58
1 files changed, 0 insertions, 58 deletions
diff --git a/harness/testBuiltInObject.js b/harness/testBuiltInObject.js
deleted file mode 100644
index af0081c87..000000000
--- a/harness/testBuiltInObject.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2012 Mozilla Corporation. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-/*---
-description: |
- A function used to assert the correctness of built-in objects.
----*/
-
-/**
- * @description Tests that obj meets the requirements for built-in objects
- * defined by the introduction of chapter 15 of the ECMAScript Language Specification.
- * @param {Object} obj the object to be tested.
- * @author Norbert Lindenberg
- */
-
-function testBuiltInObject(obj) {
-
- if (obj === undefined) {
- $ERROR("Object being tested is undefined.");
- }
-
- var objString = Object.prototype.toString.call(obj);
-
- if (objString !== "[object Function]") {
- $ERROR("The [[Class]] internal property of a built-in function must be " +
- "\"Function\", but toString() returns " + objString);
- }
-
- if (!Object.isExtensible(obj)) {
- $ERROR("Built-in objects must be extensible.");
- }
-
- if (Object.getPrototypeOf(obj) !== Function.prototype) {
- $ERROR("Built-in functions must have Function.prototype as their prototype.");
- }
-
- var exception;
- // this is not a complete test for the presence of [[Construct]]:
- // if it's absent, the exception must be thrown, but it may also
- // be thrown if it's present and just has preconditions related to
- // arguments or the this value that this statement doesn't meet.
- try {
- /*jshint newcap:false*/
- var instance = new obj();
- } catch (e) {
- exception = e;
- }
- if (exception === undefined || exception.name !== "TypeError") {
- $ERROR("Built-in functions that aren't constructors must throw TypeError when " +
- "used in a \"new\" statement.");
- }
-
- if (obj.hasOwnProperty("prototype")) {
- $ERROR("Built-in functions that aren't constructors must not have a prototype property.");
- }
-
- // passed the complete test!
- return true;
-}