equal
deleted
inserted
replaced
199 |
199 |
200 return dest; |
200 return dest; |
201 } |
201 } |
202 |
202 |
203 protected static Object setImpl(final Object self, final Object array, final Object offset0) { |
203 protected static Object setImpl(final Object self, final Object array, final Object offset0) { |
204 final ArrayBufferView dest = ((ArrayBufferView)self); |
204 final ArrayBufferView dest = (ArrayBufferView)self; |
205 final int length; |
205 final int length; |
206 if (array instanceof ArrayBufferView) { |
206 if (array instanceof ArrayBufferView) { |
207 // void set(TypedArray array, optional unsigned long offset) |
207 // void set(TypedArray array, optional unsigned long offset) |
208 length = ((ArrayBufferView)array).elementLength(); |
208 length = ((ArrayBufferView)array).elementLength(); |
209 } else if (array instanceof NativeArray) { |
209 } else if (array instanceof NativeArray) { |
243 } |
243 } |
244 return (int)(length & Integer.MAX_VALUE); |
244 return (int)(length & Integer.MAX_VALUE); |
245 } |
245 } |
246 |
246 |
247 protected static Object subarrayImpl(final Object self, final Object begin0, final Object end0) { |
247 protected static Object subarrayImpl(final Object self, final Object begin0, final Object end0) { |
248 final ArrayBufferView arrayView = ((ArrayBufferView)self); |
248 final ArrayBufferView arrayView = (ArrayBufferView)self; |
249 final int byteOffset = arrayView.byteOffset; |
249 final int byteOffset = arrayView.byteOffset; |
250 final int bytesPerElement = arrayView.bytesPerElement(); |
250 final int bytesPerElement = arrayView.bytesPerElement(); |
251 final int elementLength = arrayView.elementLength(); |
251 final int elementLength = arrayView.elementLength(); |
252 final int begin = NativeArrayBuffer.adjustIndex(JSType.toInt32(begin0), elementLength); |
252 final int begin = NativeArrayBuffer.adjustIndex(JSType.toInt32(begin0), elementLength); |
253 final int end = NativeArrayBuffer.adjustIndex(end0 != ScriptRuntime.UNDEFINED ? JSType.toInt32(end0) : elementLength, elementLength); |
253 final int end = NativeArrayBuffer.adjustIndex(end0 != ScriptRuntime.UNDEFINED ? JSType.toInt32(end0) : elementLength, elementLength); |