changeset 737:b3517e51f404 jdk9-b02

Merge
author lana
date Mon, 27 Jan 2014 21:01:55 -0800
parents aa5dad691156 (diff) 3f1385a3bbf5 (current diff)
children b47e0ab68807 560be4b9f5c4
files .hgtags
diffstat 185 files changed, 3698 insertions(+), 491 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Jan 21 18:17:23 2014 -0800
+++ b/.hgtags	Mon Jan 27 21:01:55 2014 -0800
@@ -230,5 +230,8 @@
 8d014b039b44c23fa520ce20c2c27f7aa91441e9 jdk8-b118
 c3343930c73c58a22c1d58719bb988aeb25a871f jdk8-b119
 55cbc2d00c93f82513ce33819d41dc67e71aaefd jdk8-b120
+32631eed0fad2b31346eb41b29a50227bd29e2ec jdk8-b121
+9d112a0e7df737f3b1fa2a021d5bb350ed56c1b7 jdk8-b122
+688f4167f92188482b0d80e315c72f726c6d5ff6 jdk8-b123
 32631eed0fad2b31346eb41b29a50227bd29e2ec jdk9-b00
 65347535840f045f2cd4341d7466c51009b1b06f jdk9-b01
--- a/bin/jjs	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/java -server -XX:+TieredCompilation -Xms2G -Xmx2G -esa -ea -Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+HeapDumpOnOutOfMemoryError -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.debug=true jdk.nashorn.tools.Shell $*
--- a/bin/jjs.bat	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.ext.dirs=%~dp0\..\dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false jdk.nashorn.tools.Shell
--- a/bin/jjssecure	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.security.properties=`dirname $0`/../make/java.security.override -Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=true -Dnashorn.home=`dirname $0`/.. -Djava.security.manager jdk.nashorn.tools.Shell $*
--- a/bin/jjssecure.bat	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.security.properties=%~dp0\..\make\java.security.override -Djava.ext.dirs=%~dp0\..\dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.home=%~dp0\.. -Djava.security.manager jdk.nashorn.tools.Shell
--- a/bin/nashorn	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/jrunscript -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $*
--- a/bin/nashorn.bat	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-jrunscript -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=%~dp0\..\dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Dnashorn.debug=true -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -l nashorn
--- a/bin/nashornsecure	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/jrunscript -J-Djava.security.properties=`dirname $0`/../make/java.security.override -J-Djava.security.manager -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $*
--- a/bin/nashornsecure.bat	Tue Jan 21 18:17:23 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-jrunscript -J-Djava.security.properties=%~dp0\..\make\java.security.override -J-Djava.security.manager -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=%~dp0\..\dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Dnashorn.debug=true -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -l nashorn
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java	Mon Jan 27 21:01:55 2014 -0800
@@ -279,10 +279,6 @@
                 }
             }
         } else if (kind == Kind.FUNCTION) {
-            final Type returnType = Type.getReturnType(javaDesc);
-            if (! returnType.toString().equals(OBJECT_DESC)) {
-                error("return value should be of Object type, found" + returnType);
-            }
             final Type[] argTypes = Type.getArgumentTypes(javaDesc);
             if (argTypes.length < 1) {
                 error("function methods should have at least 1 arg");
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java	Mon Jan 27 21:01:55 2014 -0800
@@ -349,19 +349,19 @@
 
     // invokes, field get/sets
     void invokeInterface(final String owner, final String method, final String desc) {
-        super.visitMethodInsn(INVOKEINTERFACE, owner, method, desc);
+        super.visitMethodInsn(INVOKEINTERFACE, owner, method, desc, true);
     }
 
     void invokeVirtual(final String owner, final String method, final String desc) {
-        super.visitMethodInsn(INVOKEVIRTUAL, owner, method, desc);
+        super.visitMethodInsn(INVOKEVIRTUAL, owner, method, desc, false);
     }
 
     void invokeSpecial(final String owner, final String method, final String desc) {
-        super.visitMethodInsn(INVOKESPECIAL, owner, method, desc);
+        super.visitMethodInsn(INVOKESPECIAL, owner, method, desc, false);
     }
 
     void invokeStatic(final String owner, final String method, final String desc) {
-        super.visitMethodInsn(INVOKESTATIC, owner, method, desc);
+        super.visitMethodInsn(INVOKESTATIC, owner, method, desc, false);
     }
 
     void putStatic(final String owner, final String field, final String desc) {
@@ -413,7 +413,7 @@
         super.visitMethodInsn(INVOKEVIRTUAL,
                     "java/io/PrintStream",
                     "println",
-                    "(Ljava/lang/String;)V");
+                    "(Ljava/lang/String;)V", false);
     }
 
     // print the object on the top of the stack
@@ -426,6 +426,6 @@
         super.visitMethodInsn(INVOKEVIRTUAL,
                     "java/io/PrintStream",
                     "println",
-                    "(Ljava/lang/Object;)V");
+                    "(Ljava/lang/Object;)V", false);
     }
 }
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Mon Jan 27 21:01:55 2014 -0800
@@ -146,16 +146,16 @@
                 // call $clinit$ just before return from <clinit>
                 if (isStaticInit && opcode == RETURN) {
                     super.visitMethodInsn(INVOKESTATIC, scriptClassInfo.getJavaName(),
-                            $CLINIT$, DEFAULT_INIT_DESC);
+                            $CLINIT$, DEFAULT_INIT_DESC, false);
                 }
                 super.visitInsn(opcode);
             }
 
             @Override
-            public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) {
+            public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, final boolean itf) {
                 if (isConstructor && opcode == INVOKESPECIAL &&
                         INIT.equals(name) && SCRIPTOBJECT_TYPE.equals(owner)) {
-                    super.visitMethodInsn(opcode, owner, name, desc);
+                    super.visitMethodInsn(opcode, owner, name, desc, false);
 
                     if (memberCount > 0) {
                         // initialize @Property fields if needed
@@ -166,7 +166,7 @@
                                 super.visitTypeInsn(NEW, clazz);
                                 super.visitInsn(DUP);
                                 super.visitMethodInsn(INVOKESPECIAL, clazz,
-                                    INIT, DEFAULT_INIT_DESC);
+                                    INIT, DEFAULT_INIT_DESC, false);
                                 super.visitFieldInsn(PUTFIELD, scriptClassInfo.getJavaName(),
                                     memInfo.getJavaName(), memInfo.getJavaDesc());
                             }
@@ -180,7 +180,7 @@
                         }
                     }
                 } else {
-                    super.visitMethodInsn(opcode, owner, name, desc);
+                    super.visitMethodInsn(opcode, owner, name, desc, itf);
                 }
             }
 
--- a/make/build-benchmark.xml	Tue Jan 21 18:17:23 2014 -0800
+++ b/make/build-benchmark.xml	Mon Jan 27 21:01:55 2014 -0800
@@ -239,7 +239,7 @@
     </antcall>
   </target>
 
-  <target name="octane-regexp-octane-v8" depends="jar">
+  <target name="octane-regexp-v8" depends="jar">
     <antcall target="run-octane-v8">
       <param name="octane-tests" value="regexp"/>
     </antcall>
@@ -291,17 +291,56 @@
     </antcall>
   </target>
 
+  <!-- splay -->
+  <target name="octane-typescript" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="typescript"/>
+    </antcall>
+  </target>
+
+  <target name="octane-typescript-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-typescript" value="typescript"/>
+    </antcall>
+  </target>
+
+  <target name="octane-typescript-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="typescript"/>
+    </antcall>
+  </target>
+
+  <!-- zlib -->
+  <target name="octane-zlib" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="zlib"/>
+    </antcall>
+  </target>
+
+  <target name="octane-zlib-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-typescript" value="zlib"/>
+    </antcall>
+  </target>
+
+  <target name="octane-zlib-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="zlib"/>
+    </antcall>
+  </target>
+
   <!-- run octane benchmarks in a single process  -->
   <target name="octane-single-process" depends="octane-init">
     <antcall target="run-octane"/>
   </target>
 
-  <!-- mandreel excluded due to OOM -->
+  <!-- zlib excluded due to missing implementation of 'read' -->
   <target name="octane-separate-process" depends=
      "octane-box2d, octane-code-load, octane-crypto, 
       octane-deltablue, octane-earley-boyer, octane-gbemu,
-      octane-navier-stokes, octane-pdfjs, octane-raytrace, 
-      octane-regexp, octane-richards, octane-splay"/>
+      octane-mandreel, octane-navier-stokes, octane-pdfjs, 
+      octane-raytrace, octane-regexp, octane-richards, 
+      octane-splay, octane-typescript"/>
 
   <target name="--single-process" unless="${octane-test-sys-prop.separate.process}">
     <antcall target="octane-single-process"/>
@@ -330,6 +369,9 @@
           dir=".">
       <jvmarg line="${ext.class.path}"/>
       <jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>
+      <syspropertyset>
+        <propertyref prefix="nashorn."/>
+      </syspropertyset>
       <arg value="${octane-test-sys-prop.test.js.framework}"/>
       <arg value="--"/>
       <arg value="${octane-tests}"/>
--- a/make/build.xml	Tue Jan 21 18:17:23 2014 -0800
+++ b/make/build.xml	Mon Jan 27 21:01:55 2014 -0800
@@ -66,13 +66,16 @@
     <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt">
       <istrue value="${make.code.coverage}" />
     </condition>
+
+    <condition property="jfr.options" value="${run.test.jvmargs.jfr}" else="">
+      <istrue value="${jfr}"/>
+    </condition>
   </target>
 
   <target name="init" depends="init-conditions, init-cc">
-
     <!-- extends jvm args -->
-    <property name="run.test.jvmargs" value="${run.test.jvmargs.main}  ${run.test.cc.jvmargs}"/>
-    <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main}  ${run.test.cc.jvmargs}" />
+    <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
+    <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
 
     <echo message="run.test.jvmargs=${run.test.jvmargs}"/>
     <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
@@ -301,6 +304,10 @@
     permission java.lang.RuntimePermission "nashorn.JavaReflection";
 };
 
+grant codeBase "file:/${basedir}/test/script/markdown.js" {
+    permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read";
+};
+
     </echo>
 
     <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace>    <!--hack for Windows - to make URLs with normal path separators -->
@@ -316,6 +323,7 @@
       <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/>
       <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/>
       <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
+      <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/>
   </target>
 
   <target name="check-testng" unless="testng.available">
@@ -339,6 +347,9 @@
       <jvmarg line="${ext.class.path}"/>
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
       <propertyset>
+        <propertyref prefix="nashorn."/>
+      </propertyset>
+      <propertyset>
         <propertyref prefix="test-sys-prop."/>
         <mapper from="test-sys-prop.*" to="*" type="glob"/>
       </propertyset>
@@ -393,6 +404,25 @@
     </testng>
   </target>
   
+  <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+    <fileset id="test.classes" dir="${build.test.classes.dir}">
+       <include name="**/framework/*Test.class"/>
+    </fileset>
+
+    <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
+       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+      <propertyset>
+        <propertyref prefix="testmarkdown-test-sys-prop."/>
+        <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
+      </propertyset>
+      <classpath>
+          <pathelement path="${run.test.classpath}"/>
+      </classpath>
+    </testng>
+  </target>
+  
   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
@@ -403,6 +433,9 @@
       <jvmarg line="${ext.class.path}"/>
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
       <propertyset>
+        <propertyref prefix="nashorn."/>
+      </propertyset>
+      <propertyset>
         <propertyref prefix="test262-test-sys-prop."/>
         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
       </propertyset>
@@ -537,6 +570,11 @@
     <mkdir dir="${test.external.dir}/yui"/>
     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
+    
+    <!-- showdown -->
+    <mkdir dir="${test.external.dir}/showdown"/>
+    <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
+    <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
 
   </target>
 
--- a/make/project.properties	Tue Jan 21 18:17:23 2014 -0800
+++ b/make/project.properties	Mon Jan 27 21:01:55 2014 -0800
@@ -71,6 +71,9 @@
 fxshell.dir = tools/fxshell
 fxshell.jar = ${dist.dir}/nashornfx.jar
 
+# configuration for java flight recorder
+run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128
+
 # jars refererred
 file.reference.testng.jar=test/lib/testng.jar
 
@@ -119,6 +122,7 @@
 test262.dir=${test.external.dir}/test262
 test262.suite.dir=${test262.dir}/test/suite
 testjfx.dir=${test.script.dir}/jfx
+testmarkdown.dir=${test.script.dir}/markdown
 
 test-sys-prop.test.dir=${test.dir}
 test-sys-prop.test.js.roots=${test.basic.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir}
@@ -209,6 +213,16 @@
     ${test262.dir}/test/harness/framework.js \
     ${test262.dir}/test/harness/sta.js
 
+# testmarkdown test root
+testmarkdown-test-sys-prop.test.js.roots=${testmarkdown.dir}    
+
+# execute testmarkdown tests in shared nashorn context or not?
+testmarkdown-test-sys-prop.test.js.shared.context=false
+
+# framework root for markdown script tests
+testmarkdown-test-sys-prop.test.js.framework=\
+    ${test.script.dir}${file.separator}markdown.js
+
 # testjfx test root
 testjfx-test-sys-prop.test.js.roots=${testjfx.dir}   
 
--- a/src/jdk/nashorn/api/scripting/NashornException.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/api/scripting/NashornException.java	Mon Jan 27 21:01:55 2014 -0800
@@ -29,6 +29,7 @@
 import java.util.List;
 import jdk.nashorn.internal.codegen.CompilerConstants;
 import jdk.nashorn.internal.runtime.ECMAErrors;
+import jdk.nashorn.internal.runtime.ScriptObject;
 
 /**
  * This is base exception for all Nashorn exceptions. These originate from
@@ -44,11 +45,13 @@
 @SuppressWarnings("serial")
 public abstract class NashornException extends RuntimeException {
     // script file name
-    private final String fileName;
+    private String fileName;
     // script line number
-    private final int line;
+    private int line;
     // script column number
-    private final int column;
+    private int column;
+    // underlying ECMA error object - lazily initialized
+    private Object ecmaError;
 
     /** script source name used for "engine.js" */
     public static final String ENGINE_SCRIPT_SOURCE_NAME = "nashorn:engine/resources/engine.js";
@@ -122,6 +125,15 @@
     }
 
     /**
+     * Set the source file name for this {@code NashornException}
+     *
+     * @param fileName the file name
+     */
+    public final void setFileName(final String fileName) {
+        this.fileName = fileName;
+    }
+
+    /**
      * Get the line number for this {@code NashornException}
      *
      * @return the line number
@@ -131,15 +143,33 @@
     }
 
     /**
+     * Set the line number for this {@code NashornException}
+     *
+     * @param line the line number
+     */
+    public final void setLineNumber(final int line) {
+        this.line = line;
+    }
+
+    /**
      * Get the column for this {@code NashornException}
      *
-     * @return the column
+     * @return the column number
      */
     public final int getColumnNumber() {
         return column;
     }
 
     /**
+     * Set the column for this {@code NashornException}
+     *
+     * @param column the column number
+     */
+    public final void setColumnNumber(final int column) {
+        this.column = column;
+    }
+
+    /**
      * Returns array javascript stack frames from the given exception object.
      *
      * @param exception exception from which stack frames are retrieved and filtered
@@ -155,6 +185,11 @@
                 if (methodName.equals(CompilerConstants.RUN_SCRIPT.symbolName())) {
                     methodName = "<program>";
                 }
+
+                if (methodName.contains(CompilerConstants.ANON_FUNCTION_PREFIX.symbolName())) {
+                    methodName = "<anonymous>";
+                }
+
                 filtered.add(new StackTraceElement(className, methodName,
                         st.getFileName(), st.getLineNumber()));
             }
@@ -188,4 +223,43 @@
         }
         return buf.toString();
     }
+
+    protected Object getThrown() {
+        return null;
+    }
+
+    protected NashornException initEcmaError(final ScriptObject global) {
+        if (ecmaError != null) {
+            return this; // initialized already!
+        }
+
+        final Object thrown = getThrown();
+        if (thrown instanceof ScriptObject) {
+            setEcmaError(ScriptObjectMirror.wrap(thrown, global));
+        } else {
+            setEcmaError(thrown);
+        }
+
+        return this;
+    }
+
+    /**
+     * Return the underlying ECMA error object, if available.
+     *
+     * @return underlying ECMA Error object's mirror or whatever was thrown
+     *         from script such as a String, Number or a Boolean.
+     */
+    public Object getEcmaError() {
+        return ecmaError;
+    }
+
+    /**
+     * Return the underlying ECMA error object, if available.
+     *
+     * @param ecmaError underlying ECMA Error object's mirror or whatever was thrown
+     *         from script such as a String, Number or a Boolean.
+     */
+    public void setEcmaError(final Object ecmaError) {
+        this.ecmaError = ecmaError;
+    }
 }
--- a/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Mon Jan 27 21:01:55 2014 -0800
@@ -476,16 +476,19 @@
     private Object invokeImpl(final Object selfObject, final String name, final Object... args) throws ScriptException, NoSuchMethodException {
         name.getClass(); // null check
 
+        ScriptObject invokeGlobal = null;
         ScriptObjectMirror selfMirror = null;
         if (selfObject instanceof ScriptObjectMirror) {
             selfMirror = (ScriptObjectMirror)selfObject;
             if (! isOfContext(selfMirror.getHomeGlobal(), nashornContext)) {
                 throw new IllegalArgumentException(getMessage("script.object.from.another.engine"));
             }
+            invokeGlobal = selfMirror.getHomeGlobal();
         } else if (selfObject instanceof ScriptObject) {
             // invokeMethod called from script code - in which case we may get 'naked' ScriptObject
             // Wrap it with oldGlobal to make a ScriptObjectMirror for the same.
             final ScriptObject oldGlobal = Context.getGlobal();
+            invokeGlobal = oldGlobal;
             if (oldGlobal == null) {
                 throw new IllegalArgumentException(getMessage("no.current.nashorn.global"));
             }
@@ -498,6 +501,7 @@
         } else if (selfObject == null) {
             // selfObject is null => global function call
             final ScriptObject ctxtGlobal = getNashornGlobalFrom(context);
+            invokeGlobal = ctxtGlobal;
             selfMirror = (ScriptObjectMirror)ScriptObjectMirror.wrap(ctxtGlobal, ctxtGlobal);
         }
 
@@ -509,7 +513,7 @@
                 if (cause instanceof NoSuchMethodException) {
                     throw (NoSuchMethodException)cause;
                 }
-                throwAsScriptException(e);
+                throwAsScriptException(e, invokeGlobal);
                 throw new AssertionError("should not reach here");
             }
         }
@@ -543,7 +547,7 @@
             }
             return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal));
         } catch (final Exception e) {
-            throwAsScriptException(e);
+            throwAsScriptException(e, ctxtGlobal);
             throw new AssertionError("should not reach here");
         } finally {
             if (globalChanged) {
@@ -552,7 +556,7 @@
         }
     }
 
-    private static void throwAsScriptException(final Exception e) throws ScriptException {
+    private static void throwAsScriptException(final Exception e, final ScriptObject global) throws ScriptException {
         if (e instanceof ScriptException) {
             throw (ScriptException)e;
         } else if (e instanceof NashornException) {
@@ -560,6 +564,7 @@
             final ScriptException se = new ScriptException(
                 ne.getMessage(), ne.getFileName(),
                 ne.getLineNumber(), ne.getColumnNumber());
+            ne.initEcmaError(global);
             se.initCause(e);
             throw se;
         } else if (e instanceof RuntimeException) {
@@ -605,7 +610,7 @@
 
             return nashornContext.compileScript(source, newGlobal);
         } catch (final Exception e) {
-            throwAsScriptException(e);
+            throwAsScriptException(e, newGlobal);
             throw new AssertionError("should not reach here");
         } finally {
             if (globalChanged) {
@@ -621,6 +626,11 @@
                 continue;
             }
 
+            // skip check for default methods - non-abstract, interface methods
+            if (! Modifier.isAbstract(method.getModifiers())) {
+                continue;
+            }
+
             Object obj = sobj.get(method.getName());
             if (! (obj instanceof ScriptFunction)) {
                 return false;
--- a/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Mon Jan 27 21:01:55 2014 -0800
@@ -108,6 +108,8 @@
             }
 
             throw new RuntimeException("not a function: " + toString());
+        } catch (final NashornException ne) {
+            throw ne.initEcmaError(global);
         } catch (final RuntimeException | Error e) {
             throw e;
         } catch (final Throwable t) {
@@ -135,6 +137,8 @@
             }
 
             throw new RuntimeException("not a constructor: " + toString());
+        } catch (final NashornException ne) {
+            throw ne.initEcmaError(global);
         } catch (final RuntimeException | Error e) {
             throw e;
         } catch (final Throwable t) {
@@ -182,6 +186,8 @@
             }
 
             throw new NoSuchMethodException("No such function " + functionName);
+        } catch (final NashornException ne) {
+            throw ne.initEcmaError(global);
         } catch (final RuntimeException | Error e) {
             throw e;
         } catch (final Throwable t) {
@@ -717,6 +723,8 @@
         }
         try {
             return callable.call();
+        } catch (final NashornException ne) {
+            throw ne.initEcmaError(global);
         } catch (final RuntimeException e) {
             throw e;
         } catch (final Exception e) {
--- a/src/jdk/nashorn/internal/codegen/Attr.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/Attr.java	Mon Jan 27 21:01:55 2014 -0800
@@ -766,7 +766,7 @@
                 symbol.setType(Type.OBJECT);
             }
 
-            returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType());
+            returnType = widestReturnType(returnTypes.pop(), symbol.getSymbolType());
         } else {
             returnType = Type.OBJECT; //undefined
         }
@@ -1433,10 +1433,30 @@
         ensureTypeNotUnknown(trueExpr);
         ensureTypeNotUnknown(falseExpr);
 
-        final Type type = Type.widest(trueExpr.getType(), falseExpr.getType());
+        final Type type = widestReturnType(trueExpr.getType(), falseExpr.getType());
         return end(ensureSymbol(type, ternaryNode));
     }
 
+    /**
+     * When doing widening for return types of a function or a ternary operator, it is not valid to widen a boolean to
+     * anything other than Object. Also, widening a numeric type to an object type must widen to Object proper and not
+     * any more specific subclass (e.g. widest of int/long/double and String is Object).
+     * @param t1 type 1
+     * @param t2 type 2
+     * @return wider of t1 and t2, except if one is boolean and the other is neither boolean nor unknown, or if one is
+     * numeric and the other is neither numeric nor unknown in which case {@code Type.OBJECT} is returned.
+     */
+    private static Type widestReturnType(final Type t1, final Type t2) {
+        if (t1.isUnknown()) {
+            return t2;
+        } else if (t2.isUnknown()) {
+            return t1;
+        } else if (t1.isBoolean() != t2.isBoolean() || t1.isNumeric() != t2.isNumeric()) {
+            return Type.OBJECT;
+        }
+        return Type.widest(t1, t2);
+    }
+
     private void initCompileConstant(final CompilerConstants cc, final Block block, final int flags) {
         final Class<?> type = cc.type();
         // Must not call this method for constants with no explicit types; use the one with (..., Type) signature instead.
--- a/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Mon Jan 27 21:01:55 2014 -0800
@@ -2023,8 +2023,6 @@
             return false;
         }
 
-        method._new(ECMAException.class).dup();
-
         final Source source     = lc.getCurrentFunction().getSource();
 
         final Expression expression = throwNode.getExpression();
@@ -2037,7 +2035,7 @@
         method.load(source.getName());
         method.load(line);
         method.load(column);
-        method.invoke(ECMAException.THROW_INIT);
+        method.invoke(ECMAException.CREATE);
 
         method.athrow();
 
--- a/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java	Mon Jan 27 21:01:55 2014 -0800
@@ -158,7 +158,7 @@
         if (scopeCalls.containsKey(scopeCall)) {
             return scopeCalls.get(scopeCall);
         }
-        scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName("scopeCall"));
+        scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName(":scopeCall"));
         scopeCalls.put(scopeCall, scopeCall);
         return scopeCall;
     }
@@ -177,7 +177,7 @@
         if (scopeCalls.containsKey(scopeCall)) {
             return scopeCalls.get(scopeCall);
         }
-        scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName("scopeCall"));
+        scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName(":scopeCall"));
         scopeCalls.put(scopeCall, scopeCall);
         return scopeCall;
     }
--- a/src/jdk/nashorn/internal/codegen/Compiler.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Jan 27 21:01:55 2014 -0800
@@ -85,6 +85,8 @@
 
     private Source source;
 
+    private String sourceName;
+
     private final Map<String, byte[]> bytecode;
 
     private final Set<CompileUnit> compileUnits;
@@ -267,6 +269,7 @@
                 append('$').
                 append(safeSourceName(functionNode.getSource()));
         this.source = functionNode.getSource();
+        this.sourceName = functionNode.getSourceName();
         this.scriptName = sb.toString();
     }
 
@@ -573,7 +576,7 @@
     }
 
     private CompileUnit initCompileUnit(final String unitClassName, final long initialWeight) {
-        final ClassEmitter classEmitter = new ClassEmitter(env, source.getName(), unitClassName, strict);
+        final ClassEmitter classEmitter = new ClassEmitter(env, sourceName, unitClassName, strict);
         final CompileUnit  compileUnit  = new CompileUnit(unitClassName, classEmitter, initialWeight);
 
         classEmitter.begin();
--- a/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Mon Jan 27 21:01:55 2014 -0800
@@ -41,6 +41,7 @@
  */
 
 public enum CompilerConstants {
+
     /** the __FILE__ variable */
     __FILE__,
 
@@ -75,7 +76,7 @@
     DEFAULT_SCRIPT_NAME("Script"),
 
     /** function prefix for anonymous functions */
-    FUNCTION_PREFIX("function$"),
+    ANON_FUNCTION_PREFIX("L:"),
 
     /** method name for Java method that is script entry point */
     RUN_SCRIPT("runScript"),
@@ -149,26 +150,31 @@
     ALLOCATE("allocate"),
 
     /** prefix for split methods, @see Splitter */
-    SPLIT_PREFIX("$split"),
+    SPLIT_PREFIX(":split"),
 
     /** prefix for split array method and slot */
-    SPLIT_ARRAY_ARG("split_array", 3),
+    SPLIT_ARRAY_ARG(":split_array", 3),
 
     /** get string from constant pool */
-    GET_STRING("$getString"),
+    GET_STRING(":getString"),
 
     /** get map */
-    GET_MAP("$getMap"),
+    GET_MAP(":getMap"),
 
     /** get map */
-    SET_MAP("$setMap"),
+    SET_MAP(":setMap"),
 
     /** get array prefix */
-    GET_ARRAY_PREFIX("$get"),
+    GET_ARRAY_PREFIX(":get"),
 
     /** get array suffix */
     GET_ARRAY_SUFFIX("$array");
 
+    /**
+     * Prefix used for internal methods generated in script clases.
+     */
+    public static final String INTERNAL_METHOD_PREFIX = ":";
+
     private final String symbolName;
     private final Class<?> type;
     private final int slot;
--- a/src/jdk/nashorn/internal/codegen/MethodEmitter.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/MethodEmitter.java	Mon Jan 27 21:01:55 2014 -0800
@@ -1130,7 +1130,11 @@
             popType(Type.OBJECT);
         }
 
-        method.visitMethodInsn(opcode, className, methodName, methodDescriptor);
+        if (opcode == INVOKEINTERFACE) {
+            method.visitMethodInsn(opcode, className, methodName, methodDescriptor, true);
+        } else {
+            method.visitMethodInsn(opcode, className, methodName, methodDescriptor, false);
+        }
 
         if (returnType != null) {
             pushType(returnType);
--- a/src/jdk/nashorn/internal/codegen/types/Type.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/codegen/types/Type.java	Mon Jan 27 21:01:55 2014 -0800
@@ -261,7 +261,7 @@
     }
 
     static void invokeStatic(final MethodVisitor method, final Call call) {
-        method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor());
+        method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor(), false);
     }
 
     /**
--- a/src/jdk/nashorn/internal/ir/FunctionNode.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/ir/FunctionNode.java	Mon Jan 27 21:01:55 2014 -0800
@@ -29,6 +29,7 @@
 import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import jdk.nashorn.internal.codegen.CompileUnit;
 import jdk.nashorn.internal.codegen.Compiler;
@@ -138,6 +139,9 @@
     /** Function flags. */
     private final int flags;
 
+    /** //@ sourceURL or //# sourceURL for program function nodes */
+    private final String sourceURL;
+
     private final int lineNumber;
 
     /** Is anonymous function flag. */
@@ -223,6 +227,7 @@
      * @param parameters parameter list
      * @param kind       kind of function as in {@link FunctionNode.Kind}
      * @param flags      initial flags
+     * @param sourceURL  sourceURL specified in script (optional)
      */
     public FunctionNode(
         final Source source,
@@ -235,7 +240,8 @@
         final String name,
         final List<IdentNode> parameters,
         final FunctionNode.Kind kind,
-        final int flags) {
+        final int flags,
+        final String sourceURL) {
         super(token, finish);
 
         this.source           = source;
@@ -250,6 +256,7 @@
         this.compilationState = EnumSet.of(CompilationState.INITIALIZED);
         this.declaredSymbols  = new HashSet<>();
         this.flags            = flags;
+        this.sourceURL        = sourceURL;
         this.compileUnit      = null;
         this.body             = null;
         this.snapshot         = null;
@@ -260,6 +267,7 @@
         final FunctionNode functionNode,
         final long lastToken,
         final int flags,
+        final String sourceURL,
         final String name,
         final Type returnType,
         final CompileUnit compileUnit,
@@ -271,6 +279,7 @@
         super(functionNode);
         this.lineNumber       = functionNode.lineNumber;
         this.flags            = flags;
+        this.sourceURL        = sourceURL;
         this.name             = name;
         this.returnType       = returnType;
         this.compileUnit      = compileUnit;
@@ -308,6 +317,38 @@
     }
 
     /**
+     * get source name - sourceURL or name derived from Source.
+     *
+     * @return name for the script source
+     */
+    public String getSourceName() {
+        return (sourceURL != null)? sourceURL : source.getName();
+    }
+
+    /**
+     * get the sourceURL
+     * @return the sourceURL
+     */
+    public String getSourceURL() {
+        return sourceURL;
+    }
+
+    /**
+     * Set the sourceURL
+     *
+     * @param lc lexical context
+     * @param newSourceURL source url string to set
+     * @return function node or a new one if state was changed
+     */
+    public FunctionNode setSourceURL(final LexicalContext lc, final String newSourceURL) {
+        if (Objects.equals(sourceURL, newSourceURL)) {
+            return this;
+        }
+
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, newSourceURL, name, returnType, compileUnit, compilationState, body, parameters, null, hints));
+    }
+
+    /**
      * Returns the line number.
      * @return the line number.
      */
@@ -335,7 +376,7 @@
         if (this.snapshot == null) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, null, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, null, hints));
     }
 
     /**
@@ -351,7 +392,7 @@
         if (isProgram() || parameters.isEmpty()) {
             return this; //never specialize anything that won't be recompiled
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, this, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, this, hints));
     }
 
     /**
@@ -409,7 +450,7 @@
         }
         final EnumSet<CompilationState> newState = EnumSet.copyOf(this.compilationState);
         newState.add(state);
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, newState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, newState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -430,7 +471,7 @@
         if (this.hints == hints) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -483,7 +524,7 @@
         if (this.flags == flags) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     @Override
@@ -593,7 +634,7 @@
         if(this.body == body) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags | (body.needsScope() ? FunctionNode.HAS_SCOPE_BLOCK : 0), name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags | (body.needsScope() ? FunctionNode.HAS_SCOPE_BLOCK : 0), sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -688,7 +729,7 @@
         if (this.lastToken == lastToken) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -710,7 +751,7 @@
         if (this.name.equals(name)) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -760,7 +801,7 @@
         if (this.parameters == parameters) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -825,6 +866,7 @@
                 this,
                 lastToken,
                 flags,
+                sourceURL,
                 name,
                 type,
                 compileUnit,
@@ -863,7 +905,7 @@
         if (this.compileUnit == compileUnit) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
--- a/src/jdk/nashorn/internal/objects/Global.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/Global.java	Mon Jan 27 21:01:55 2014 -0800
@@ -44,6 +44,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
+import jdk.nashorn.internal.lookup.Lookup;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Property;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
@@ -364,6 +365,11 @@
     private ScriptObject   builtinFloat32Array;
     private ScriptObject   builtinFloat64Array;
 
+    /*
+     * ECMA section 13.2.3 The [[ThrowTypeError]] Function Object
+     */
+    private ScriptFunction typeErrorThrower;
+
     private PropertyMap    accessorPropertyDescriptorMap;
     private PropertyMap    arrayBufferViewMap;
     private PropertyMap    dataPropertyDescriptorMap;
@@ -1114,6 +1120,10 @@
         return builtinArray;
     }
 
+    ScriptFunction getTypeErrorThrower() {
+        return typeErrorThrower;
+    }
+
     /**
      * Called from compiled script code to test if builtin has been overridden
      *
@@ -1695,8 +1705,25 @@
             initScripting(env);
         }
 
-        if (Context.DEBUG && System.getSecurityManager() == null) {
-            initDebug();
+        if (Context.DEBUG) {
+            boolean debugOkay;
+            final SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                try {
+                    sm.checkPermission(new RuntimePermission(Context.NASHORN_DEBUG_MODE));
+                    debugOkay = true;
+                } catch (final SecurityException ignored) {
+                    // if no permission, don't initialize Debug object
+                    debugOkay = false;
+                }
+
+            } else {
+                debugOkay = true;
+            }
+
+            if (debugOkay) {
+                initDebug();
+            }
         }
 
         copyBuiltins();
@@ -2000,6 +2027,13 @@
         anon.set("constructor", builtinFunction, false);
         anon.deleteOwnProperty(anon.getMap().findProperty("prototype"));
 
+        // use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3
+        this.typeErrorThrower = new ScriptFunctionImpl("TypeErrorThrower", Lookup.TYPE_ERROR_THROWER_GETTER, null, null, false, false, false);
+        typeErrorThrower.setPrototype(UNDEFINED);
+        // Non-constructor built-in functions do not have "prototype" property
+        typeErrorThrower.deleteOwnProperty(typeErrorThrower.getMap().findProperty("prototype"));
+        typeErrorThrower.preventExtensions();
+
         // now initialize Object
         this.builtinObject = (ScriptFunction)initConstructor("Object");
         final ScriptObject ObjectPrototype = getObjectPrototype();
--- a/src/jdk/nashorn/internal/objects/NativeError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -38,7 +38,6 @@
 import jdk.nashorn.internal.objects.annotations.Property;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
 import jdk.nashorn.internal.objects.annotations.Where;
-import jdk.nashorn.internal.objects.ScriptFunctionImpl;
 import jdk.nashorn.internal.runtime.ECMAException;
 import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.PropertyMap;
@@ -75,7 +74,7 @@
     static final String FILENAME = "__fileName__";
 
     /** Message property name */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** ECMA 15.11.4.2 Error.prototype.name */
@@ -86,6 +85,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -93,6 +96,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     private NativeError(final Object msg, final ScriptObject proto, final PropertyMap map) {
         super(proto, map);
         if (msg != UNDEFINED) {
@@ -100,6 +104,7 @@
         } else {
             this.delete(NativeError.MESSAGE, false);
         }
+        initException(this);
     }
 
     NativeError(final Object msg, final Global global) {
@@ -129,6 +134,14 @@
         return new NativeError(msg);
     }
 
+    // This is called NativeError, NativeTypeError etc. to
+    // associate a ECMAException with the ECMA Error object.
+    @SuppressWarnings("unused")
+    static void initException(final ScriptObject self) {
+        // ECMAException constructor has side effects
+        new ECMAException(self, null);
+    }
+
     /**
      * Nashorn extension: Error.captureStackTrace. Capture stack trace at the point of call into the Error object provided.
      *
@@ -136,16 +149,17 @@
      * @param errorObj the error object
      * @return undefined
      */
-    @SuppressWarnings("unused")
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
     public static Object captureStackTrace(final Object self, final Object errorObj) {
         Global.checkObject(errorObj);
         final ScriptObject sobj = (ScriptObject)errorObj;
-        new ECMAException(sobj, null); //constructor has side effects
-        sobj.delete("stack", false);
-        final ScriptFunction getStack = ScriptFunctionImpl.makeFunction("getStack", GET_STACK);
-        final ScriptFunction setStack = ScriptFunctionImpl.makeFunction("setStack", SET_STACK);
-        sobj.addOwnProperty("stack", Attribute.NOT_ENUMERABLE, getStack, setStack);
+        initException(sobj);
+        sobj.delete(STACK, false);
+        if (! sobj.has("stack")) {
+            final ScriptFunction getStack = ScriptFunctionImpl.makeFunction("getStack", GET_STACK);
+            final ScriptFunction setStack = ScriptFunctionImpl.makeFunction("setStack", SET_STACK);
+            sobj.addOwnProperty("stack", Attribute.NOT_ENUMERABLE, getStack, setStack);
+        }
         return UNDEFINED;
     }
 
@@ -226,7 +240,11 @@
     public static Object setLineNumber(final Object self, final Object value) {
         Global.checkObject(self);
         final ScriptObject sobj = (ScriptObject)self;
-        sobj.set(LINENUMBER, value, false);
+        if (sobj.hasOwnProperty(LINENUMBER)) {
+            sobj.put(LINENUMBER, value, false);
+        } else {
+            sobj.addOwnProperty(LINENUMBER, Attribute.NOT_ENUMERABLE, value);
+        }
         return value;
     }
 
@@ -254,7 +272,11 @@
     public static Object setColumnNumber(final Object self, final Object value) {
         Global.checkObject(self);
         final ScriptObject sobj = (ScriptObject)self;
-        sobj.set(COLUMNNUMBER, value, false);
+        if (sobj.hasOwnProperty(COLUMNNUMBER)) {
+            sobj.put(COLUMNNUMBER, value, false);
+        } else {
+            sobj.addOwnProperty(COLUMNNUMBER, Attribute.NOT_ENUMERABLE, value);
+        }
         return value;
     }
 
@@ -282,7 +304,11 @@
     public static Object setFileName(final Object self, final Object value) {
         Global.checkObject(self);
         final ScriptObject sobj = (ScriptObject)self;
-        sobj.set(FILENAME, value, false);
+        if (sobj.hasOwnProperty(FILENAME)) {
+            sobj.put(FILENAME, value, false);
+        } else {
+            sobj.addOwnProperty(FILENAME, Attribute.NOT_ENUMERABLE, value);
+        }
         return value;
     }
 
@@ -304,10 +330,12 @@
 
         final Object exception = ECMAException.getException(sobj);
         if (exception instanceof Throwable) {
-            return getScriptStackString(sobj, (Throwable)exception);
+            Object value = getScriptStackString(sobj, (Throwable)exception);
+            sobj.put(STACK, value, false);
+            return value;
         }
 
-        return "";
+        return UNDEFINED;
     }
 
     /**
--- a/src/jdk/nashorn/internal/objects/NativeEvalError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeEvalError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -44,7 +44,7 @@
 public final class NativeEvalError extends ScriptObject {
 
     /** message property in instance */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** error name property */
@@ -55,6 +55,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -62,6 +66,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     private NativeEvalError(final Object msg, final ScriptObject proto, final PropertyMap map) {
         super(proto, map);
         if (msg != UNDEFINED) {
@@ -69,6 +74,7 @@
         } else {
             this.delete(NativeError.MESSAGE, false);
         }
+        NativeError.initException(this);
     }
 
     NativeEvalError(final Object msg, final Global global) {
--- a/src/jdk/nashorn/internal/objects/NativeJavaImporter.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeJavaImporter.java	Mon Jan 27 21:01:55 2014 -0800
@@ -133,6 +133,11 @@
         return createAndSetProperty(desc) ? super.lookup(desc, request) : super.noSuchMethod(desc, request);
     }
 
+    @Override
+    protected Object invokeNoSuchProperty(final String name) {
+        return createProperty(name);
+    }
+
     private boolean createAndSetProperty(final CallSiteDescriptor desc) {
         final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
         final Object value = createProperty(name);
--- a/src/jdk/nashorn/internal/objects/NativeMath.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeMath.java	Mon Jan 27 21:01:55 2014 -0800
@@ -92,7 +92,7 @@
      * @return abs of value
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object abs(final Object self, final Object x) {
+    public static double abs(final Object self, final Object x) {
         return Math.abs(JSType.toNumber(x));
     }
 
@@ -144,7 +144,7 @@
      * @return acos of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object acos(final Object self, final Object x) {
+    public static double acos(final Object self, final Object x) {
         return Math.acos(JSType.toNumber(x));
     }
 
@@ -170,7 +170,7 @@
      * @return asin of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object asin(final Object self, final Object x) {
+    public static double asin(final Object self, final Object x) {
         return Math.asin(JSType.toNumber(x));
     }
 
@@ -196,7 +196,7 @@
      * @return atan of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object atan(final Object self, final Object x) {
+    public static double atan(final Object self, final Object x) {
         return Math.atan(JSType.toNumber(x));
     }
 
@@ -223,7 +223,7 @@
      * @return atan2 of x and y
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object atan2(final Object self, final Object y, final Object x) {
+    public static double atan2(final Object self, final Object y, final Object x) {
         return Math.atan2(JSType.toNumber(y), JSType.toNumber(x));
     }
 
@@ -250,7 +250,7 @@
      * @return ceil of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object ceil(final Object self, final Object x) {
+    public static double ceil(final Object self, final Object x) {
         return Math.ceil(JSType.toNumber(x));
     }
 
@@ -302,7 +302,7 @@
      * @return cos of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object cos(final Object self, final Object x) {
+    public static double cos(final Object self, final Object x) {
         return Math.cos(JSType.toNumber(x));
     }
 
@@ -328,7 +328,7 @@
      * @return exp of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object exp(final Object self, final Object x) {
+    public static double exp(final Object self, final Object x) {
         return Math.exp(JSType.toNumber(x));
     }
 
@@ -341,7 +341,7 @@
      * @return floor of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object floor(final Object self, final Object x) {
+    public static double floor(final Object self, final Object x) {
         return Math.floor(JSType.toNumber(x));
     }
 
@@ -393,7 +393,7 @@
      * @return log of argument
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object log(final Object self, final Object x) {
+    public static double log(final Object self, final Object x) {
         return Math.log(JSType.toNumber(x));
     }
 
@@ -419,7 +419,7 @@
      * @return the largest of the arguments, {@link Double#NEGATIVE_INFINITY} if no args given, or identity if one arg is given
      */
     @Function(arity = 2, attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object max(final Object self, final Object... args) {
+    public static double max(final Object self, final Object... args) {
         switch (args.length) {
         case 0:
             return Double.NEGATIVE_INFINITY;
@@ -497,7 +497,7 @@
      * @return the smallest of the arguments, {@link Double#NEGATIVE_INFINITY} if no args given, or identity if one arg is given
      */
     @Function(arity = 2, attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object min(final Object self, final Object... args) {
+    public static double min(final Object self, final Object... args) {
         switch (args.length) {
         case 0:
             return Double.POSITIVE_INFINITY;
@@ -576,7 +576,7 @@
      * @return x raised to the power of y
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object pow(final Object self, final Object x, final Object y) {
+    public static double pow(final Object self, final Object x, final Object y) {
         return Math.pow(JSType.toNumber(x), JSType.toNumber(y));
     }
 
@@ -602,7 +602,7 @@
      * @return random number in the range [0..1)
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object random(final Object self) {
+    public static double random(final Object self) {
         return Math.random();
     }
 
@@ -615,7 +615,7 @@
      * @return x rounded
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object round(final Object self, final Object x) {
+    public static double round(final Object self, final Object x) {
         final double d = JSType.toNumber(x);
         if (Math.getExponent(d) >= 52) {
             return d;
@@ -632,7 +632,7 @@
      * @return sin of x
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object sin(final Object self, final Object x) {
+    public static double sin(final Object self, final Object x) {
         return Math.sin(JSType.toNumber(x));
     }
 
@@ -658,7 +658,7 @@
      * @return sqrt of x
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object sqrt(final Object self, final Object x) {
+    public static double sqrt(final Object self, final Object x) {
         return Math.sqrt(JSType.toNumber(x));
     }
 
@@ -684,7 +684,7 @@
      * @return tan of x
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where=Where.CONSTRUCTOR)
-    public static Object tan(final Object self, final Object x) {
+    public static double tan(final Object self, final Object x) {
         return Math.tan(JSType.toNumber(x));
     }
 
--- a/src/jdk/nashorn/internal/objects/NativeRangeError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeRangeError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -44,7 +44,7 @@
 public final class NativeRangeError extends ScriptObject {
 
     /** message property in instance */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** error name property */
@@ -55,6 +55,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -62,6 +66,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     private NativeRangeError(final Object msg, final ScriptObject proto, final PropertyMap map) {
         super(proto, map);
         if (msg != UNDEFINED) {
@@ -69,6 +74,7 @@
         } else {
             this.delete(NativeError.MESSAGE, false);
         }
+        NativeError.initException(this);
     }
 
     NativeRangeError(final Object msg, final Global global) {
--- a/src/jdk/nashorn/internal/objects/NativeReferenceError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeReferenceError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -44,7 +44,7 @@
 public final class NativeReferenceError extends ScriptObject {
 
     /** message property in instance */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** error name property */
@@ -55,6 +55,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -62,6 +66,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     private NativeReferenceError(final Object msg, final ScriptObject proto, final PropertyMap map) {
         super(proto, map);
         if (msg != UNDEFINED) {
@@ -69,6 +74,7 @@
         } else {
             this.delete(NativeError.MESSAGE, false);
         }
+        NativeError.initException(this);
     }
 
     NativeReferenceError(final Object msg, final Global global) {
--- a/src/jdk/nashorn/internal/objects/NativeStrictArguments.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeStrictArguments.java	Mon Jan 27 21:01:55 2014 -0800
@@ -76,7 +76,7 @@
         super(proto, map);
         setIsArguments();
 
-        final ScriptFunction func = ScriptFunctionImpl.getTypeErrorThrower();
+        final ScriptFunction func = Global.instance().getTypeErrorThrower();
         // We have to fill user accessor functions late as these are stored
         // in this object rather than in the PropertyMap of this object.
         setUserAccessors("caller", func, func);
--- a/src/jdk/nashorn/internal/objects/NativeSyntaxError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeSyntaxError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -44,7 +44,7 @@
 public final class NativeSyntaxError extends ScriptObject {
 
     /** message property in instance */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** error name property */
@@ -55,6 +55,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -62,6 +66,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     NativeSyntaxError(final Object msg, final Global global) {
         super(global.getSyntaxErrorPrototype(), global.getSyntaxErrorMap());
         if (msg != UNDEFINED) {
@@ -69,6 +74,7 @@
         } else {
             this.delete(NativeError.MESSAGE, false);
         }
+        NativeError.initException(this);
     }
 
     private NativeSyntaxError(final Object msg) {
--- a/src/jdk/nashorn/internal/objects/NativeTypeError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeTypeError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -44,7 +44,7 @@
 public final class NativeTypeError extends ScriptObject {
 
     /** message property in instance */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** error name property */
@@ -55,6 +55,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -62,6 +66,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     NativeTypeError(final Object msg, final Global global) {
         super(global.getTypeErrorPrototype(), global.getTypeErrorMap());
         if (msg != UNDEFINED) {
@@ -69,6 +74,7 @@
         } else {
             delete(NativeError.MESSAGE, false);
         }
+        NativeError.initException(this);
     }
 
     private NativeTypeError(final Object msg) {
--- a/src/jdk/nashorn/internal/objects/NativeURIError.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/NativeURIError.java	Mon Jan 27 21:01:55 2014 -0800
@@ -43,7 +43,7 @@
 public final class NativeURIError extends ScriptObject {
 
     /** message property in instance */
-    @Property(name = NativeError.MESSAGE)
+    @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
     public Object instMessage;
 
     /** error name property */
@@ -54,6 +54,10 @@
     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
     public Object message;
 
+    /** Nashorn extension: underlying exception */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public Object nashornException;
+
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -61,6 +65,7 @@
         return $nasgenmap$;
     }
 
+    @SuppressWarnings("LeakingThisInConstructor")
     NativeURIError(final Object msg, final Global global) {
         super(global.getURIErrorPrototype(), global.getURIErrorMap());
         if (msg != UNDEFINED) {
@@ -68,6 +73,7 @@
         } else {
             this.delete(NativeError.MESSAGE, false);
         }
+        NativeError.initException(this);
     }
 
     private NativeURIError(final Object msg) {
--- a/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Mon Jan 27 21:01:55 2014 -0800
@@ -170,26 +170,6 @@
         boundfunctionmap$.setIsShared();
     }
 
-    // function object representing TypeErrorThrower
-    private static ScriptFunction typeErrorThrower;
-
-    /*
-     * ECMA section 13.2.3 The [[ThrowTypeError]] Function Object
-     */
-    static synchronized ScriptFunction getTypeErrorThrower() {
-        if (typeErrorThrower == null) {
-            // use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3
-            final ScriptFunctionImpl func = new ScriptFunctionImpl("TypeErrorThrower", Lookup.TYPE_ERROR_THROWER_GETTER, null, null, false, false, false);
-            func.setPrototype(UNDEFINED);
-            // Non-constructor built-in functions do not have "prototype" property
-            func.deleteOwnProperty(func.getMap().findProperty("prototype"));
-            func.preventExtensions();
-            typeErrorThrower = func;
-        }
-
-        return typeErrorThrower;
-    }
-
     private static PropertyMap createStrictModeMap(final PropertyMap map) {
         final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE;
         PropertyMap newMap = map;
@@ -313,12 +293,13 @@
         // We have to fill user accessor functions late as these are stored
         // in this object rather than in the PropertyMap of this object.
 
+        final ScriptFunction errorThrower = global.getTypeErrorThrower();
         if (findProperty("arguments", true) != null) {
-            setUserAccessors("arguments", getTypeErrorThrower(), getTypeErrorThrower());
+            setUserAccessors("arguments", errorThrower, errorThrower);
         }
 
         if (findProperty("caller", true) != null) {
-            setUserAccessors("caller", getTypeErrorThrower(), getTypeErrorThrower());
+            setUserAccessors("caller", errorThrower, errorThrower);
         }
     }
 }
--- a/src/jdk/nashorn/internal/parser/AbstractParser.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/parser/AbstractParser.java	Mon Jan 27 21:01:55 2014 -0800
@@ -26,6 +26,7 @@
 package jdk.nashorn.internal.parser;
 
 import static jdk.nashorn.internal.parser.TokenType.COMMENT;
+import static jdk.nashorn.internal.parser.TokenType.DIRECTIVE_COMMENT;
 import static jdk.nashorn.internal.parser.TokenType.EOF;
 import static jdk.nashorn.internal.parser.TokenType.EOL;
 import static jdk.nashorn.internal.parser.TokenType.IDENT;
@@ -84,6 +85,9 @@
     /** Is this parser running under strict mode? */
     protected boolean isStrictMode;
 
+    /** //@ sourceURL or //# sourceURL */
+    protected String sourceURL;
+
     /**
      * Construct a parser.
      *
@@ -156,17 +160,38 @@
     protected final TokenType nextOrEOL() {
         do {
             nextToken();
-        } while (type == COMMENT);
+            if (type == DIRECTIVE_COMMENT) {
+                checkDirectiveComment();
+            }
+        } while (type == COMMENT || type == DIRECTIVE_COMMENT);
 
         return type;
     }
 
+    // sourceURL= after directive comment
+    private static final String SOURCE_URL_PREFIX = "sourceURL=";
+
+    // currently only @sourceURL=foo supported
+    private void checkDirectiveComment() {
+        // if already set, ignore this one
+        if (sourceURL != null) {
+            return;
+        }
+
+        final String comment = (String) lexer.getValueOf(token, isStrictMode);
+        final int len = comment.length();
+        // 4 characters for directive comment marker //@\s or //#\s
+        if (len > 4 && comment.substring(4).startsWith(SOURCE_URL_PREFIX)) {
+            sourceURL = comment.substring(4 + SOURCE_URL_PREFIX.length());
+        }
+    }
+
     /**
      * Seek next token.
      *
      * @return tokenType of next token.
      */
-    private final TokenType nextToken() {
+    private TokenType nextToken() {
         // Capture last token tokenType.
         last = type;
         if (type != EOF) {
--- a/src/jdk/nashorn/internal/parser/Lexer.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/parser/Lexer.java	Mon Jan 27 21:01:55 2014 -0800
@@ -27,6 +27,7 @@
 
 import static jdk.nashorn.internal.parser.TokenType.ADD;
 import static jdk.nashorn.internal.parser.TokenType.COMMENT;
+import static jdk.nashorn.internal.parser.TokenType.DIRECTIVE_COMMENT;
 import static jdk.nashorn.internal.parser.TokenType.DECIMAL;
 import static jdk.nashorn.internal.parser.TokenType.EOF;
 import static jdk.nashorn.internal.parser.TokenType.EOL;
@@ -434,12 +435,18 @@
             if (ch1 == '/') {
                 // Skip over //.
                 skip(2);
+
+                boolean directiveComment = false;
+                if ((ch0 == '#' || ch0 == '@') && (ch1 == ' ')) {
+                    directiveComment = true;
+                }
+
                 // Scan for EOL.
                 while (!atEOF() && !isEOL(ch0)) {
                     skip(1);
                 }
                 // Did detect a comment.
-                add(COMMENT, start);
+                add(directiveComment? DIRECTIVE_COMMENT : COMMENT, start);
                 return true;
             } else if (ch1 == '*') {
                 // Skip over /*.
@@ -1623,6 +1630,8 @@
             return valueOfPattern(start, len); // RegexToken::LexerToken
         case XML:
             return valueOfXML(start, len); // XMLToken::LexerToken
+        case DIRECTIVE_COMMENT:
+            return source.getString(start, len);
         default:
             break;
         }
--- a/src/jdk/nashorn/internal/parser/Parser.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/parser/Parser.java	Mon Jan 27 21:01:55 2014 -0800
@@ -26,7 +26,7 @@
 package jdk.nashorn.internal.parser;
 
 import static jdk.nashorn.internal.codegen.CompilerConstants.EVAL;
-import static jdk.nashorn.internal.codegen.CompilerConstants.FUNCTION_PREFIX;
+import static jdk.nashorn.internal.codegen.CompilerConstants.ANON_FUNCTION_PREFIX;
 import static jdk.nashorn.internal.codegen.CompilerConstants.RUN_SCRIPT;
 import static jdk.nashorn.internal.parser.TokenType.ASSIGN;
 import static jdk.nashorn.internal.parser.TokenType.CASE;
@@ -389,7 +389,9 @@
             sb.append(parentFunction.getName()).append('$');
         }
 
-        sb.append(ident != null ? ident.getName() : FUNCTION_PREFIX.symbolName());
+        assert ident.getName() != null;
+        sb.append(ident.getName());
+
         final String name = namespace.uniqueName(sb.toString());
         assert parentFunction != null || name.equals(RUN_SCRIPT.symbolName())  : "name = " + name;// must not rename runScript().
 
@@ -419,7 +421,8 @@
                 name,
                 parameters,
                 kind,
-                flags);
+                flags,
+                sourceURL);
 
         lc.push(functionNode);
         // Create new block, and just put it on the context stack, restoreFunctionNode() will associate it with the
@@ -638,6 +641,10 @@
 
         script = restoreFunctionNode(script, token); //commit code
         script = script.setBody(lc, script.getBody().setNeedsScope(lc));
+        // user may have directive comment to set sourceURL
+        if (sourceURL != null) {
+            script = script.setSourceURL(lc, sourceURL);
+        }
 
         return script;
     }
@@ -2132,11 +2139,20 @@
                     final String setterName = setIdent.getPropertyName();
                     final IdentNode setNameNode = new IdentNode(((Node)setIdent).getToken(), finish, NameCodec.encode("set " + setterName));
                     expect(LPAREN);
-                    final IdentNode argIdent = getIdent();
-                    verifyStrictIdent(argIdent, "setter argument");
+                    // be sloppy and allow missing setter parameter even though
+                    // spec does not permit it!
+                    final IdentNode argIdent;
+                    if (type == IDENT || isNonStrictModeIdent()) {
+                        argIdent = getIdent();
+                        verifyStrictIdent(argIdent, "setter argument");
+                    } else {
+                        argIdent = null;
+                    }
                     expect(RPAREN);
                     List<IdentNode> parameters = new ArrayList<>();
-                    parameters.add(argIdent);
+                    if (argIdent != null) {
+                        parameters.add(argIdent);
+                    }
                     functionNode = functionBody(getSetToken, setNameNode, parameters, FunctionNode.Kind.SETTER);
                     return new PropertyNode(propertyToken, finish, setIdent, null, null, functionNode);
 
@@ -2448,7 +2464,7 @@
         // name is null, generate anonymous name
         boolean isAnonymous = false;
         if (name == null) {
-            final String tmpName = "_L" + functionLine;
+            final String tmpName = ANON_FUNCTION_PREFIX.symbolName() + functionLine;
             name = new IdentNode(functionToken, Token.descPosition(functionToken), tmpName);
             isAnonymous = true;
         }
--- a/src/jdk/nashorn/internal/parser/TokenType.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/parser/TokenType.java	Mon Jan 27 21:01:55 2014 -0800
@@ -41,10 +41,14 @@
  */
 @SuppressWarnings("javadoc")
 public enum TokenType {
-    ERROR          (SPECIAL,  null),
-    EOF            (SPECIAL,  null),
-    EOL            (SPECIAL,  null),
-    COMMENT        (SPECIAL,  null),
+    ERROR                (SPECIAL,  null),
+    EOF                  (SPECIAL,  null),
+    EOL                  (SPECIAL,  null),
+    COMMENT              (SPECIAL,  null),
+    // comments of the form //@ foo=bar or //# foo=bar
+    // These comments are treated as special instructions
+    // to the lexer, parser or codegenerator.
+    DIRECTIVE_COMMENT    (SPECIAL,  null),
 
     NOT            (UNARY,   "!",    14, false),
     NE             (BINARY,  "!=",    9, true),
--- a/src/jdk/nashorn/internal/runtime/Context.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/Context.java	Mon Jan 27 21:01:55 2014 -0800
@@ -91,6 +91,11 @@
      */
     public static final String NASHORN_JAVA_REFLECTION = "nashorn.JavaReflection";
 
+    /**
+     * Permission to enable nashorn debug mode.
+     */
+    public static final String NASHORN_DEBUG_MODE = "nashorn.debugMode";
+
     // nashorn load psuedo URL prefixes
     private static final String LOAD_CLASSPATH = "classpath:";
     private static final String LOAD_FX = "fx:";
--- a/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Mon Jan 27 21:01:55 2014 -0800
@@ -30,6 +30,7 @@
 import java.util.ResourceBundle;
 import jdk.nashorn.api.scripting.NashornException;
 import jdk.nashorn.internal.scripts.JS;
+import jdk.nashorn.internal.codegen.CompilerConstants;
 
 /**
  * Helper class to throw various standard "ECMA error" exceptions such as Error, ReferenceError, TypeError etc.
@@ -401,7 +402,7 @@
         final String className = frame.getClassName();
 
         // Look for script package in class name (into which compiler puts generated code)
-        if (className.startsWith(scriptPackage)) {
+        if (className.startsWith(scriptPackage) && !frame.getMethodName().startsWith(CompilerConstants.INTERNAL_METHOD_PREFIX)) {
             final String source = frame.getFileName();
             /*
              * Make sure that it is not some Java code that Nashorn has in that package!
--- a/src/jdk/nashorn/internal/runtime/ECMAException.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/ECMAException.java	Mon Jan 27 21:01:55 2014 -0800
@@ -25,7 +25,7 @@
 
 package jdk.nashorn.internal.runtime;
 
-import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
+import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
 import static jdk.nashorn.internal.codegen.CompilerConstants.virtualField;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 
@@ -44,9 +44,9 @@
 @SuppressWarnings("serial")
 public final class ECMAException extends NashornException {
     /**
-     * Method handle pointing to the constructor {@link ECMAException#ECMAException(Object, String, int, int)},
+     * Method handle pointing to the constructor {@link ECMAException#create(Object, String, int, int)},
      */
-    public static final Call THROW_INIT = constructorNoLookup(ECMAException.class, Object.class, String.class, int.class, int.class);
+    public static final Call CREATE = staticCallNoLookup(ECMAException.class, "create", ECMAException.class, Object.class, String.class, int.class, int.class);
 
     /** Field handle to the{@link ECMAException#thrown} field, so that it can be accessed from generated code */
     public static final FieldAccess THROWN = virtualField(ECMAException.class, "thrown", Object.class);
@@ -57,23 +57,21 @@
     public final Object thrown;
 
     /**
-     * Constructor. This is called from generated code to implement the {@code throw}
-     * instruction from generated script code
+     * Constructor. Called from the factory method 'create'.
      *
      * @param thrown    object to be thrown
      * @param fileName  script file name
      * @param line      line number of throw
      * @param column    column number of throw
      */
-    public ECMAException(final Object thrown, final String fileName, final int line, final int column) {
+    private ECMAException(final Object thrown, final String fileName, final int line, final int column) {
         super(ScriptRuntime.safeToString(thrown), asThrowable(thrown), fileName, line, column);
         this.thrown = thrown;
         setExceptionToThrown();
     }
 
     /**
-     * Constructor. This is called from runtime code in Nashorn to throw things like
-     * type errors.
+     * Constructor. This is called from the runtime code.
      *
      * @param thrown   object to be thrown
      * @param cause    Java exception that triggered this throw
@@ -85,9 +83,39 @@
     }
 
     /**
+     * Factory method to retrieve the underlying exception or create an exception.
+     * This method is called from the generated code.
+     *
+     * @param thrown    object to be thrown
+     * @param fileName  script file name
+     * @param line      line number of throw
+     * @param column    column number of throw
+     * @return ECMAException object
+     */
+    public static ECMAException create(final Object thrown, final String fileName, final int line, final int column) {
+        // If thrown object is an Error or sub-object like TypeError, then
+        // an ECMAException object has been already initialized at constructor.
+        if (thrown instanceof ScriptObject) {
+            ScriptObject sobj = (ScriptObject)thrown;
+            Object exception = getException(sobj);
+            if (exception instanceof ECMAException) {
+                // copy over file name, line number and column number.
+                final ECMAException ee = (ECMAException)exception;
+                ee.setFileName(fileName);
+                ee.setLineNumber(line);
+                ee.setColumnNumber(column);
+                return ee;
+            }
+        }
+
+        return new ECMAException(thrown, fileName, line, column);
+    }
+
+    /**
      * Get the thrown object
      * @return thrown object
      */
+    @Override
     public Object getThrown() {
         return thrown;
     }
@@ -256,6 +284,8 @@
             final ScriptObject sobj = (ScriptObject)thrown;
             if (!sobj.has(EXCEPTION_PROPERTY)) {
                 sobj.addOwnProperty(EXCEPTION_PROPERTY, Property.NOT_ENUMERABLE, this);
+            } else {
+                sobj.set(EXCEPTION_PROPERTY, this, false);
             }
         }
     }
--- a/src/jdk/nashorn/internal/runtime/FindProperty.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/FindProperty.java	Mon Jan 27 21:01:55 2014 -0800
@@ -112,7 +112,7 @@
         return property != null && property.hasGetterFunction(prototype) ? self : prototype;
     }
 
-   /**
+    /**
      * Return the appropriate receiver for a setter.
      * @return appropriate receiver
      */
@@ -172,5 +172,20 @@
         property.setObjectValue(getSetterReceiver(), getOwner(), value, strict);
     }
 
+    /**
+     * Get the number of objects in the prototype chain between the {@code self} and the
+     * {@code owner} objects.
+     * @return the prototype chain length
+     */
+    int getProtoChainLength() {
+        assert self != null;
+        int length = 0;
+        for (ScriptObject obj = self; obj != prototype; obj = obj.getProto()) {
+            assert !(obj instanceof WithObject);
+            ++length;
+        }
+        return length;
+    }
+
 }
 
--- a/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java	Mon Jan 27 21:01:55 2014 -0800
@@ -196,24 +196,13 @@
     @Override
     public GuardedInvocation noSuchProperty(final CallSiteDescriptor desc, final LinkRequest request) {
         final String propertyName = desc.getNameToken(2);
-        final String fullName     = name.isEmpty() ? propertyName : name + "." + propertyName;
-
-        final Context context = Context.getContextTrusted();
+        createProperty(propertyName);
+        return super.lookup(desc, request);
+    }
 
-        Class<?> javaClass = null;
-        try {
-            javaClass = context.findClass(fullName);
-        } catch (final NoClassDefFoundError | ClassNotFoundException e) {
-            //ignored
-        }
-
-        if (javaClass == null) {
-            set(propertyName, new NativeJavaPackage(fullName, getProto()), false);
-        } else {
-            set(propertyName, StaticClass.forClass(javaClass), false);
-        }
-
-        return super.lookup(desc, request);
+    @Override
+    protected Object invokeNoSuchProperty(final String name) {
+        return createProperty(name);
     }
 
     @Override
@@ -224,4 +213,26 @@
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
         return MH.findStatic(MethodHandles.lookup(), NativeJavaPackage.class, name, MH.type(rtype, types));
     }
+
+    private Object createProperty(final String propertyName) {
+        final String fullName     = name.isEmpty() ? propertyName : name + "." + propertyName;
+        final Context context = Context.getContextTrusted();
+
+        Class<?> javaClass = null;
+        try {
+            javaClass = context.findClass(fullName);
+        } catch (final NoClassDefFoundError | ClassNotFoundException e) {
+            //ignored
+        }
+
+        final Object propertyValue;
+        if (javaClass == null) {
+            propertyValue = new NativeJavaPackage(fullName, getProto());
+        } else {
+            propertyValue = StaticClass.forClass(javaClass);
+        }
+
+        set(propertyName, propertyValue, false);
+        return propertyValue;
+    }
 }
--- a/src/jdk/nashorn/internal/runtime/ScriptObject.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/ScriptObject.java	Mon Jan 27 21:01:55 2014 -0800
@@ -143,6 +143,8 @@
     private static final MethodHandle TRUNCATINGFILTER   = findOwnMH("truncatingFilter", Object[].class, int.class, Object[].class);
     private static final MethodHandle KNOWNFUNCPROPGUARD = findOwnMH("knownFunctionPropertyGuard", boolean.class, Object.class, PropertyMap.class, MethodHandle.class, Object.class, ScriptFunction.class);
 
+    private static final ArrayList<MethodHandle> protoFilters = new ArrayList<>();
+
     /** Method handle for getting a function argument at a given index. Used from MapCreator */
     public static final Call GET_ARGUMENT       = virtualCall(MethodHandles.lookup(), ScriptObject.class, "getArgument", Object.class, int.class);
 
@@ -1712,6 +1714,44 @@
     }
 
     /**
+     * Test whether this object contains in its prototype chain or is itself a with-object.
+     * @return true if a with-object was found
+     */
+    final boolean hasWithScope() {
+        if (isScope()) {
+            for (ScriptObject obj = this; obj != null; obj = obj.getProto()) {
+                if (obj instanceof WithObject) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Add a filter to the first argument of {@code methodHandle} that calls its {@link #getProto()} method
+     * {@code depth} times.
+     * @param methodHandle a method handle
+     * @param depth        distance to target prototype
+     * @return the filtered method handle
+     */
+    static MethodHandle addProtoFilter(final MethodHandle methodHandle, final int depth) {
+        if (depth == 0) {
+            return methodHandle;
+        }
+        final int listIndex = depth - 1; // We don't need 0-deep walker
+        MethodHandle filter = listIndex < protoFilters.size() ? protoFilters.get(listIndex) : null;
+
+        if(filter == null) {
+            filter = addProtoFilter(GETPROTO, depth - 1);
+            protoFilters.add(null);
+            protoFilters.set(listIndex, filter);
+        }
+
+        return MH.filterArguments(methodHandle, 0, filter.asType(filter.type().changeReturnType(methodHandle.type().parameterType(0))));
+    }
+
+    /**
      * Find the appropriate GET method for an invoke dynamic call.
      *
      * @param desc     the call site descriptor
@@ -1722,7 +1762,7 @@
      */
     protected GuardedInvocation findGetMethod(final CallSiteDescriptor desc, final LinkRequest request, final String operator) {
         final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
-        if (request.isCallSiteUnstable()) {
+        if (request.isCallSiteUnstable() || hasWithScope()) {
             return findMegaMorphicGetMethod(desc, name, "getMethod".equals(operator));
         }
 
@@ -1748,22 +1788,24 @@
         final Property property = find.getProperty();
         methodHandle = find.getGetter(returnType);
 
+        final boolean noGuard = ObjectClassGenerator.OBJECT_FIELDS_ONLY && NashornCallSiteDescriptor.isFastScope(desc) && !property.canChangeType();
         // getMap() is fine as we have the prototype switchpoint depending on where the property was found
-        final MethodHandle guard = NashornGuards.getMapGuard(getMap());
+        final MethodHandle guard = noGuard ? null : NashornGuards.getMapGuard(getMap());
 
         if (methodHandle != null) {
             assert methodHandle.type().returnType().equals(returnType);
             if (find.isSelf()) {
-                return new GuardedInvocation(methodHandle, ObjectClassGenerator.OBJECT_FIELDS_ONLY &&
-                        NashornCallSiteDescriptor.isFastScope(desc) && !property.canChangeType() ? null : guard);
+                return new GuardedInvocation(methodHandle, guard);
             }
 
-            final ScriptObject prototype = find.getOwner();
-
-            if (!property.hasGetterFunction(prototype)) {
-                methodHandle = bindTo(methodHandle, prototype);
+            if (!property.hasGetterFunction(find.getOwner())) {
+                // If not a scope bind to actual prototype as changing prototype will change the property map.
+                // For scopes we install a filter that replaces the self object with the prototype owning the property.
+                methodHandle = isScope() ?
+                        addProtoFilter(methodHandle, find.getProtoChainLength()) :
+                        bindTo(methodHandle, find.getOwner());
             }
-            return new GuardedInvocation(methodHandle, getMap().getProtoGetSwitchPoint(proto, name), guard);
+            return new GuardedInvocation(methodHandle, noGuard ? null : getMap().getProtoGetSwitchPoint(proto, name), guard);
         }
 
         assert !NashornCallSiteDescriptor.isFastScope(desc);
@@ -1833,7 +1875,7 @@
      */
     protected GuardedInvocation findSetMethod(final CallSiteDescriptor desc, final LinkRequest request) {
         final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
-        if (request.isCallSiteUnstable()) {
+        if (request.isCallSiteUnstable() || hasWithScope()) {
             return findMegaMorphicSetMethod(desc, name);
         }
 
@@ -1888,7 +1930,9 @@
         final ScriptObject obj = (ScriptObject)self;
         final boolean isStrict = NashornCallSiteDescriptor.isStrict(desc);
         if (!obj.isExtensible()) {
-            throw typeError("object.non.extensible", desc.getNameToken(2), ScriptRuntime.safeToString(obj));
+            if (isStrict) {
+                throw typeError("object.non.extensible", desc.getNameToken(2), ScriptRuntime.safeToString(obj));
+            }
         } else if (obj.compareAndSetMap(oldMap, newMap)) {
             setter.invokeExact(self, value);
         } else {
@@ -2049,12 +2093,13 @@
 
         return createEmptyGetter(desc, name);
     }
+
     /**
      * Invoke fall back if a property is not found.
      * @param name Name of property.
      * @return Result from call.
      */
-    private Object invokeNoSuchProperty(final String name) {
+    protected Object invokeNoSuchProperty(final String name) {
         final FindProperty find = findProperty(NO_SUCH_PROPERTY_NAME, true);
 
         if (find != null) {
@@ -2759,7 +2804,8 @@
     public final void setObject(final FindProperty find, final boolean strict, final String key, final Object value) {
         FindProperty f = find;
 
-        if (f != null && f.isInherited() && !(f.getProperty() instanceof UserAccessorProperty)) {
+        if (f != null && f.isInherited() && !(f.getProperty() instanceof UserAccessorProperty) && !isScope()) {
+            // Setting a property should not modify the property in prototype unless this is a scope object.
             f = null;
         }
 
--- a/src/jdk/nashorn/internal/runtime/SetMethodCreator.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/SetMethodCreator.java	Mon Jan 27 21:01:55 2014 -0800
@@ -151,10 +151,12 @@
         assert methodHandle != null;
         assert property     != null;
 
-        final ScriptObject prototype = find.getOwner();
         final MethodHandle boundHandle;
-        if (!property.hasSetterFunction(prototype) && find.isInherited()) {
-            boundHandle = ScriptObject.bindTo(methodHandle, prototype);
+        if (!property.hasSetterFunction(find.getOwner()) && find.isInherited()) {
+            // Bind or add prototype filter depending on whether this is a scope object.
+            boundHandle = sobj.isScope() ?
+                    ScriptObject.addProtoFilter(methodHandle, find.getProtoChainLength()):
+                    ScriptObject.bindTo(methodHandle, find.getOwner());
         } else {
             boundHandle = methodHandle;
         }
--- a/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java	Mon Jan 27 21:01:55 2014 -0800
@@ -317,7 +317,7 @@
         final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_STATIC, CLASS_INIT,
                 Type.getMethodDescriptor(Type.VOID_TYPE), null, null));
 
-        mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR);
+        mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR, false);
         final Label initGlobal;
         if(samName != null) {
             // If the class is a SAM, allow having a ScriptFunction passed as class overrides
@@ -333,7 +333,7 @@
                 if(mi.getName().equals(samName)) {
                     mv.dup();
                     mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString()));
-                    mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR);
+                    mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR, false);
                 } else {
                     mv.visitInsn(ACONST_NULL);
                 }
@@ -350,7 +350,7 @@
             mv.dup();
             mv.aconst(mi.getName());
             mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString()));
-            mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR);
+            mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR, false);
             mv.putstatic(generatedClassName, mi.methodHandleClassFieldName, METHOD_HANDLE_TYPE_DESCRIPTOR);
         }
 
@@ -367,7 +367,7 @@
     private static void invokeGetGlobalWithNullCheck(final InstructionAdapter mv) {
         invokeGetGlobal(mv);
         mv.dup();
-        mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR); // check against null Context
+        mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR, false); // check against null Context
         mv.pop();
     }
 
@@ -424,7 +424,7 @@
             mv.load(offset, argType);
             offset += argType.getSize();
         }
-        mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor());
+        mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor(), false);
 
         endInitMethod(mv);
     }
@@ -477,7 +477,7 @@
             mv.load(offset, argType);
             offset += argType.getSize();
         }
-        mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor());
+        mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor(), false);
 
         // Get a descriptor to the appropriate "JavaAdapterFactory.getHandle" method.
         final String getHandleDescriptor = fromFunction ? GET_HANDLE_FUNCTION_DESCRIPTOR : GET_HANDLE_OBJECT_DESCRIPTOR;
@@ -496,7 +496,7 @@
                     mv.aconst(mi.getName());
                 }
                 mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString()));
-                mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor);
+                mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor, false);
             }
             mv.putfield(generatedClassName, mi.methodHandleInstanceFieldName, METHOD_HANDLE_TYPE_DESCRIPTOR);
         }
@@ -520,11 +520,11 @@
     }
 
     private static void invokeGetGlobal(final InstructionAdapter mv) {
-        mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR);
+        mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR, false);
     }
 
     private static void invokeSetGlobal(final InstructionAdapter mv) {
-        mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR);
+        mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR, false);
     }
 
     /**
@@ -647,11 +647,11 @@
             // If the super method is abstract, throw an exception
             mv.anew(UNSUPPORTED_OPERATION_TYPE);
             mv.dup();
-            mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR);
+            mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR, false);
             mv.athrow();
         } else {
             // If the super method is not abstract, delegate to it.
-            emitSuperCall(mv, name, methodDesc);
+            emitSuperCall(mv, method.getDeclaringClass(), name, methodDesc);
         }
 
         final Label setupGlobal = new Label();
@@ -728,7 +728,7 @@
         // Invoke the target method handle
         final Label tryBlockStart = new Label();
         mv.visitLabel(tryBlockStart);
-        mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString());
+        mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString(), false);
         final Label tryBlockEnd = new Label();
         mv.visitLabel(tryBlockEnd);
         emitFinally(mv, currentGlobalVar, globalsDifferVar);
@@ -744,7 +744,7 @@
             mv.anew(RUNTIME_EXCEPTION_TYPE);
             mv.dupX1();
             mv.swap();
-            mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE));
+            mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE), false);
             // Fall through to rethrow handler
         } else {
             throwableHandler = null;
@@ -830,12 +830,12 @@
                 SUPER_PREFIX + name, methodDesc, null, getExceptionNames(method.getExceptionTypes())));
         mv.visitCode();
 
-        emitSuperCall(mv, name, methodDesc);
+        emitSuperCall(mv, method.getDeclaringClass(), name, methodDesc);
 
         endMethod(mv);
     }
 
-    private void emitSuperCall(final InstructionAdapter mv, final String name, final String methodDesc) {
+    private void emitSuperCall(final InstructionAdapter mv, final Class owner, final String name, final String methodDesc) {
         mv.visitVarInsn(ALOAD, 0);
         int nextParam = 1;
         final Type methodType = Type.getMethodType(methodDesc);
@@ -843,7 +843,13 @@
             mv.load(nextParam, t);
             nextParam += t.getSize();
         }
-        mv.invokespecial(superClassName, name, methodDesc);
+
+        // default method - non-abstract, interface method
+        if (Modifier.isInterface(owner.getModifiers())) {
+            mv.invokespecial(Type.getInternalName(owner), name, methodDesc, false);
+        } else {
+            mv.invokespecial(superClassName, name, methodDesc, false);
+        }
         mv.areturn(methodType.getReturnType());
     }
 
--- a/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java	Mon Jan 27 21:01:55 2014 -0800
@@ -75,7 +75,8 @@
             if ((self instanceof Class) && Modifier.isPublic(((Class<?>)self).getModifiers())) {
                 final CallSiteDescriptor desc = requestWithoutContext.getCallSiteDescriptor();
                 if(CallSiteDescriptorFactory.tokenizeOperators(desc).contains("getProp")) {
-                    if ("static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) {
+                    if (desc.getNameTokenCount() > CallSiteDescriptor.NAME_OPERAND &&
+                        "static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) {
                         if (Context.isAccessibleClass((Class<?>)self) && !isReflectionClass((Class<?>)self)) {
                             // If "getProp:static" passes access checks, allow access.
                             return;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8010731.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8010731: Nashorn exposes internal symbols such as __callee__, __scope__ to scripts
+ *
+ * @test
+ * @run
+ */
+
+function checkCallee() {
+     var x = arguments[0]; // force __callee__ (renamed as :callee)
+
+     print(__callee__);
+}
+
+try {
+    checkCallee();
+    fail("Should have thrown ReferenceError for __callee__");
+} catch (e) {
+    if (! (e instanceof ReferenceError)) {
+        fail("ReferenceError expected, got " + e);
+    }
+}
+
+function checkScope() {
+    var x = 334;
+
+    function inner() {
+        var y = x * x;  // force __scope__ (renamed as :scope")
+        print(__scope__);
+    }
+
+    inner();
+}
+
+try {
+    checkScope();
+    fail("Should have thrown ReferenceError for __scope__");
+} catch (e) {
+    if (! (e instanceof ReferenceError)) {
+        fail("ReferenceError expected, got " + e);
+    }
+}
--- a/test/script/basic/JDK-8025515.js	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/script/basic/JDK-8025515.js	Mon Jan 27 21:01:55 2014 -0800
@@ -30,13 +30,23 @@
 
 // Make sure synthetic names of anonymous functions have correct line numbers
 
+function getFirstScriptFrame(stack) {
+    for (frameNum in stack) {
+        var frame = stack[frameNum];
+        if (frame.className.startsWith("jdk.nashorn.internal.scripts.Script$")) {
+            return frame;
+        }
+    }
+}
+
 function testMethodName(f, expected) {
     try {
         f();
         fail("expected error");
     } catch (e) {
-        var stack = e.getStackTrace();
-        if (stack[0].methodName !== expected) {
+        var stack = e.nashornException.getStackTrace();
+        var name = getFirstScriptFrame(stack).methodName;
+        if (name !== expected) {
             fail("got " + stack[0].methodName + ", expected " + expected);
         }
     }
@@ -44,15 +54,15 @@
 
 testMethodName(function() {
     return a.b.c;
-}, "_L45");
+}, "L:55");
 
-testMethodName(function() { throw new Error() }, "_L49");
+testMethodName(function() { throw new Error() }, "L:59");
 
 var f = (function() {
     return function() { a.b.c; };
 })();
-testMethodName(f, "_L51$_L52");
+testMethodName(f, "L:61$L:62");
 
 testMethodName((function() {
     return function() { return a.b.c; };
-})(), "_L56$_L57");
+})(), "L:66$L:67");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8029364.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8029364: NashornException to expose thrown object
+ *
+ * @test
+ * @run
+ */
+
+var m = new javax.script.ScriptEngineManager();
+var e = m.getEngineByName("nashorn");
+var g = e.eval("this");
+try {
+    e.eval("var e = new Error('foo'); e.bar = 33; throw e");
+} catch (se) {
+    // ScriptException instance's cause is a NashornException
+    print(se.getClass());
+    var cause = se.cause;
+    print(cause.getClass());
+    // NashornException instance has 'ecmaError' bean getter
+    print(cause.ecmaError);
+    // access to underlying ECMA Error object
+    print(cause.ecmaError instanceof g.Error);
+    print(cause.ecmaError.name);
+    print(cause.ecmaError.message);
+    print(cause.ecmaError.bar);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8029364.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,7 @@
+class javax.script.ScriptException
+class jdk.nashorn.internal.runtime.ECMAException
+Error: foo
+true
+Error
+foo
+33
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8029467.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8029467: Widening of booleans causes bad results
+ *
+ * @test
+ * @run
+ */
+
+print((function (x) { return x ? true : 0 })(true))
+print((function (x) { if(x) { return true } else { return 0 } })(true))
+print(typeof (function (x) { return x ? 1 : "123" })(true) === "number")
+print(typeof (function (x) { if(x) { return 1 } else { return "123" } })(true) === "number")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8029467.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,4 @@
+true
+true
+true
+true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8029667.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8029667: Prototype linking is incorrect
+ *
+ * @test
+ * @run
+ */
+
+function f(x) {
+  return (function inner() { 
+      var y; (function dummy() { return y })() // force own scope for the inner function
+      with({}) { // 'with' block turns off fast scopes
+          return x
+      }
+  })();
+}
+print(f(1));
+print(f(2));
+
+function g(x) { 
+  (function inner() { 
+      var y; (function dummy() { return y })() // force own scope for the inner function
+      with({}) { // 'with' block turns off fast scopes
+          // Test setter as well as getter
+          x = x + 2;
+      }
+  })();
+  print(x);
+}
+
+g(1);
+g(2);
+
+var withScopes = [{ func: function() { print("called 1");} }, { func: function() { print("called 2");} }];
+
+for(var i in withScopes) {
+    with (withScopes[i]) {
+        var main = function() {
+            var frame; // <---- this local variable caused scope to be not set properly prior to fix
+
+            function callFunc() {
+                frame = func();
+            }
+
+            callFunc();
+        }
+    }
+    main();
+}
+
+for(var i in withScopes) {
+    with (withScopes[i]) {
+        var main = function() {
+            var frame; // <---- this local variable caused scope to be not set properly prior to fix
+
+            function callFunc() {
+                frame = func = i;
+            }
+
+            callFunc();
+        }
+    }
+    main();
+} 
+
+print(withScopes[0].func);
+print(withScopes[1].func);
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8029667.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,8 @@
+1
+2
+3
+4
+called 1
+called 2
+0
+1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8030182.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8030182: scopeCall with -1 as line number
+ *
+ * @test
+ * @run
+ */
+
+function func() {
+    throw new Error("Strange...");
+}
+
+var f2 = func;
+var f3 = func;
+var f4 = func;
+var f5 = func;
+
+// check that "scopeCall" or some such internal method
+// does not appear in script stack trace.
+try {
+    func();
+} catch(err) {
+    print(err.stack.replace(/\\/g, '/'));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8030182.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,3 @@
+Error: Strange...
+	at func (test/script/basic/JDK-8030182.js:32)
+	at <program> (test/script/basic/JDK-8030182.js:43)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8030182_2.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8030182: scopeCall with -1 as line number
+ *
+ * @test
+ * @run
+ */
+
+var str = ""; 
+
+// large code to force splitting
+for (i = 0; i < 1000; ++i) 
+    str +="o = new Object()\n";
+
+str +="g()"; 
+
+// check that "$split" or some such internal method
+// does not appear in script stack trace!!
+try {
+    eval(str);
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8030182_2.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,3 @@
+ReferenceError: "g" is not defined
+	at <program> (test/script/basic/JDK-8030182_2.js#42:4<eval>@0:-1)
+	at <program> (test/script/basic/JDK-8030182_2.js:42)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8030809.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8030809: Anonymous functions should not be shown with internal names in script stack trace
+ *
+ * @test
+ * @run
+ */
+
+function func() {
+    (function() { 
+        throw new Error();
+    })();
+}
+
+try {
+    func();
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8030809.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,4 @@
+Error
+	at <anonymous> (test/script/basic/JDK-8030809.js:33)
+	at func (test/script/basic/JDK-8030809.js:32)
+	at <program> (test/script/basic/JDK-8030809.js:38)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031317.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8031317: SyntaxError when property setter has no parameter
+ *
+ * @test
+ * @run
+ */
+
+var obj = {
+  get toto() {
+      print("in getter for 'toto'");
+  },
+  set toto() {
+      print("in setter for 'toto'");
+  }
+}
+
+obj.toto;
+obj.toto = 344;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031317.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,2 @@
+in getter for 'toto'
+in setter for 'toto'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031359.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8031359: Invocable.getInterface() works incorrectly if interface has default methods
+ *
+ * @test
+ * @run
+ */
+
+var func = new java.util.function.Function() {
+    apply: function(arg) {
+        print("func called with " + arg);
+        return arg.toUpperCase();
+    }
+};
+
+// Function.andThen is a default method
+func.andThen(func)("hello");
+
+// Function.compose is another default method
+func.compose(new java.util.function.Function() {
+    apply: function(arg) {
+        print("compose called with " + arg);
+        return arg.charAt(0);
+    }
+})("hello");
+
+var func2 = new java.util.function.Function() {
+    apply: function(arg) {
+        print("I am func2: " + arg);
+        return arg;
+    },
+
+    andThen: function(func) {
+        print("This is my andThen!");
+        return func;
+    }
+};
+
+func2.apply("hello");
+func2.andThen(func);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031359.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,6 @@
+func called with hello
+func called with HELLO
+compose called with hello
+func called with h
+I am func2: hello
+This is my andThen!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031715.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8031715: Indexed access to java package not working
+ * @test
+ * @run
+ */
+
+print(java["net"]);
+print(java["net"]["URL"]);
+print(java["net"].URL);
+print(java.net["URL"]);
+
+var is = "InputStream";
+var io = "io";
+
+print(java.io[is]);
+print(java[io]);
+print(java[io][is]);
+
+var ji = new JavaImporter(java.util, java.io);
+print(ji["InputStream"]);
+print(ji['Vector']);
+
+var hash = "Hashtable";
+var printStream = "PrintStream";
+print(ji[hash]);
+print(ji[printStream]);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031715.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,11 @@
+[JavaPackage java.net]
+[JavaClass java.net.URL]
+[JavaClass java.net.URL]
+[JavaClass java.net.URL]
+[JavaClass java.io.InputStream]
+[JavaPackage java.io]
+[JavaClass java.io.InputStream]
+[JavaClass java.io.InputStream]
+[JavaClass java.util.Vector]
+[JavaClass java.util.Hashtable]
+[JavaClass java.io.PrintStream]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031983.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8031983: Error objects should capture stack at the constructor 
+ *
+ * @test
+ * @run
+ */
+
+var e = new Error();
+print("hello");
+
+try {
+    throw e;
+} catch (e) {
+    print(e.lineNumber);
+    print(e.stack.replace(/\\/g, '/'));
+}
+
+Error.captureStackTrace(e);
+try {
+    throw e;
+} catch (e) {
+    print(e.lineNumber);
+    print(e.stack.replace(/\\/g, '/'));
+}
+
+var obj = {};
+Error.captureStackTrace(obj);
+try {
+    throw obj;
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8031983.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,9 @@
+hello
+35
+Error
+	at <program> (test/script/basic/JDK-8031983.js:31)
+43
+Error
+	at <program> (test/script/basic/JDK-8031983.js:41)
+[object Object]
+	at <program> (test/script/basic/JDK-8031983.js:50)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8032004.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8032004: instance property "message" of Error objects should be non-enumerable 
+ *
+ * @test
+ * @run
+ */
+
+function check(obj) {
+    if (obj.propertyIsEnumerable("message")) {
+        fail(obj.name + " object's message property is enumerable!");
+    }
+}
+
+check(new Error("test"));
+check(new EvalError("test"));
+check(new RangeError("test"));
+check(new ReferenceError("test"));
+check(new SyntaxError("test"));
+check(new TypeError("test"));
+check(new URIError("test"));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8032068.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8032068: implement @sourceURL and #sourceURL directives.
+ *
+ * @test
+ * @run
+ */
+
+
+try {
+    Function("throw new Error();\n//# sourceURL=foo.js")();
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
+
+try {
+    eval("function g() { throw Error('x');\n } g();\n//# sourceURL=bar.js");
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
+
+// check @sourceURL for compatibility
+try {
+    Function("throw new Error();\n//@ sourceURL=foo2.js")();
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
+
+try {
+    eval("function g() { throw Error('x');\n } g();\n//@ sourceURL=bar2.js");
+} catch (e) {
+    print(e.stack.replace(/\\/g, '/'));
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8032068.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,14 @@
+Error
+	at <anonymous> (foo.js:2)
+	at <program> (test/script/basic/JDK-8032068.js:33)
+Error: x
+	at g (bar.js:1)
+	at <program> (bar.js:2)
+	at <program> (test/script/basic/JDK-8032068.js:39)
+Error
+	at <anonymous> (foo2.js:2)
+	at <program> (test/script/basic/JDK-8032068.js:46)
+Error: x
+	at g (bar2.js:1)
+	at <program> (bar2.js:2)
+	at <program> (test/script/basic/JDK-8032068.js:52)
--- a/test/script/basic/NASHORN-111.js.EXPECTED	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/script/basic/NASHORN-111.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -1,1 +1,1 @@
-{"message":"type error"}
+{}
--- a/test/script/basic/NASHORN-441.js.EXPECTED	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/script/basic/NASHORN-441.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -12,6 +12,6 @@
 try 5
 rethrow 5
 finally 5
-Error: try 5 thrown in line 71
+Error: try 5 thrown in line 74
 try 6
 finally 6
--- a/test/script/basic/compile-octane-splitter.js.EXPECTED	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/script/basic/compile-octane-splitter.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -1,13 +1,14 @@
-Compiled OK: box2d
-Compiled OK: code-load
-Compiled OK: crypto
-Compiled OK: deltablue
-Compiled OK: earley-boyer
-Compiled OK: gbemu
-Compiled OK: mandreel
-Compiled OK: navier-stokes
-Compiled OK: pdfjs
-Compiled OK: raytrace
-Compiled OK: regexp
-Compiled OK: richards
-Compiled OK: splay
+[box2d] Compiled OK
+[code-load] Compiled OK
+[crypto] Compiled OK
+[deltablue] Compiled OK
+[earley-boyer] Compiled OK
+[gbemu] Compiled OK
+[mandreel] Compiled OK
+[navier-stokes] Compiled OK
+[pdfjs] Compiled OK
+[raytrace] Compiled OK
+[regexp] Compiled OK
+[richards] Compiled OK
+[splay] Compiled OK
+[typescript] Compiled OK
--- a/test/script/basic/compile-octane.js.EXPECTED	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/script/basic/compile-octane.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -1,13 +1,14 @@
-Compiled OK: box2d
-Compiled OK: code-load
-Compiled OK: crypto
-Compiled OK: deltablue
-Compiled OK: earley-boyer
-Compiled OK: gbemu
-Compiled OK: mandreel
-Compiled OK: navier-stokes
-Compiled OK: pdfjs
-Compiled OK: raytrace
-Compiled OK: regexp
-Compiled OK: richards
-Compiled OK: splay
+[box2d] Compiled OK
+[code-load] Compiled OK
+[crypto] Compiled OK
+[deltablue] Compiled OK
+[earley-boyer] Compiled OK
+[gbemu] Compiled OK
+[mandreel] Compiled OK
+[navier-stokes] Compiled OK
+[pdfjs] Compiled OK
+[raytrace] Compiled OK
+[regexp] Compiled OK
+[richards] Compiled OK
+[splay] Compiled OK
+[typescript] Compiled OK
--- a/test/script/basic/run-octane.js	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/script/basic/run-octane.js	Mon Jan 27 21:01:55 2014 -0800
@@ -26,19 +26,22 @@
  */
 
 var tests = [
-    {file:"box2d",suite:"Box2DBenchmark"},
-    {file:"code-load",suite:"CodeLoad"},
-    {file:"crypto",suite:"Crypto"},
-    {file:"deltablue",suite:"DeltaBlue"},
-    {file:"earley-boyer", suite:"EarleyBoyer"},
-    {file:"gbemu", suite:"GameboyBenchmark"},
-    {file:"mandreel", suite:"MandreelBenchmark"},
-    {file:"navier-stokes", suite:"NavierStokes"},
-    {file:"pdfjs", suite:"PdfJS"},
-    {file:"raytrace", suite:"RayTrace"},
-    {file:"regexp", suite:"RegExpSuite"},
-    {file:"richards", suite:"Richards"},
-    {file:"splay", suite:"Splay"}
+    {name:"box2d",         files:["box2d.js"],                         suite:"Box2DBenchmark"},
+    {name:"code-load",     files:["code-load.js"],                     suite:"CodeLoad"},
+    {name:"crypto",        files:["crypto.js"],                        suite:"Crypto"},
+    {name:"deltablue",     files:["deltablue.js"],                     suite:"DeltaBlue"},
+    {name:"earley-boyer",  files:["earley-boyer.js"],                  suite:"EarleyBoyer"},
+    {name:"gbemu",         files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"},
+    {name:"mandreel",      files:["mandreel.js"],                      suite:"MandreelBenchmark"},
+    {name:"navier-stokes", files:["navier-stokes.js"],                 suite:"NavierStokes"},
+    {name:"pdfjs",         files:["pdfjs.js"],                         suite:"PdfJS"},
+    {name:"raytrace",      files:["raytrace.js"],                      suite:"RayTrace"},
+    {name:"regexp",        files:["regexp.js"],                        suite:"RegExpSuite"},
+    {name:"richards",      files:["richards.js"],                      suite:"Richards"},
+    {name:"splay",         files:["splay.js"],                         suite:"Splay"},
+    {name:"typescript",    files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"}
+    //zlib currently disabled - requires read
+    //    {name:"zlib",          files:["zlib.js", "zlib-data.js"], suite:"zlib"},
 ];
 var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
 
@@ -58,26 +61,36 @@
     return (typeof compile_only !== 'undefined')
 }
 
-function run_one_benchmark(arg, iters) {
-    var file_name;
-    var file = (arg.file + ".js").split('/');
+function load_bench(arg) {
+
+    for (var idx = 0; idx < arg.files.length; idx++) {
+	var f = arg.files[idx];
+	var file = f.split('/');
+	var file_name = path + file[file.length - 1];
     
-    file_name = path + file[file.length - 1];
-    
-    var compile_and_return = should_compile_only(file_name);
+	var compile_and_return = should_compile_only(file_name);
+	if (compile_and_return) {
+	    if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them
+		return true;
+	    }
+	}
+	
+	print_verbose(arg, "loading '" + arg.name + "' [" + f + "]...");
+	load(file_name); 
+    }
+
     if (compile_and_return) {
-	if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them
-	    return;
-	}
+	print_always(arg, "Compiled OK");
     }
-    
-    print_verbose("Loading... " + file_name);
-    load(file_name);
-    
-    if (compile_and_return) {
-	print_always("Compiled OK: " + arg.file);
+    return !compile_and_return;
+
+}
+
+function run_one_benchmark(arg, iters) {
+
+    if (!load_bench(arg)) {
 	return;
-    }
+    }    
     
     var success = true;
     var current_name;
@@ -95,9 +108,13 @@
 
     try {
 	for (var x = 0; x < benchmarks.length ; x++) { 
+	    //do warmup run
+	    //reset random number generator needed as of octane 9 before each run
+	    BenchmarkSuite.ResetRNG();
 	    benchmarks[x].Setup();
 	}
-	print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")");
+	BenchmarkSuite.ResetRNG();
+	print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")");
 	
 	var scores = [];
 	
@@ -112,6 +129,9 @@
 	    do {
 		for (var i = 0; i < len; i++) {
 		    benchmarks[i].run();
+		    //important - no timing here like elapsed = new Date() - start, as in the 
+		    //original harness. This will make timing very non-deterministic.
+		    //NOTHING else must live in this loop
 		}	    
 		ops += len;
 		elapsed = new Date - start;
@@ -120,7 +140,7 @@
 	    var score = ops / elapsed * 1000 * 60;
 	    scores.push(score);
 	    var name = it == 0 ? "warmup" : "iteration " + it;   
-	    print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute");
+	    print_verbose(arg, name + " finished " + score.toFixed(0) + " ops/minute");
 	}
 
 	for (var x = 0; x < benchmarks.length ; x++) { 
@@ -140,20 +160,20 @@
 	scores = [0];
     }
 
-    var res = "[" + arg.file + "] " + mean_score.toFixed(0);
+    var res = mean_score.toFixed(0);
     if (verbose) {
 	res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0);
     }
-    print_always(res);
+    print_always(arg, res);
 }
 
-function print_always(x) {
-    print(x);
+function print_always(arg, x) {
+    print("[" + arg.name + "] " + x);
 }
 
-function print_verbose(x) {
+function print_verbose(arg, x) {
     if (verbose) {
-	print(x);
+	print_always(arg, x)
     }
 }
 
@@ -209,7 +229,7 @@
     } else {
 	var found = false;
 	for (j in tests) {
-	    if (tests[j].file === arg) {
+	    if (tests[j].name === arg) {
 		tests_found.push(tests[j]);
 		found = true;
 		break;
@@ -221,7 +241,7 @@
 		if (j != 0) {
 		    str += ", ";
 		}
-		str += "'" + tests[j].file + "'";
+		str += "'" + tests[j].name + "'";
 	    }
 	    throw str;
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Base library for Showdown markdown engine Nashorn testing.
+ * @subtest
+ * 
+ * 
+ */
+
+load(__DIR__ + "external/showdown/showdown.js");
+var shdwn = Showdown;
+var window =  {
+    Showdown: shdwn
+}
+load(__DIR__ + "external/showdown/table.js");
+var converter = new Showdown.converter({extensions: ['table']});
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/anchors-by-reference.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is [an example][id] reference-style link.\nThis is [another] [foo] reference-style link.\nThis is [a third][bar] reference-style link.\nThis is [a fourth][4] reference-style link.\n\n  [id]: http://example.com/  \"Optional Title Here\"\n  [foo]: http://example.com/  (Optional Title Here)\n  [bar]: http://example.com/  (Optional Title Here)\n  [4]: <http://example.com/>\n    \"Optional Title Here\"";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/anchors-by-reference.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,4 @@
+<p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.
+This is <a href="http://example.com/" title="Optional Title Here">another</a> reference-style link.
+This is <a href="http://example.com/" title="Optional Title Here">a third</a> reference-style link.
+This is <a href="http://example.com/" title="Optional Title Here">a fourth</a> reference-style link.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/automatic-anchors.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n<http://example.com/>";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/automatic-anchors.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<p><a href="http://example.com/">http://example.com/</a></p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/blockquote-nested-markdown.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "> ## This is a header.\n>\n> 1.   This is the first list item.\n> 2.   This is the second list item.\n>\n> Here's some example code:\n>\n>     return shell_exec(\"echo $input | $markdown_script\");";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/blockquote-nested-markdown.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,13 @@
+<blockquote>
+  <h2 id="thisisaheader">This is a header.</h2>
+  
+  <ol>
+  <li>This is the first list item.</li>
+  <li>This is the second list item.</li>
+  </ol>
+  
+  <p>Here's some example code:</p>
+
+<pre><code>return shell_exec("echo $input | $markdown_script");
+</code></pre>
+</blockquote>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/blockquote.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "  \n  > This is a multi line blockquote test\n  >\n  > With more than one line.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/blockquote.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<blockquote>
+  <p>This is a multi line blockquote test</p>
+  
+  <p>With more than one line.</p>
+</blockquote>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/code-block-html-escape.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is some HTML:\n\n    <h1>Heading</h1>";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/code-block-html-escape.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,4 @@
+<p>This is some HTML:</p>
+
+<pre><code>&lt;h1&gt;Heading&lt;/h1&gt;
+</code></pre>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/code-block.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is a normal paragraph:\n\n    This is a code block.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/code-block.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,4 @@
+<p>This is a normal paragraph:</p>
+
+<pre><code>This is a code block.
+</code></pre>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/doubline-list.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n *  Bird\n\n *  Magic";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/doubline-list.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,4 @@
+<ul>
+<li><p>Bird</p></li>
+<li><p>Magic</p></li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/emphasis.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n*important*\n\n_important_\n\nthis mid*important*sentence";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/emphasis.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<p><em>important</em></p>
+
+<p><em>important</em></p>
+
+<p>this mid<em>important</em>sentence</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/escaped-number-period.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "It happened in 1986\.  What a great season.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/escaped-number-period.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<p>It happened in 1986.  What a great season.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/escaping.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThese should all be escaped:\n\n\\\n\n\`\n\n\*\n\n\_\n\n\{\n\n\}\n\n\[\n\n\]\n\n\(\n\n\)\n\n\#\n\n\+\n\n\-\n\n\.\n\n\!";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/escaping.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,31 @@
+<p>These should all be escaped:</p>
+
+<p>\</p>
+
+<p>`</p>
+
+<p>*</p>
+
+<p>_</p>
+
+<p>{</p>
+
+<p>}</p>
+
+<p>[</p>
+
+<p>]</p>
+
+<p>(</p>
+
+<p>)</p>
+
+<p>#</p>
+
+<p>+</p>
+
+<p>-</p>
+
+<p>.</p>
+
+<p>!</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/github-style-at-start.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "```\nfunction MyFunc(a) {\n    // ...\n}\n```\n\nThat is some code!";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/github-style-at-start.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,6 @@
+<pre><code>function MyFunc(a) {
+    // ...
+}
+</code></pre>
+
+<p>That is some code!</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/github-style-codeblock.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nDefine a function in javascript:\n\n```\nfunction MyFunc(a) {\n    var s = '`';\n}\n```\n\nAnd some HTML\n\n```html\n<div>HTML!</div>\n```";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/github-style-codeblock.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,11 @@
+<p>Define a function in javascript:</p>
+
+<pre><code>function MyFunc(a) {
+    var s = '`';
+}
+</code></pre>
+
+<p>And some HTML</p>
+
+<pre><code class="html">&lt;div&gt;HTML!&lt;/div&gt;
+</code></pre>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/github-style-linebreaks.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "```\ncode can go here\nthis is rendered on a second line\n```";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/github-style-linebreaks.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,3 @@
+<pre><code>code can go here
+this is rendered on a second line
+</code></pre>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h1-with-double-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "# This is an H1 #";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h1-with-double-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h1 id="thisisanh1">This is an H1</h1>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h1-with-equals.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "This is an H1\n=============";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h1-with-equals.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h1 id="thisisanh1">This is an H1</h1>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h1-with-single-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "# This is an H1";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h1-with-single-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h1 id="thisisanh1">This is an H1</h1>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h2-with-dashes.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "This is an H2\n-------------";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h2-with-dashes.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h2 id="thisisanh2">This is an H2</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h2-with-double-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "## This is an H2 ##";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h2-with-double-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h2 id="thisisanh2">This is an H2</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h2-with-single-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "## This is an H2";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h2-with-single-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h2 id="thisisanh2">This is an H2</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h3-with-double-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "### This is an H3 ###";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h3-with-double-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h3 id="thisisanh3">This is an H3</h3>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h3-with-single-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "### This is an H3";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h3-with-single-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h3 id="thisisanh3">This is an H3</h3>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h4-with-single-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "#### This is an H4";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h4-with-single-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h4 id="thisisanh4">This is an H4</h4>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h5-with-single-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "##### This is an H5";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h5-with-single-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h5 id="thisisanh5">This is an H5</h5>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h6-with-single-hash.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "###### This is an H6";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/h6-with-single-hash.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<h6 id="thisisanh6">This is an H6</h6>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/horizontal-rules.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n* * *\n\n***\n\n*****\n\n- - -\n\n---------------------------------------\n";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/horizontal-rules.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,9 @@
+<hr />
+
+<hr />
+
+<hr />
+
+<hr />
+
+<hr />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/html5-strutural-tags.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThese HTML5 tags should pass through just fine.\n\n<section>hello</section>\n<header>head</header>\n<footer>footsies</footer>\n<nav>navigation</nav>\n<article>read me</article>\n<aside>ignore me</aside>\n<article>read\nme</article>\n<aside>\nignore me\n</aside>\n\nthe end";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/html5-strutural-tags.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,22 @@
+<p>These HTML5 tags should pass through just fine.</p>
+
+<section>hello</section>
+
+<header>head</header>
+
+<footer>footsies</footer>
+
+<nav>navigation</nav>
+
+<article>read me</article>
+
+<aside>ignore me</aside>
+
+<article>read
+me</article>
+
+<aside>
+ignore me
+</aside>
+
+<p>the end</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/images.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n![Alt text](/path/to/img.jpg)\n\n![Alt text](/path/to/img.jpg \"Optional title\")\n\n![Alt text][id]\n\n  [id]: url/to/image  \"Optional title attribute\"";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/images.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<p><img src="/path/to/img.jpg" alt="Alt text" title="" /></p>
+
+<p><img src="/path/to/img.jpg" alt="Alt text" title="Optional title" /></p>
+
+<p><img src="url/to/image" alt="Alt text" title="Optional title attribute" /></p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/implicit-anchors.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nSearch the web at [Google][] or [Daring Fireball][].\n\n  [Google]: http://google.com/\n  [Daring Fireball]: http://daringfireball.net/";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/implicit-anchors.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<p>Search the web at <a href="http://google.com/">Google</a> or <a href="http://daringfireball.net/">Daring Fireball</a>.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/inline-anchors.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThis is [an example](http://example.com/ \"Title\") inline link.\n\n[This link](http://example.net/) has no title attribute.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/inline-anchors.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,3 @@
+<p>This is <a href="http://example.com/" title="Title">an example</a> inline link.</p>
+
+<p><a href="http://example.net/">This link</a> has no title attribute.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/inline-code.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nCreate a new `function`.\n\nUse the backtick in MySQL syntax ``SELECT `column` FROM whatever``.\n\nA single backtick in a code span: `` ` ``\n\nA backtick-delimited string in a code span: `` `foo` ``\n\nPlease don't use any `<blink>` tags.\n\n`&#8212;` is the decimal-encoded equivalent of `&mdash;`.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/inline-code.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,11 @@
+<p>Create a new <code>function</code>.</p>
+
+<p>Use the backtick in MySQL syntax <code>SELECT `column` FROM whatever</code>.</p>
+
+<p>A single backtick in a code span: <code>`</code></p>
+
+<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
+
+<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
+
+<p><code>&amp;#8212;</code> is the decimal-encoded equivalent of <code>&amp;mdash;</code>.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/inline-style-tag.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n<style>\n    p { line-height: 20px; }\n</style>\n\nAn exciting sentence.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/inline-style-tag.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<style>
+    p { line-height: 20px; }
+</style>
+
+<p>An exciting sentence.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/lazy-blockquote.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n  > This is a multi line blockquote test\n\n  > With more than one line.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/lazy-blockquote.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<blockquote>
+  <p>This is a multi line blockquote test</p>
+  
+  <p>With more than one line.</p>
+</blockquote>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/list-with-blockquote.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "*   A list item with a blockquote:\n\n    > This is a blockquote\n    > inside a list item.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/list-with-blockquote.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,8 @@
+<ul>
+<li><p>A list item with a blockquote:</p>
+
+<blockquote>
+  <p>This is a blockquote
+  inside a list item.</p>
+</blockquote></li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/list-with-code.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "*   A list item with code:\n\n        alert('Hello world!');";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/list-with-code.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,6 @@
+<ul>
+<li><p>A list item with code:</p>
+
+<pre><code>alert('Hello world!');
+</code></pre></li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/multi-paragraph-list.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n 1.  This is a major bullet point.\n\n    That contains multiple paragraphs.\n\n 2.  And another line";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/multi-paragraph-list.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,6 @@
+<ol>
+<li><p>This is a major bullet point.</p>
+
+<p>That contains multiple paragraphs.</p></li>
+<li><p>And another line</p></li>
+</ol>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/multiline-unordered-list.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n - This line spans\n more than one line and is lazy\n - Similar to this line";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/multiline-unordered-list.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ul>
+<li>This line spans
+more than one line and is lazy</li>
+<li>Similar to this line</li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/nested-blockquote.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n  > This is a multi line blockquote test\n  >\n  > > And nesting!\n  >\n  > With more than one line.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/nested-blockquote.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,9 @@
+<blockquote>
+  <p>This is a multi line blockquote test</p>
+  
+  <blockquote>
+    <p>And nesting!</p>
+  </blockquote>
+  
+  <p>With more than one line.</p>
+</blockquote>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/ordered-list-same-number.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n 1.  Red\n 1.  Green\n 1.  Blue";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/ordered-list-same-number.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ol>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ol>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/ordered-list-wrong-numbers.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n 8.  Red\n 1.  Green\n 3.  Blue";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/ordered-list-wrong-numbers.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ol>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ol>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/ordered-list.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n 1.  Red\n 2.  Green\n 3.  Blue";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/ordered-list.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ol>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ol>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/relative-anchors.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nSee my [About](/about/) page for details.";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/relative-anchors.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<p>See my <a href="/about/">About</a> page for details.</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/simple-paragraph.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nHello, world!";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/simple-paragraph.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<p>Hello, world!</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/strong.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n**important**\n\n__important__\n\nreally **freaking**strong";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/strong.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<p><strong>important</strong></p>
+
+<p><strong>important</strong></p>
+
+<p>really <strong>freaking</strong>strong</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/table-basic.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "| First Header  | Second Header |\n| ------------- | ------------- |\n| Row 1 Cell 1  | Row 1 Cell 2  |\n| Row 2 Cell 1  | Row 2 Cell 2  |\n";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/table-basic.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,21 @@
+<table>
+<thead>
+<tr>
+<th id="first_header" style="text-align:left;"> First Header  </th>
+<th id="second_header" style="text-align:left;"> Second Header </th>
+</tr>
+</thead>
+
+<tbody>
+<tr>
+<td style="text-align:left;"><p>Row 1 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 1 Cell 2  </p></td>
+</tr>
+
+<tr>
+<td style="text-align:left;"><p>Row 2 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 2 Cell 2  </p></td>
+</tr>
+
+</tbody>
+</table>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/table-large.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "| First Header  | Second Header | Third Header  | Fourth Header |\n| ------------- | ------------- | ------------  | ------------- |\n| Row 1 Cell 1  | Row 1 Cell 2  | Row 1 Cell 3  | Row 1 Cell 4  |\n| Row 2 Cell 1  | Row 2 Cell 2  | Row 2 Cell 3  | Row 2 Cell 4  |\n| Row 3 Cell 1  | Row 3 Cell 2  | Row 3 Cell 3  | Row 3 Cell 4  |\n| Row 4 Cell 1  | Row 4 Cell 2  | Row 4 Cell 3  | Row 4 Cell 4  |\n| Row 5 Cell 1  | Row 5 Cell 2  | Row 5 Cell 3  | Row 5 Cell 4  |\n";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/table-large.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,48 @@
+<table>
+<thead>
+<tr>
+<th id="first_header" style="text-align:left;"> First Header  </th>
+<th id="second_header" style="text-align:left;"> Second Header </th>
+<th id="third_header" style="text-align:left;"> Third Header  </th>
+<th id="fourth_header" style="text-align:left;"> Fourth Header </th>
+</tr>
+</thead>
+
+<tbody>
+<tr>
+<td style="text-align:left;"><p>Row 1 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 1 Cell 2  </p></td>
+<td style="text-align:left;"><p>Row 1 Cell 3  </p></td>
+<td style="text-align:left;"><p>Row 1 Cell 4  </p></td>
+</tr>
+
+<tr>
+<td style="text-align:left;"><p>Row 2 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 2 Cell 2  </p></td>
+<td style="text-align:left;"><p>Row 2 Cell 3  </p></td>
+<td style="text-align:left;"><p>Row 2 Cell 4  </p></td>
+</tr>
+
+<tr>
+<td style="text-align:left;"><p>Row 3 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 3 Cell 2  </p></td>
+<td style="text-align:left;"><p>Row 3 Cell 3  </p></td>
+<td style="text-align:left;"><p>Row 3 Cell 4  </p></td>
+</tr>
+
+<tr>
+<td style="text-align:left;"><p>Row 4 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 4 Cell 2  </p></td>
+<td style="text-align:left;"><p>Row 4 Cell 3  </p></td>
+<td style="text-align:left;"><p>Row 4 Cell 4  </p></td>
+</tr>
+
+<tr>
+<td style="text-align:left;"><p>Row 5 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 5 Cell 2  </p></td>
+<td style="text-align:left;"><p>Row 5 Cell 3  </p></td>
+<td style="text-align:left;"><p>Row 5 Cell 4  </p></td>
+</tr>
+
+</tbody>
+</table>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/table-with-equals.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "| First Header  | Second Header |\n| ============= | ============= |\n| Row 1 Cell 1  | Row 1 Cell 2  |\n| Row 2 Cell 1  | Row 2 Cell 2  |\n";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/table-with-equals.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,21 @@
+<table>
+<thead>
+<tr>
+<th id="first_header" style="text-align:left;"> First Header  </th>
+<th id="second_header" style="text-align:left;"> Second Header </th>
+</tr>
+</thead>
+
+<tbody>
+<tr>
+<td style="text-align:left;"><p>Row 1 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 1 Cell 2  </p></td>
+</tr>
+
+<tr>
+<td style="text-align:left;"><p>Row 2 Cell 1  </p></td>
+<td style="text-align:left;"><p>Row 2 Cell 2  </p></td>
+</tr>
+
+</tbody>
+</table>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/unordered-list-asterisk.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n * Red\n * Green\n * Blue";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/unordered-list-asterisk.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ul>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/unordered-list-minus.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n - Red\n - Green\n - Blue";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/unordered-list-minus.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ul>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/unordered-list-plus.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\n + Red\n + Green\n + Blue";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/unordered-list-plus.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,5 @@
+<ul>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/url-with-parenthesis.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Test for Showdown markdown parser work with Nashorn.
+ *
+ * @test
+ * @run
+ */
+
+var input = "\nThere's an [episode](http://en.memory-alpha.org/wiki/Darmok_(episode)) of Star Trek: The Next Generation";
+var output = converter.makeHtml(input);
+print(output);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/markdown/url-with-parenthesis.js.EXPECTED	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,1 @@
+<p>There's an <a href="http://en.memory-alpha.org/wiki/Darmok_(episode)">episode</a> of Star Trek: The Next Generation</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/sandbox/JDK-8031106.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8031106: Nashorn: IndexOutOfBoundsException in NashornCallSiteDescriptor.getNameToken()
+ *
+ * @test
+ * @run
+ */
+
+var cl = new java.lang.Object().getClass();
+try {
+   cl["forName"];
+   fail("Should have thrown exception!");
+} catch (e) {
+   if (! (e instanceof java.lang.SecurityException)) {
+       fail("SecurityException expected, got " + e);
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/trusted/JDK-8032060.js	Mon Jan 27 21:01:55 2014 -0800
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8032060: PropertyMap of Error objects is not stable
+ *
+ * @test
+ * @option -Dnashorn.debug=true
+ * @fork
+ * @run
+ */
+
+function checkMap(e1, e2) {
+    if (! Debug.identical(Debug.map(e1), Debug.map(e2))) {
+        fail("e1 and e2 have different maps");
+    }
+
+    var m1, m2;
+
+    try {
+        throw e1
+    } catch (e) {
+        m1 = Debug.map(e)
+    }
+
+    try {
+        throw e2
+    } catch (e) {
+        m2 = Debug.map(e)
+    }
+
+    if (! Debug.identical(m1, m2)) {
+        fail("e1 and e2 have different maps after being thrown");
+    }
+}
+
+checkMap(new Error(), new Error());
+checkMap(new EvalError(), new EvalError());
+checkMap(new RangeError(), new RangeError());
+checkMap(new ReferenceError(), new ReferenceError());
+checkMap(new SyntaxError(), new SyntaxError());
+checkMap(new TypeError(), new TypeError());
+checkMap(new URIError(), new URIError());
+
+// now try with message param
+checkMap(new Error("x"), new Error("y"));
+checkMap(new EvalError("x"), new EvalError("y"));
+checkMap(new RangeError("x"), new RangeError("y"));
+checkMap(new ReferenceError("x"), new ReferenceError("y"));
+checkMap(new SyntaxError("x"), new SyntaxError("y"));
+checkMap(new TypeError("x"), new TypeError("y"));
+checkMap(new URIError("x"), new URIError("y"));
--- a/test/src/jdk/nashorn/api/scripting/InvocableTest.java	Tue Jan 21 18:17:23 2014 -0800
+++ b/test/src/jdk/nashorn/api/scripting/InvocableTest.java	Mon Jan 27 21:01:55 2014 -0800
@@ -26,6 +26,7 @@
 package jdk.nashorn.api.scripting;
 
 import java.util.Objects;
+import java.util.function.Function;
 import javax.script.Invocable;
 import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
@@ -522,4 +523,16 @@
         Assert.assertEquals(itf.test1(42, "a", "b"), "i == 42, strings instanceof java.lang.String[] == true, strings == [a, b]");
         Assert.assertEquals(itf.test2(44, "c", "d", "e"), "arguments[0] == 44, arguments[1] instanceof java.lang.String[] == true, arguments[1] == [c, d, e]");
     }
+
+    @Test
+    @SuppressWarnings("unchecked")
+    public void defaultMethodTest() throws ScriptException {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        final Invocable inv = (Invocable) e;
+
+        Object obj = e.eval("({ apply: function(arg) { return arg.toUpperCase(); }})");
+        Function<String, String> func = inv.getInterface(obj, Function.class);
+        assertEquals(func.apply("hello"), "HELLO");
+    }
 }