test/jdk/tools/jjs/es6.js
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 47216 71c04702a3d5
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com
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-es6Test.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
const X = 4;
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     6
try {
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     7
    X = 55;
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     8
    throw new Error("should have thrown TypeError");
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
     9
} catch (e) {
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    10
    if (! (e instanceof TypeError)) {
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    11
        throw new Error("TypeError expected, got " + e);
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    12
    }
59801fbd042e 8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff changeset
    13
}