aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlagergren <none@none>2014-11-28 11:02:54 +0100
committerlagergren <none@none>2014-11-28 11:02:54 +0100
commitdb7258d41f6866d2b6746d54aa758aa17ddbbde7 (patch)
treebd93389140f8cef66b3e133666782d8c74b0a8ca
parent9f9274bab0cc84d81a06c4ff8926eafa45c302dd (diff)
downloadnashorn-db7258d41f6866d2b6746d54aa758aa17ddbbde7.tar.gz
8066119: Invalid resource tag used for looking up error message in NativeDataView
Reviewed-by: hannesw, sundar
-rw-r--r--src/jdk/nashorn/internal/objects/NativeDataView.java20
-rw-r--r--src/jdk/nashorn/internal/runtime/resources/Messages.properties2
2 files changed, 11 insertions, 11 deletions
diff --git a/src/jdk/nashorn/internal/objects/NativeDataView.java b/src/jdk/nashorn/internal/objects/NativeDataView.java
index fb502771..14c11f69 100644
--- a/src/jdk/nashorn/internal/objects/NativeDataView.java
+++ b/src/jdk/nashorn/internal/objects/NativeDataView.java
@@ -105,10 +105,10 @@ public class NativeDataView extends ScriptObject {
private NativeDataView(final NativeArrayBuffer arrBuf, final ByteBuffer buf, final int offset, final int length) {
super(Global.instance().getDataViewPrototype(), $nasgenmap$);
- this.buffer = arrBuf;
+ this.buffer = arrBuf;
this.byteOffset = offset;
this.byteLength = length;
- this.buf = buf;
+ this.buf = buf;
}
/**
@@ -135,14 +135,14 @@ public class NativeDataView extends ScriptObject {
throw typeError("not.an.arraybuffer.in.dataview");
}
- final NativeArrayBuffer arrBuf = (NativeArrayBuffer) args[0];
+ final NativeArrayBuffer arrBuf = (NativeArrayBuffer)args[0];
switch (args.length) {
- case 1:
- return new NativeDataView(arrBuf);
- case 2:
- return new NativeDataView(arrBuf, JSType.toInt32(args[1]));
- default:
- return new NativeDataView(arrBuf, JSType.toInt32(args[1]), JSType.toInt32(args[2]));
+ case 1:
+ return new NativeDataView(arrBuf);
+ case 2:
+ return new NativeDataView(arrBuf, JSType.toInt32(args[1]));
+ default:
+ return new NativeDataView(arrBuf, JSType.toInt32(args[1]), JSType.toInt32(args[2]));
}
}
@@ -995,7 +995,7 @@ public class NativeDataView extends ScriptObject {
private static NativeDataView checkSelf(final Object self) {
if (!(self instanceof NativeDataView)) {
- throw typeError("not.an.arraybuffer", ScriptRuntime.safeToString(self));
+ throw typeError("not.an.arraybuffer.in.dataview", ScriptRuntime.safeToString(self));
}
return (NativeDataView)self;
}
diff --git a/src/jdk/nashorn/internal/runtime/resources/Messages.properties b/src/jdk/nashorn/internal/runtime/resources/Messages.properties
index 71c11743..119277df 100644
--- a/src/jdk/nashorn/internal/runtime/resources/Messages.properties
+++ b/src/jdk/nashorn/internal/runtime/resources/Messages.properties
@@ -82,7 +82,7 @@ type.error.not.a.constructor={0} is not a constructor function
type.error.not.a.file={0} is not a File
type.error.not.a.numeric.array={0} is not a numeric array
type.error.not.a.bytebuffer={0} is not a java.nio.ByteBuffer
-type.error.not.an.arraybuffer.in.dataview=First arg to DataView constructor must be an ArrayBuffer
+type.error.not.an.arraybuffer.in.dataview=First argument to DataView constructor must be an ArrayBuffer
type.error.no.reflection.with.classfilter=Java reflection not supported when class filter is present
# operations not permitted on undefined