--- old/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java 2015-03-16 16:01:32.000000000 +0100 +++ new/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java 2015-03-16 16:01:32.000000000 +0100 @@ -26,7 +26,9 @@ package jdk.nashorn.internal.objects; import static jdk.nashorn.internal.runtime.ECMAErrors.typeError; + import java.nio.ByteBuffer; + import jdk.nashorn.internal.objects.annotations.Attribute; import jdk.nashorn.internal.objects.annotations.Constructor; import jdk.nashorn.internal.objects.annotations.Function; @@ -101,7 +103,9 @@ } if (args.length == 0) { - throw new RuntimeException("missing length argument"); + //For ES6 rev28+ we should throw a TypeError here. None of the other runtimes + //currently do it, though, so I have chosen to not implement that for now. + return new NativeArrayBuffer(0); } return new NativeArrayBuffer(JSType.toInt32(args[0]));