diff -r ada4855e44e2 src/jdk/nashorn/internal/runtime/ScriptRuntime.java
--- a/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Thu Jun 19 11:22:50 2014 -0700
+++ b/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Fri Jun 20 15:17:03 2014 +0200
@@ -478,7 +478,9 @@
             throw typeError(global, "cant.apply.with.to.null");
         }
 
-        final Object wrappedExpr = JSType.toScriptObject(global, expression);
+        final Object wrappedExpr = JSType.toScriptObject(global, 
+            ScriptObjectMirror.unwrap(expression, global)
+        );
         if (wrappedExpr instanceof ScriptObject) {
             return new WithObject(scope, (ScriptObject)wrappedExpr);
         }
diff -r ada4855e44e2 test/src/jdk/nashorn/api/javaaccess/WithTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/src/jdk/nashorn/api/javaaccess/WithTest.java	Fri Jun 20 15:17:03 2014 +0200
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.api.javaaccess;
+
+import static org.testng.Assert.*;
+
+import javax.script.Invocable;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+import org.testng.TestNG;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class WithTest {
+    private static ScriptEngine eng = null;
+    private static Object[] two;
+
+    public static void main(final String[] args) {
+        TestNG.main(args);
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+        eng = new ScriptEngineManager().getEngineByName("nashorn");
+        
+        Invocable inv = (Invocable) eng;
+
+        eng.eval("function getProp(w, i) {\n  with (w[i]) {\n    return say;\n    \n  }\n}");
+        eng.eval("function addProp(x, n, y) { x[n] = y; return x; }");
+        eng.eval("function id(x) { return x; }");
+        eng.eval("function at(x, i) { return x[i]; }");
+        defineArraySizeFn(eng);
+
+        two = (Object[]) checkArray(inv, eng.eval("[ new Object(), null ]"));
+
+        inv.invokeFunction("addProp", two[0], "say", "Ahoj");
+
+        // current state:
+        //
+        // two[0] = { 'say' : 'Ahoj' }
+        // two[1] = null;
+        two[1] = inv.invokeFunction("id", two[0]);
+
+        // current state:
+        //
+        // two[0] = { 'say' : 'Ahoj' }
+        // two[1] = two[0];
+        assertNotNull(inv.invokeFunction("at", two, 0), "Value 0 in the array is not empty");
+        assertNotNull(inv.invokeFunction("at", two, 1), "Value 1 in the array is not empty");
+        
+    }
+
+    @AfterClass
+    public static void tearDownClass() {
+        eng = null;
+    }
+
+    @Test
+    public void testWithOnJO() throws Exception {
+        Invocable inv = (Invocable) eng;
+        
+        Object ret0 = inv.invokeFunction("getProp", two, 0);
+        assertEquals(ret0, "Ahoj", "Property value returned for 0");
+    }
+    
+    @Test
+    public void testWithOnScriptMirrorObject() throws Exception {
+        Invocable inv = (Invocable) eng;
+        
+        // inspite the two[0] and two[1] should be identical from
+        // the programmers point of view, they are not and following statement
+        // yields Cannot apply "with" to non script object on JDK8b132:
+        Object ret1 = inv.invokeFunction("getProp", two, 1);
+        assertEquals(ret1, "Ahoj", "Property value returned for 1");
+    }
+    
+    static Object checkArray(Invocable inv, Object val) throws Exception {
+        final Object fnRes = inv.invokeFunction("toJavaArray", val, null);
+        int length = ((Number) fnRes).intValue();
+        if (length == -1) {
+            return val;
+        }
+        Object[] arr = new Object[length];
+        inv.invokeFunction("toJavaArray", val, arr);
+        return arr;
+    }
+
+    static void defineArraySizeFn(ScriptEngine eng) throws ScriptException {
+        eng.eval("function toJavaArray(arr, to) {\n"
+                + "if (to === null) {\n"
+                + "  if (Object.prototype.toString.call(arr) === '[object Array]') return arr.length;\n"
+                + "  else return -1;\n"
+                + "} else {\n"
+                + "  var l = arr.length;\n"
+                + "  for (var i = 0; i < l; i++) to[i] = arr[i];\n"
+                + "  return l;\n"
+                + "}"
+                + "}"
+        );
+    }    
+}
