test/jdk/tools/jjs/strict.js
author prr
Wed, 29 Nov 2017 09:47:02 -0800
changeset 47982 44371ff1ee9a
parent 47216 71c04702a3d5
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34721
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     1
/*
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     2
 * This is the test JavaScript program used in jjs-strictTest.sh
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     3
 */
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     4
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     5
try {
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     6
    v = "hello";
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     7
    throw new Error("should have thrown ReferenceError");
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     8
} catch (e) {
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     9
    if (! (e instanceof ReferenceError)) {
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    10
        throw new Error("ReferenceError expected, got " + e);
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    11
    }
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    12
}