summaryrefslogtreecommitdiff
path: root/test/built-ins/eval/no-construct.js
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2016-04-07 15:50:10 -0400
committerLeonardo Balter <leonardo.balter@gmail.com>2016-04-25 16:36:36 -0400
commit7630e1763d34ffd6df04cdff25800b225f749b50 (patch)
tree418de76cb2fdcc0fda715f84552cb16b6fa22bb3 /test/built-ins/eval/no-construct.js
parent7f88f29328a038ef7b9fe145f1c7fde0e0edcc31 (diff)
downloadqtdeclarative-testsuites-7630e1763d34ffd6df04cdff25800b225f749b50.tar.gz
Re-organize tests for eval
Limit tests in `language/expressions/call/` and `built-ins/eval/` to only assert details that are directly related to the invocation pattern. Re-organize all other tests within the `language/eval-code/` directory, further categorizing each as `direct` or `indirect` as appropriate. Remove the extraneous "executable" flag from those files which carried it.
Diffstat (limited to 'test/built-ins/eval/no-construct.js')
-rw-r--r--test/built-ins/eval/no-construct.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/built-ins/eval/no-construct.js b/test/built-ins/eval/no-construct.js
new file mode 100644
index 000000000..130fe7c5d
--- /dev/null
+++ b/test/built-ins/eval/no-construct.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The eval property can't be used as constructor
+es5id: 15.1.2.1_A4.7
+description: >
+ If property does not implement the internal [[Construct]] method,
+ throw a TypeError exception
+---*/
+
+//CHECK#1
+
+try {
+ new eval();
+ $ERROR('#1.1: new eval() throw TypeError. Actual: ' + (new eval()));
+} catch (e) {
+ if ((e instanceof TypeError) !== true) {
+ $ERROR('#1.2: new eval() throw TypeError. Actual: ' + (e));
+ }
+}