Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1840)

Unified Diff: test/codegen/expect/dart/_native_typed_data.js

Issue 1020043002: Replace dart_core.js with actual compiled SDK (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merge Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/codegen/expect/dart/_js_primitives.js ('k') | test/codegen/expect/dart/async.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/dart/_native_typed_data.js
diff --git a/test/codegen/expect/dart/_native_typed_data.js b/test/codegen/expect/dart/_native_typed_data.js
deleted file mode 100644
index e5df8f8515418a757435c1800a24bd9f57e3892e..0000000000000000000000000000000000000000
--- a/test/codegen/expect/dart/_native_typed_data.js
+++ /dev/null
@@ -1,1538 +0,0 @@
-var _native_typed_data;
-(function(exports) {
- 'use strict';
- class NativeByteBuffer extends core.Object {
- NativeByteBuffer() {
- this.lengthInBytes = null;
- }
- get runtimeType() {
- return typed_data.ByteBuffer;
- }
- asUint8List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeUint8List.view(this, offsetInBytes, length);
- }
- asInt8List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeInt8List.view(this, offsetInBytes, length);
- }
- asUint8ClampedList(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeUint8ClampedList.view(this, offsetInBytes, length);
- }
- asUint16List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeUint16List.view(this, offsetInBytes, length);
- }
- asInt16List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeInt16List.view(this, offsetInBytes, length);
- }
- asUint32List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeUint32List.view(this, offsetInBytes, length);
- }
- asInt32List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeInt32List.view(this, offsetInBytes, length);
- }
- asUint64List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- throw new core.UnsupportedError("Uint64List not supported by dart2js.");
- }
- asInt64List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- throw new core.UnsupportedError("Int64List not supported by dart2js.");
- }
- asInt32x4List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- let storage = dart.as(this.asInt32List(offsetInBytes, length !== null ? dart.notNull(length) * 4 : null), NativeInt32List);
- return new NativeInt32x4List._externalStorage(storage);
- }
- asFloat32List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeFloat32List.view(this, offsetInBytes, length);
- }
- asFloat64List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeFloat64List.view(this, offsetInBytes, length);
- }
- asFloat32x4List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- let storage = dart.as(this.asFloat32List(offsetInBytes, length !== null ? dart.notNull(length) * 4 : null), NativeFloat32List);
- return new NativeFloat32x4List._externalStorage(storage);
- }
- asFloat64x2List(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- let storage = dart.as(this.asFloat64List(offsetInBytes, length !== null ? dart.notNull(length) * 2 : null), NativeFloat64List);
- return new NativeFloat64x2List._externalStorage(storage);
- }
- asByteData(offsetInBytes, length) {
- if (offsetInBytes === void 0)
- offsetInBytes = 0;
- if (length === void 0)
- length = null;
- return new NativeByteData.view(this, offsetInBytes, length);
- }
- }
- let _storage = Symbol('_storage');
- let _invalidIndex = Symbol('_invalidIndex');
- let _checkIndex = Symbol('_checkIndex');
- let _checkSublistArguments = Symbol('_checkSublistArguments');
- class NativeFloat32x4List extends dart.mixin(core.Object, collection.ListMixin$(typed_data.Float32x4), _internal.FixedLengthListMixin$(typed_data.Float32x4)) {
- NativeFloat32x4List(length) {
- this[_storage] = new NativeFloat32List(dart.notNull(length) * 4);
- }
- NativeFloat32x4List$_externalStorage($_storage) {
- this[_storage] = $_storage;
- }
- NativeFloat32x4List$_slowFromList(list) {
- this[_storage] = new NativeFloat32List(dart.notNull(list.length) * 4);
- for (let i = 0; dart.notNull(i) < dart.notNull(list.length); i = dart.notNull(i) + 1) {
- let e = list.get(i);
- this[_storage].set(dart.notNull(i) * 4 + 0, e.x);
- this[_storage].set(dart.notNull(i) * 4 + 1, e.y);
- this[_storage].set(dart.notNull(i) * 4 + 2, e.z);
- this[_storage].set(dart.notNull(i) * 4 + 3, e.w);
- }
- }
- get runtimeType() {
- return typed_data.Float32x4List;
- }
- NativeFloat32x4List$fromList(list) {
- if (dart.is(list, NativeFloat32x4List)) {
- return new NativeFloat32x4List._externalStorage(new NativeFloat32List.fromList(list[_storage]));
- } else {
- return new NativeFloat32x4List._slowFromList(list);
- }
- }
- get buffer() {
- return this[_storage].buffer;
- }
- get lengthInBytes() {
- return this[_storage].lengthInBytes;
- }
- get offsetInBytes() {
- return this[_storage].offsetInBytes;
- }
- get elementSizeInBytes() {
- return typed_data.Float32x4List.BYTES_PER_ELEMENT;
- }
- [_invalidIndex](index, length) {
- if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(length)) {
- if (length === this.length) {
- throw new core.RangeError.index(index, this);
- }
- throw new core.RangeError.range(index, 0, dart.notNull(length) - 1);
- } else {
- throw new core.ArgumentError(`Invalid list index ${index}`);
- }
- }
- [_checkIndex](index, length) {
- if (index >>> 0 != index || dart.notNull(index) >= dart.notNull(length)) {
- this[_invalidIndex](index, length);
- }
- }
- [_checkSublistArguments](start, end, length) {
- this[_checkIndex](start, dart.notNull(length) + 1);
- if (end === null)
- return length;
- this[_checkIndex](end, dart.notNull(length) + 1);
- if (dart.notNull(start) > dart.notNull(end))
- throw new core.RangeError.range(start, 0, end);
- return end;
- }
- get length() {
- return (dart.notNull(this[_storage].length) / 4).truncate();
- }
- get(index) {
- this[_checkIndex](index, this.length);
- let _x = this[_storage].get(dart.notNull(index) * 4 + 0);
- let _y = this[_storage].get(dart.notNull(index) * 4 + 1);
- let _z = this[_storage].get(dart.notNull(index) * 4 + 2);
- let _w = this[_storage].get(dart.notNull(index) * 4 + 3);
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- set(index, value) {
- this[_checkIndex](index, this.length);
- this[_storage].set(dart.notNull(index) * 4 + 0, value.x);
- this[_storage].set(dart.notNull(index) * 4 + 1, value.y);
- this[_storage].set(dart.notNull(index) * 4 + 2, value.z);
- this[_storage].set(dart.notNull(index) * 4 + 3, value.w);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- return new NativeFloat32x4List._externalStorage(dart.as(this[_storage].sublist(dart.notNull(start) * 4, dart.notNull(end) * 4), NativeFloat32List));
- }
- }
- dart.defineNamedConstructor(NativeFloat32x4List, '_externalStorage');
- dart.defineNamedConstructor(NativeFloat32x4List, '_slowFromList');
- dart.defineNamedConstructor(NativeFloat32x4List, 'fromList');
- class NativeInt32x4List extends dart.mixin(core.Object, collection.ListMixin$(typed_data.Int32x4), _internal.FixedLengthListMixin$(typed_data.Int32x4)) {
- NativeInt32x4List(length) {
- this[_storage] = new NativeInt32List(dart.notNull(length) * 4);
- }
- NativeInt32x4List$_externalStorage(storage) {
- this[_storage] = storage;
- }
- NativeInt32x4List$_slowFromList(list) {
- this[_storage] = new NativeInt32List(dart.notNull(list.length) * 4);
- for (let i = 0; dart.notNull(i) < dart.notNull(list.length); i = dart.notNull(i) + 1) {
- let e = list.get(i);
- this[_storage].set(dart.notNull(i) * 4 + 0, e.x);
- this[_storage].set(dart.notNull(i) * 4 + 1, e.y);
- this[_storage].set(dart.notNull(i) * 4 + 2, e.z);
- this[_storage].set(dart.notNull(i) * 4 + 3, e.w);
- }
- }
- get runtimeType() {
- return typed_data.Int32x4List;
- }
- NativeInt32x4List$fromList(list) {
- if (dart.is(list, NativeInt32x4List)) {
- return new NativeInt32x4List._externalStorage(new NativeInt32List.fromList(list[_storage]));
- } else {
- return new NativeInt32x4List._slowFromList(list);
- }
- }
- get buffer() {
- return this[_storage].buffer;
- }
- get lengthInBytes() {
- return this[_storage].lengthInBytes;
- }
- get offsetInBytes() {
- return this[_storage].offsetInBytes;
- }
- get elementSizeInBytes() {
- return typed_data.Int32x4List.BYTES_PER_ELEMENT;
- }
- [_invalidIndex](index, length) {
- if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(length)) {
- if (length === this.length) {
- throw new core.RangeError.index(index, this);
- }
- throw new core.RangeError.range(index, 0, dart.notNull(length) - 1);
- } else {
- throw new core.ArgumentError(`Invalid list index ${index}`);
- }
- }
- [_checkIndex](index, length) {
- if (index >>> 0 != index || index >= length) {
- this[_invalidIndex](index, length);
- }
- }
- [_checkSublistArguments](start, end, length) {
- this[_checkIndex](start, dart.notNull(length) + 1);
- if (end === null)
- return length;
- this[_checkIndex](end, dart.notNull(length) + 1);
- if (dart.notNull(start) > dart.notNull(end))
- throw new core.RangeError.range(start, 0, end);
- return end;
- }
- get length() {
- return (dart.notNull(this[_storage].length) / 4).truncate();
- }
- get(index) {
- this[_checkIndex](index, this.length);
- let _x = this[_storage].get(dart.notNull(index) * 4 + 0);
- let _y = this[_storage].get(dart.notNull(index) * 4 + 1);
- let _z = this[_storage].get(dart.notNull(index) * 4 + 2);
- let _w = this[_storage].get(dart.notNull(index) * 4 + 3);
- return new NativeInt32x4._truncated(_x, _y, _z, _w);
- }
- set(index, value) {
- this[_checkIndex](index, this.length);
- this[_storage].set(dart.notNull(index) * 4 + 0, value.x);
- this[_storage].set(dart.notNull(index) * 4 + 1, value.y);
- this[_storage].set(dart.notNull(index) * 4 + 2, value.z);
- this[_storage].set(dart.notNull(index) * 4 + 3, value.w);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- return new NativeInt32x4List._externalStorage(dart.as(this[_storage].sublist(dart.notNull(start) * 4, dart.notNull(end) * 4), typed_data.Int32List));
- }
- }
- dart.defineNamedConstructor(NativeInt32x4List, '_externalStorage');
- dart.defineNamedConstructor(NativeInt32x4List, '_slowFromList');
- dart.defineNamedConstructor(NativeInt32x4List, 'fromList');
- class NativeFloat64x2List extends dart.mixin(core.Object, collection.ListMixin$(typed_data.Float64x2), _internal.FixedLengthListMixin$(typed_data.Float64x2)) {
- NativeFloat64x2List(length) {
- this[_storage] = new NativeFloat64List(dart.notNull(length) * 2);
- }
- NativeFloat64x2List$_externalStorage($_storage) {
- this[_storage] = $_storage;
- }
- NativeFloat64x2List$_slowFromList(list) {
- this[_storage] = new NativeFloat64List(dart.notNull(list.length) * 2);
- for (let i = 0; dart.notNull(i) < dart.notNull(list.length); i = dart.notNull(i) + 1) {
- let e = list.get(i);
- this[_storage].set(dart.notNull(i) * 2 + 0, e.x);
- this[_storage].set(dart.notNull(i) * 2 + 1, e.y);
- }
- }
- NativeFloat64x2List$fromList(list) {
- if (dart.is(list, NativeFloat64x2List)) {
- return new NativeFloat64x2List._externalStorage(new NativeFloat64List.fromList(list[_storage]));
- } else {
- return new NativeFloat64x2List._slowFromList(list);
- }
- }
- get runtimeType() {
- return typed_data.Float64x2List;
- }
- get buffer() {
- return this[_storage].buffer;
- }
- get lengthInBytes() {
- return this[_storage].lengthInBytes;
- }
- get offsetInBytes() {
- return this[_storage].offsetInBytes;
- }
- get elementSizeInBytes() {
- return typed_data.Float64x2List.BYTES_PER_ELEMENT;
- }
- [_invalidIndex](index, length) {
- if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(length)) {
- if (length === this.length) {
- throw new core.RangeError.index(index, this);
- }
- throw new core.RangeError.range(index, 0, dart.notNull(length) - 1);
- } else {
- throw new core.ArgumentError(`Invalid list index ${index}`);
- }
- }
- [_checkIndex](index, length) {
- if (index >>> 0 != index || dart.notNull(index) >= dart.notNull(length)) {
- this[_invalidIndex](index, length);
- }
- }
- [_checkSublistArguments](start, end, length) {
- this[_checkIndex](start, dart.notNull(length) + 1);
- if (end === null)
- return length;
- this[_checkIndex](end, dart.notNull(length) + 1);
- if (dart.notNull(start) > dart.notNull(end))
- throw new core.RangeError.range(start, 0, end);
- return end;
- }
- get length() {
- return (dart.notNull(this[_storage].length) / 2).truncate();
- }
- get(index) {
- this[_checkIndex](index, this.length);
- let _x = this[_storage].get(dart.notNull(index) * 2 + 0);
- let _y = this[_storage].get(dart.notNull(index) * 2 + 1);
- return new typed_data.Float64x2(_x, _y);
- }
- set(index, value) {
- this[_checkIndex](index, this.length);
- this[_storage].set(dart.notNull(index) * 2 + 0, value.x);
- this[_storage].set(dart.notNull(index) * 2 + 1, value.y);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- return new NativeFloat64x2List._externalStorage(dart.as(this[_storage].sublist(dart.notNull(start) * 2, dart.notNull(end) * 2), NativeFloat64List));
- }
- }
- dart.defineNamedConstructor(NativeFloat64x2List, '_externalStorage');
- dart.defineNamedConstructor(NativeFloat64x2List, '_slowFromList');
- dart.defineNamedConstructor(NativeFloat64x2List, 'fromList');
- class NativeTypedData extends core.Object {
- NativeTypedData() {
- this.buffer = null;
- this.lengthInBytes = null;
- this.offsetInBytes = null;
- this.elementSizeInBytes = null;
- }
- [_invalidIndex](index, length) {
- if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(length)) {
- if (dart.is(this, core.List)) {
- let list = this;
- if (length === list.length) {
- throw new core.RangeError.index(index, this);
- }
- }
- throw new core.RangeError.range(index, 0, dart.notNull(length) - 1);
- } else {
- throw new core.ArgumentError(`Invalid list index ${index}`);
- }
- }
- [_checkIndex](index, length) {
- if (index >>> 0 !== index || index >= dart.notNull(length)) {
- this[_invalidIndex](index, length);
- }
- }
- [_checkSublistArguments](start, end, length) {
- this[_checkIndex](start, dart.notNull(length) + 1);
- if (end === null)
- return length;
- this[_checkIndex](end, dart.notNull(length) + 1);
- if (dart.notNull(start) > dart.notNull(end))
- throw new core.RangeError.range(start, 0, end);
- return end;
- }
- }
- // Function _checkLength: (dynamic) → int
- function _checkLength(length) {
- if (!(typeof length == number))
- throw new core.ArgumentError(`Invalid length ${length}`);
- return dart.as(length, core.int);
- }
- // Function _checkViewArguments: (dynamic, dynamic, dynamic) → void
- function _checkViewArguments(buffer, offsetInBytes, length) {
- if (!dart.is(buffer, NativeByteBuffer)) {
- throw new core.ArgumentError('Invalid view buffer');
- }
- if (!(typeof offsetInBytes == number)) {
- throw new core.ArgumentError(`Invalid view offsetInBytes ${offsetInBytes}`);
- }
- if (dart.notNull(length !== null) && dart.notNull(!(typeof length == number))) {
- throw new core.ArgumentError(`Invalid view length ${length}`);
- }
- }
- // Function _ensureNativeList: (List<dynamic>) → List
- function _ensureNativeList(list) {
- if (dart.is(list, _interceptors.JSIndexable))
- return list;
- let result = new core.List(list.length);
- for (let i = 0; dart.notNull(i) < dart.notNull(list.length); i = dart.notNull(i) + 1) {
- result.set(i, list.get(i));
- }
- return result;
- }
- let _getFloat32 = Symbol('_getFloat32');
- let _getFloat64 = Symbol('_getFloat64');
- let _getInt16 = Symbol('_getInt16');
- let _getInt32 = Symbol('_getInt32');
- let _getUint16 = Symbol('_getUint16');
- let _getUint32 = Symbol('_getUint32');
- let _setFloat32 = Symbol('_setFloat32');
- let _setFloat64 = Symbol('_setFloat64');
- let _setInt16 = Symbol('_setInt16');
- let _setInt32 = Symbol('_setInt32');
- let _setUint16 = Symbol('_setUint16');
- let _setUint32 = Symbol('_setUint32');
- let _create1 = Symbol('_create1');
- let _create2 = Symbol('_create2');
- let _create3 = Symbol('_create3');
- class NativeByteData extends NativeTypedData {
- NativeByteData(length) {
- return _create1(_checkLength(length));
- }
- NativeByteData$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.ByteData;
- }
- get elementSizeInBytes() {
- return 1;
- }
- getFloat32(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_getFloat32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- getFloat64(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_getFloat64](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- getInt16(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_getInt16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- getInt32(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_getInt32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- getInt64(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- throw new core.UnsupportedError('Int64 accessor not supported by dart2js.');
- }
- getUint16(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_getUint16](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- getUint32(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_getUint32](byteOffset, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- getUint64(byteOffset, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- throw new core.UnsupportedError('Uint64 accessor not supported by dart2js.');
- }
- setFloat32(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_setFloat32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- setFloat64(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_setFloat64](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- setInt16(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_setInt16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- setInt32(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_setInt32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- setInt64(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- throw new core.UnsupportedError('Int64 accessor not supported by dart2js.');
- }
- setUint16(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_setUint16](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- setUint32(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- return this[_setUint32](byteOffset, value, dart.equals(typed_data.Endianness.LITTLE_ENDIAN, endian));
- }
- setUint64(byteOffset, value, endian) {
- if (endian === void 0)
- endian = typed_data.Endianness.BIG_ENDIAN;
- throw new core.UnsupportedError('Uint64 accessor not supported by dart2js.');
- }
- static [_create1](arg) {
- return dart.as(new DataView(new ArrayBuffer(arg)), NativeByteData);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new DataView(arg1, arg2), NativeByteData);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new DataView(arg1, arg2, arg3), NativeByteData);
- }
- }
- dart.defineNamedConstructor(NativeByteData, 'view');
- let _setRangeFast = Symbol('_setRangeFast');
- class NativeTypedArray extends NativeTypedData {
- get length() {
- return dart.as(this.length, core.int);
- }
- [_setRangeFast](start, end, source, skipCount) {
- let targetLength = this.length;
- this[_checkIndex](start, dart.notNull(targetLength) + 1);
- this[_checkIndex](end, dart.notNull(targetLength) + 1);
- if (dart.notNull(start) > dart.notNull(end))
- throw new core.RangeError.range(start, 0, end);
- let count = dart.notNull(end) - dart.notNull(start);
- if (dart.notNull(skipCount) < 0)
- throw new core.ArgumentError(skipCount);
- let sourceLength = source.length;
- if (dart.notNull(sourceLength) - dart.notNull(skipCount) < dart.notNull(count)) {
- throw new core.StateError('Not enough elements');
- }
- if (skipCount !== 0 || sourceLength !== count) {
- source = dart.as(source.subarray(skipCount, dart.notNull(skipCount) + dart.notNull(count)), NativeTypedArray);
- }
- this.set(source, start);
- }
- }
- class NativeTypedArrayOfDouble extends dart.mixin(NativeTypedArray, collection.ListMixin$(core.double), _internal.FixedLengthListMixin$(core.double)) {
- get(index) {
- this[_checkIndex](index, this.length);
- return this[index];
- }
- set(index, value) {
- this[_checkIndex](index, this.length);
- this[index] = value;
- }
- setRange(start, end, iterable, skipCount) {
- if (skipCount === void 0)
- skipCount = 0;
- if (dart.is(iterable, NativeTypedArrayOfDouble)) {
- this[_setRangeFast](start, end, iterable, skipCount);
- return;
- }
- super.setRange(start, end, iterable, skipCount);
- }
- }
- class NativeTypedArrayOfInt extends dart.mixin(NativeTypedArray, collection.ListMixin$(core.int), _internal.FixedLengthListMixin$(core.int)) {
- set(index, value) {
- this[_checkIndex](index, this.length);
- this[index] = value;
- }
- setRange(start, end, iterable, skipCount) {
- if (skipCount === void 0)
- skipCount = 0;
- if (dart.is(iterable, NativeTypedArrayOfInt)) {
- this[_setRangeFast](start, end, iterable, skipCount);
- return;
- }
- super.setRange(start, end, iterable, skipCount);
- }
- }
- class NativeFloat32List extends NativeTypedArrayOfDouble {
- NativeFloat32List(length) {
- return _create1(_checkLength(length));
- }
- NativeFloat32List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeFloat32List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Float32List;
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Float32Array(arg), NativeFloat32List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Float32Array(arg1, arg2), NativeFloat32List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Float32Array(arg1, arg2, arg3), NativeFloat32List);
- }
- }
- dart.defineNamedConstructor(NativeFloat32List, 'fromList');
- dart.defineNamedConstructor(NativeFloat32List, 'view');
- class NativeFloat64List extends NativeTypedArrayOfDouble {
- NativeFloat64List(length) {
- return _create1(_checkLength(length));
- }
- NativeFloat64List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeFloat64List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Float64List;
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Float64Array(arg), NativeFloat64List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Float64Array(arg1, arg2), NativeFloat64List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Float64Array(arg1, arg2, arg3), NativeFloat64List);
- }
- }
- dart.defineNamedConstructor(NativeFloat64List, 'fromList');
- dart.defineNamedConstructor(NativeFloat64List, 'view');
- class NativeInt16List extends NativeTypedArrayOfInt {
- NativeInt16List(length) {
- return _create1(_checkLength(length));
- }
- NativeInt16List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeInt16List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Int16List;
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return this[index];
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Int16Array(arg), NativeInt16List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Int16Array(arg1, arg2), NativeInt16List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Int16Array(arg1, arg2, arg3), NativeInt16List);
- }
- }
- dart.defineNamedConstructor(NativeInt16List, 'fromList');
- dart.defineNamedConstructor(NativeInt16List, 'view');
- class NativeInt32List extends NativeTypedArrayOfInt {
- NativeInt32List(length) {
- return _create1(_checkLength(length));
- }
- NativeInt32List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeInt32List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Int32List;
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return this[index];
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Int32Array(arg), NativeInt32List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Int32Array(arg1, arg2), NativeInt32List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Int32Array(arg1, arg2, arg3), NativeInt32List);
- }
- }
- dart.defineNamedConstructor(NativeInt32List, 'fromList');
- dart.defineNamedConstructor(NativeInt32List, 'view');
- class NativeInt8List extends NativeTypedArrayOfInt {
- NativeInt8List(length) {
- return _create1(_checkLength(length));
- }
- NativeInt8List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeInt8List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return dart.as(length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length), NativeInt8List);
- }
- get runtimeType() {
- return typed_data.Int8List;
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return this[index];
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Int8Array(arg), NativeInt8List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Int8Array(arg1, arg2), NativeInt8List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Int8Array(arg1, arg2, arg3), typed_data.Int8List);
- }
- }
- dart.defineNamedConstructor(NativeInt8List, 'fromList');
- dart.defineNamedConstructor(NativeInt8List, 'view');
- class NativeUint16List extends NativeTypedArrayOfInt {
- NativeUint16List(length) {
- return _create1(_checkLength(length));
- }
- NativeUint16List$fromList(list) {
- return _create1(_ensureNativeList(list));
- }
- NativeUint16List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Uint16List;
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return dart.as(this[index], core.int);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Uint16Array(arg), NativeUint16List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Uint16Array(arg1, arg2), NativeUint16List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Uint16Array(arg1, arg2, arg3), NativeUint16List);
- }
- }
- dart.defineNamedConstructor(NativeUint16List, 'fromList');
- dart.defineNamedConstructor(NativeUint16List, 'view');
- class NativeUint32List extends NativeTypedArrayOfInt {
- NativeUint32List(length) {
- return _create1(_checkLength(length));
- }
- NativeUint32List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeUint32List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Uint32List;
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return dart.as(this[index], core.int);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Uint32Array(arg), NativeUint32List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Uint32Array(arg1, arg2), NativeUint32List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Uint32Array(arg1, arg2, arg3), NativeUint32List);
- }
- }
- dart.defineNamedConstructor(NativeUint32List, 'fromList');
- dart.defineNamedConstructor(NativeUint32List, 'view');
- class NativeUint8ClampedList extends NativeTypedArrayOfInt {
- NativeUint8ClampedList(length) {
- return _create1(_checkLength(length));
- }
- NativeUint8ClampedList$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeUint8ClampedList$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Uint8ClampedList;
- }
- get length() {
- return dart.as(this.length, core.int);
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return dart.as(this[index], core.int);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Uint8ClampedArray(arg), NativeUint8ClampedList);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Uint8ClampedArray(arg1, arg2), NativeUint8ClampedList);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Uint8ClampedArray(arg1, arg2, arg3), NativeUint8ClampedList);
- }
- }
- dart.defineNamedConstructor(NativeUint8ClampedList, 'fromList');
- dart.defineNamedConstructor(NativeUint8ClampedList, 'view');
- class NativeUint8List extends NativeTypedArrayOfInt {
- NativeUint8List(length) {
- return _create1(_checkLength(length));
- }
- NativeUint8List$fromList(elements) {
- return _create1(_ensureNativeList(elements));
- }
- NativeUint8List$view(buffer, offsetInBytes, length) {
- _checkViewArguments(buffer, offsetInBytes, length);
- return length === null ? _create2(buffer, offsetInBytes) : _create3(buffer, offsetInBytes, length);
- }
- get runtimeType() {
- return typed_data.Uint8List;
- }
- get length() {
- return dart.as(this.length, core.int);
- }
- get(index) {
- this[_checkIndex](index, this.length);
- return dart.as(this[index], core.int);
- }
- sublist(start, end) {
- if (end === void 0)
- end = null;
- end = this[_checkSublistArguments](start, end, this.length);
- let source = this.subarray(start, end);
- return _create1(source);
- }
- static [_create1](arg) {
- return dart.as(new Uint8Array(arg), NativeUint8List);
- }
- static [_create2](arg1, arg2) {
- return dart.as(new Uint8Array(arg1, arg2), NativeUint8List);
- }
- static [_create3](arg1, arg2, arg3) {
- return dart.as(new Uint8Array(arg1, arg2, arg3), NativeUint8List);
- }
- }
- dart.defineNamedConstructor(NativeUint8List, 'fromList');
- dart.defineNamedConstructor(NativeUint8List, 'view');
- let _truncate = Symbol('_truncate');
- class NativeFloat32x4 extends core.Object {
- static [_truncate](x) {
- _list.set(0, dart.as(x, core.num));
- return _list.get(0);
- }
- NativeFloat32x4(x, y, z, w) {
- this.x = dart.as(_truncate(x), core.double);
- this.y = dart.as(_truncate(y), core.double);
- this.z = dart.as(_truncate(z), core.double);
- this.w = dart.as(_truncate(w), core.double);
- if (!dart.is(x, core.num))
- throw new core.ArgumentError(x);
- if (!dart.is(y, core.num))
- throw new core.ArgumentError(y);
- if (!dart.is(z, core.num))
- throw new core.ArgumentError(z);
- if (!dart.is(w, core.num))
- throw new core.ArgumentError(w);
- }
- NativeFloat32x4$splat(v) {
- this.NativeFloat32x4(v, v, v, v);
- }
- NativeFloat32x4$zero() {
- this.NativeFloat32x4$_truncated(0.0, 0.0, 0.0, 0.0);
- }
- NativeFloat32x4$fromInt32x4Bits(i) {
- _uint32view.set(0, i.x);
- _uint32view.set(1, i.y);
- _uint32view.set(2, i.z);
- _uint32view.set(3, i.w);
- return new NativeFloat32x4._truncated(_list.get(0), _list.get(1), _list.get(2), _list.get(3));
- }
- NativeFloat32x4$fromFloat64x2(v) {
- this.NativeFloat32x4$_truncated(dart.as(_truncate(v.x), core.double), dart.as(_truncate(v.y), core.double), 0.0, 0.0);
- }
- NativeFloat32x4$_doubles(x, y, z, w) {
- this.x = dart.as(_truncate(x), core.double);
- this.y = dart.as(_truncate(y), core.double);
- this.z = dart.as(_truncate(z), core.double);
- this.w = dart.as(_truncate(w), core.double);
- }
- NativeFloat32x4$_truncated(x, y, z, w) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
- toString() {
- return `[${this.x}, ${this.y}, ${this.z}, ${this.w}]`;
- }
- ['+'](other) {
- let _x = dart.notNull(this.x) + dart.notNull(other.x);
- let _y = dart.notNull(this.y) + dart.notNull(other.y);
- let _z = dart.notNull(this.z) + dart.notNull(other.z);
- let _w = dart.notNull(this.w) + dart.notNull(other.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- ['-']() {
- return new NativeFloat32x4._truncated(-dart.notNull(this.x), -dart.notNull(this.y), -dart.notNull(this.z), -dart.notNull(this.w));
- }
- ['-'](other) {
- let _x = dart.notNull(this.x) - dart.notNull(other.x);
- let _y = dart.notNull(this.y) - dart.notNull(other.y);
- let _z = dart.notNull(this.z) - dart.notNull(other.z);
- let _w = dart.notNull(this.w) - dart.notNull(other.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- ['*'](other) {
- let _x = dart.notNull(this.x) * dart.notNull(other.x);
- let _y = dart.notNull(this.y) * dart.notNull(other.y);
- let _z = dart.notNull(this.z) * dart.notNull(other.z);
- let _w = dart.notNull(this.w) * dart.notNull(other.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- ['/'](other) {
- let _x = dart.notNull(this.x) / dart.notNull(other.x);
- let _y = dart.notNull(this.y) / dart.notNull(other.y);
- let _z = dart.notNull(this.z) / dart.notNull(other.z);
- let _w = dart.notNull(this.w) / dart.notNull(other.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- lessThan(other) {
- let _cx = dart.notNull(this.x) < dart.notNull(other.x);
- let _cy = dart.notNull(this.y) < dart.notNull(other.y);
- let _cz = dart.notNull(this.z) < dart.notNull(other.z);
- let _cw = dart.notNull(this.w) < dart.notNull(other.w);
- return new NativeInt32x4._truncated(_cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
- }
- lessThanOrEqual(other) {
- let _cx = dart.notNull(this.x) <= dart.notNull(other.x);
- let _cy = dart.notNull(this.y) <= dart.notNull(other.y);
- let _cz = dart.notNull(this.z) <= dart.notNull(other.z);
- let _cw = dart.notNull(this.w) <= dart.notNull(other.w);
- return new NativeInt32x4._truncated(_cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
- }
- greaterThan(other) {
- let _cx = dart.notNull(this.x) > dart.notNull(other.x);
- let _cy = dart.notNull(this.y) > dart.notNull(other.y);
- let _cz = dart.notNull(this.z) > dart.notNull(other.z);
- let _cw = dart.notNull(this.w) > dart.notNull(other.w);
- return new NativeInt32x4._truncated(_cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
- }
- greaterThanOrEqual(other) {
- let _cx = dart.notNull(this.x) >= dart.notNull(other.x);
- let _cy = dart.notNull(this.y) >= dart.notNull(other.y);
- let _cz = dart.notNull(this.z) >= dart.notNull(other.z);
- let _cw = dart.notNull(this.w) >= dart.notNull(other.w);
- return new NativeInt32x4._truncated(_cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
- }
- equal(other) {
- let _cx = this.x === other.x;
- let _cy = this.y === other.y;
- let _cz = this.z === other.z;
- let _cw = this.w === other.w;
- return new NativeInt32x4._truncated(_cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
- }
- notEqual(other) {
- let _cx = this.x !== other.x;
- let _cy = this.y !== other.y;
- let _cz = this.z !== other.z;
- let _cw = this.w !== other.w;
- return new NativeInt32x4._truncated(_cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
- }
- scale(s) {
- let _x = dart.notNull(s) * dart.notNull(this.x);
- let _y = dart.notNull(s) * dart.notNull(this.y);
- let _z = dart.notNull(s) * dart.notNull(this.z);
- let _w = dart.notNull(s) * dart.notNull(this.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- abs() {
- let _x = this.x.abs();
- let _y = this.y.abs();
- let _z = this.z.abs();
- let _w = this.w.abs();
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- clamp(lowerLimit, upperLimit) {
- let _lx = lowerLimit.x;
- let _ly = lowerLimit.y;
- let _lz = lowerLimit.z;
- let _lw = lowerLimit.w;
- let _ux = upperLimit.x;
- let _uy = upperLimit.y;
- let _uz = upperLimit.z;
- let _uw = upperLimit.w;
- let _x = this.x;
- let _y = this.y;
- let _z = this.z;
- let _w = this.w;
- _x = dart.notNull(_x) > dart.notNull(_ux) ? _ux : _x;
- _y = dart.notNull(_y) > dart.notNull(_uy) ? _uy : _y;
- _z = dart.notNull(_z) > dart.notNull(_uz) ? _uz : _z;
- _w = dart.notNull(_w) > dart.notNull(_uw) ? _uw : _w;
- _x = dart.notNull(_x) < dart.notNull(_lx) ? _lx : _x;
- _y = dart.notNull(_y) < dart.notNull(_ly) ? _ly : _y;
- _z = dart.notNull(_z) < dart.notNull(_lz) ? _lz : _z;
- _w = dart.notNull(_w) < dart.notNull(_lw) ? _lw : _w;
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- get signMask() {
- let view = _uint32view;
- let mx = null, my = null, mz = null, mw = null;
- _list.set(0, this.x);
- _list.set(1, this.y);
- _list.set(2, this.z);
- _list.set(3, this.w);
- mx = (dart.notNull(view.get(0)) & 2147483648) >> 31;
- my = (dart.notNull(view.get(1)) & 2147483648) >> 30;
- mz = (dart.notNull(view.get(2)) & 2147483648) >> 29;
- mw = (dart.notNull(view.get(3)) & 2147483648) >> 28;
- return dart.as(dart.dbinary(dart.dbinary(dart.dbinary(mx, '|', my), '|', mz), '|', mw), core.int);
- }
- shuffle(m) {
- if (dart.notNull(m) < 0 || dart.notNull(m) > 255) {
- throw new core.RangeError(`mask ${m} must be in the range [0..256)`);
- }
- _list.set(0, this.x);
- _list.set(1, this.y);
- _list.set(2, this.z);
- _list.set(3, this.w);
- let _x = _list.get(dart.notNull(m) & 3);
- let _y = _list.get(dart.notNull(m) >> 2 & 3);
- let _z = _list.get(dart.notNull(m) >> 4 & 3);
- let _w = _list.get(dart.notNull(m) >> 6 & 3);
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- shuffleMix(other, m) {
- if (dart.notNull(m) < 0 || dart.notNull(m) > 255) {
- throw new core.RangeError(`mask ${m} must be in the range [0..256)`);
- }
- _list.set(0, this.x);
- _list.set(1, this.y);
- _list.set(2, this.z);
- _list.set(3, this.w);
- let _x = _list.get(dart.notNull(m) & 3);
- let _y = _list.get(dart.notNull(m) >> 2 & 3);
- _list.set(0, other.x);
- _list.set(1, other.y);
- _list.set(2, other.z);
- _list.set(3, other.w);
- let _z = _list.get(dart.notNull(m) >> 4 & 3);
- let _w = _list.get(dart.notNull(m) >> 6 & 3);
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- withX(newX) {
- return new NativeFloat32x4._truncated(dart.as(_truncate(newX), core.double), this.y, this.z, this.w);
- }
- withY(newY) {
- return new NativeFloat32x4._truncated(this.x, dart.as(_truncate(newY), core.double), this.z, this.w);
- }
- withZ(newZ) {
- return new NativeFloat32x4._truncated(this.x, this.y, dart.as(_truncate(newZ), core.double), this.w);
- }
- withW(newW) {
- return new NativeFloat32x4._truncated(this.x, this.y, this.z, dart.as(_truncate(newW), core.double));
- }
- min(other) {
- let _x = dart.notNull(this.x) < dart.notNull(other.x) ? this.x : other.x;
- let _y = dart.notNull(this.y) < dart.notNull(other.y) ? this.y : other.y;
- let _z = dart.notNull(this.z) < dart.notNull(other.z) ? this.z : other.z;
- let _w = dart.notNull(this.w) < dart.notNull(other.w) ? this.w : other.w;
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- max(other) {
- let _x = dart.notNull(this.x) > dart.notNull(other.x) ? this.x : other.x;
- let _y = dart.notNull(this.y) > dart.notNull(other.y) ? this.y : other.y;
- let _z = dart.notNull(this.z) > dart.notNull(other.z) ? this.z : other.z;
- let _w = dart.notNull(this.w) > dart.notNull(other.w) ? this.w : other.w;
- return new NativeFloat32x4._truncated(_x, _y, _z, _w);
- }
- sqrt() {
- let _x = Math.sqrt(this.x);
- let _y = Math.sqrt(this.y);
- let _z = Math.sqrt(this.z);
- let _w = Math.sqrt(this.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- reciprocal() {
- let _x = 1.0 / dart.notNull(this.x);
- let _y = 1.0 / dart.notNull(this.y);
- let _z = 1.0 / dart.notNull(this.z);
- let _w = 1.0 / dart.notNull(this.w);
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- reciprocalSqrt() {
- let _x = Math.sqrt(1.0 / dart.notNull(this.x));
- let _y = Math.sqrt(1.0 / dart.notNull(this.y));
- let _z = Math.sqrt(1.0 / dart.notNull(this.z));
- let _w = Math.sqrt(1.0 / dart.notNull(this.w));
- return new NativeFloat32x4._doubles(_x, _y, _z, _w);
- }
- }
- dart.defineNamedConstructor(NativeFloat32x4, 'splat');
- dart.defineNamedConstructor(NativeFloat32x4, 'zero');
- dart.defineNamedConstructor(NativeFloat32x4, 'fromInt32x4Bits');
- dart.defineNamedConstructor(NativeFloat32x4, 'fromFloat64x2');
- dart.defineNamedConstructor(NativeFloat32x4, '_doubles');
- dart.defineNamedConstructor(NativeFloat32x4, '_truncated');
- dart.defineLazyProperties(NativeFloat32x4, {
- get _list() {
- return new NativeFloat32List(4);
- },
- get _uint32view() {
- return _list.buffer.asUint32List();
- }
- });
- let _list = Symbol('_list');
- let _uint32view = Symbol('_uint32view');
- class NativeInt32x4 extends core.Object {
- static [_truncate](x) {
- _list.set(0, dart.as(x, core.int));
- return _list.get(0);
- }
- NativeInt32x4(x, y, z, w) {
- this.x = dart.as(_truncate(x), core.int);
- this.y = dart.as(_truncate(y), core.int);
- this.z = dart.as(_truncate(z), core.int);
- this.w = dart.as(_truncate(w), core.int);
- if (x !== this.x && dart.notNull(!(typeof x == number)))
- throw new core.ArgumentError(x);
- if (y !== this.y && dart.notNull(!(typeof y == number)))
- throw new core.ArgumentError(y);
- if (z !== this.z && dart.notNull(!(typeof z == number)))
- throw new core.ArgumentError(z);
- if (w !== this.w && dart.notNull(!(typeof w == number)))
- throw new core.ArgumentError(w);
- }
- NativeInt32x4$bool(x, y, z, w) {
- this.x = x ? -1 : 0;
- this.y = y ? -1 : 0;
- this.z = z ? -1 : 0;
- this.w = w ? -1 : 0;
- }
- NativeInt32x4$fromFloat32x4Bits(f) {
- let floatList = NativeFloat32x4[_list];
- floatList.set(0, f.x);
- floatList.set(1, f.y);
- floatList.set(2, f.z);
- floatList.set(3, f.w);
- let view = dart.as(floatList.buffer.asInt32List(), NativeInt32List);
- return new NativeInt32x4._truncated(view.get(0), view.get(1), view.get(2), view.get(3));
- }
- NativeInt32x4$_truncated(x, y, z, w) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
- toString() {
- return `[${this.x}, ${this.y}, ${this.z}, ${this.w}]`;
- }
- ['|'](other) {
- return new NativeInt32x4._truncated(this.x | other.x, this.y | other.y, this.z | other.z, this.w | other.w);
- }
- ['&'](other) {
- return new NativeInt32x4._truncated(this.x & other.x, this.y & other.y, this.z & other.z, this.w & other.w);
- }
- ['^'](other) {
- return new NativeInt32x4._truncated(this.x ^ other.x, this.y ^ other.y, this.z ^ other.z, this.w ^ other.w);
- }
- ['+'](other) {
- return new NativeInt32x4._truncated(this.x + other.x | 0, this.y + other.y | 0, this.z + other.z | 0, this.w + other.w | 0);
- }
- ['-'](other) {
- return new NativeInt32x4._truncated(this.x - other.x | 0, this.y - other.y | 0, this.z - other.z | 0, this.w - other.w | 0);
- }
- ['-']() {
- return new NativeInt32x4._truncated(-this.x | 0, -this.y | 0, -this.z | 0, -this.w | 0);
- }
- get signMask() {
- let mx = (dart.notNull(this.x) & 2147483648) >> 31;
- let my = (dart.notNull(this.y) & 2147483648) >> 31;
- let mz = (dart.notNull(this.z) & 2147483648) >> 31;
- let mw = (dart.notNull(this.w) & 2147483648) >> 31;
- return dart.notNull(mx) | dart.notNull(my) << 1 | dart.notNull(mz) << 2 | dart.notNull(mw) << 3;
- }
- shuffle(mask) {
- if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
- throw new core.RangeError(`mask ${mask} must be in the range [0..256)`);
- }
- _list.set(0, this.x);
- _list.set(1, this.y);
- _list.set(2, this.z);
- _list.set(3, this.w);
- let _x = _list.get(dart.notNull(mask) & 3);
- let _y = _list.get(dart.notNull(mask) >> 2 & 3);
- let _z = _list.get(dart.notNull(mask) >> 4 & 3);
- let _w = _list.get(dart.notNull(mask) >> 6 & 3);
- return new NativeInt32x4._truncated(_x, _y, _z, _w);
- }
- shuffleMix(other, mask) {
- if (dart.notNull(mask) < 0 || dart.notNull(mask) > 255) {
- throw new core.RangeError(`mask ${mask} must be in the range [0..256)`);
- }
- _list.set(0, this.x);
- _list.set(1, this.y);
- _list.set(2, this.z);
- _list.set(3, this.w);
- let _x = _list.get(dart.notNull(mask) & 3);
- let _y = _list.get(dart.notNull(mask) >> 2 & 3);
- _list.set(0, other.x);
- _list.set(1, other.y);
- _list.set(2, other.z);
- _list.set(3, other.w);
- let _z = _list.get(dart.notNull(mask) >> 4 & 3);
- let _w = _list.get(dart.notNull(mask) >> 6 & 3);
- return new NativeInt32x4._truncated(_x, _y, _z, _w);
- }
- withX(x) {
- let _x = dart.as(_truncate(x), core.int);
- return new NativeInt32x4._truncated(_x, this.y, this.z, this.w);
- }
- withY(y) {
- let _y = dart.as(_truncate(y), core.int);
- return new NativeInt32x4._truncated(this.x, _y, this.z, this.w);
- }
- withZ(z) {
- let _z = dart.as(_truncate(z), core.int);
- return new NativeInt32x4._truncated(this.x, this.y, _z, this.w);
- }
- withW(w) {
- let _w = dart.as(_truncate(w), core.int);
- return new NativeInt32x4._truncated(this.x, this.y, this.z, _w);
- }
- get flagX() {
- return this.x !== 0;
- }
- get flagY() {
- return this.y !== 0;
- }
- get flagZ() {
- return this.z !== 0;
- }
- get flagW() {
- return this.w !== 0;
- }
- withFlagX(flagX) {
- let _x = flagX ? -1 : 0;
- return new NativeInt32x4._truncated(_x, this.y, this.z, this.w);
- }
- withFlagY(flagY) {
- let _y = flagY ? -1 : 0;
- return new NativeInt32x4._truncated(this.x, _y, this.z, this.w);
- }
- withFlagZ(flagZ) {
- let _z = flagZ ? -1 : 0;
- return new NativeInt32x4._truncated(this.x, this.y, _z, this.w);
- }
- withFlagW(flagW) {
- let _w = flagW ? -1 : 0;
- return new NativeInt32x4._truncated(this.x, this.y, this.z, _w);
- }
- select(trueValue, falseValue) {
- let floatList = NativeFloat32x4[_list];
- let intView = NativeFloat32x4[_uint32view];
- floatList.set(0, trueValue.x);
- floatList.set(1, trueValue.y);
- floatList.set(2, trueValue.z);
- floatList.set(3, trueValue.w);
- let stx = intView.get(0);
- let sty = intView.get(1);
- let stz = intView.get(2);
- let stw = intView.get(3);
- floatList.set(0, falseValue.x);
- floatList.set(1, falseValue.y);
- floatList.set(2, falseValue.z);
- floatList.set(3, falseValue.w);
- let sfx = intView.get(0);
- let sfy = intView.get(1);
- let sfz = intView.get(2);
- let sfw = intView.get(3);
- let _x = dart.notNull(this.x) & dart.notNull(stx) | ~dart.notNull(this.x) & dart.notNull(sfx);
- let _y = dart.notNull(this.y) & dart.notNull(sty) | ~dart.notNull(this.y) & dart.notNull(sfy);
- let _z = dart.notNull(this.z) & dart.notNull(stz) | ~dart.notNull(this.z) & dart.notNull(sfz);
- let _w = dart.notNull(this.w) & dart.notNull(stw) | ~dart.notNull(this.w) & dart.notNull(sfw);
- intView.set(0, _x);
- intView.set(1, _y);
- intView.set(2, _z);
- intView.set(3, _w);
- return new NativeFloat32x4._truncated(floatList.get(0), floatList.get(1), floatList.get(2), floatList.get(3));
- }
- }
- dart.defineNamedConstructor(NativeInt32x4, 'bool');
- dart.defineNamedConstructor(NativeInt32x4, 'fromFloat32x4Bits');
- dart.defineNamedConstructor(NativeInt32x4, '_truncated');
- dart.defineLazyProperties(NativeInt32x4, {
- get _list() {
- return new NativeInt32List(4);
- }
- });
- class NativeFloat64x2 extends core.Object {
- NativeFloat64x2(x, y) {
- this.x = x;
- this.y = y;
- if (!dart.is(this.x, core.num))
- throw new core.ArgumentError(this.x);
- if (!dart.is(this.y, core.num))
- throw new core.ArgumentError(this.y);
- }
- NativeFloat64x2$splat(v) {
- this.NativeFloat64x2(v, v);
- }
- NativeFloat64x2$zero() {
- this.NativeFloat64x2$splat(0.0);
- }
- NativeFloat64x2$fromFloat32x4(v) {
- this.NativeFloat64x2(v.x, v.y);
- }
- NativeFloat64x2$_doubles(x, y) {
- this.x = x;
- this.y = y;
- }
- toString() {
- return `[${this.x}, ${this.y}]`;
- }
- ['+'](other) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) + dart.notNull(other.x), dart.notNull(this.y) + dart.notNull(other.y));
- }
- ['-']() {
- return new NativeFloat64x2._doubles(-dart.notNull(this.x), -dart.notNull(this.y));
- }
- ['-'](other) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) - dart.notNull(other.x), dart.notNull(this.y) - dart.notNull(other.y));
- }
- ['*'](other) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) * dart.notNull(other.x), dart.notNull(this.y) * dart.notNull(other.y));
- }
- ['/'](other) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) / dart.notNull(other.x), dart.notNull(this.y) / dart.notNull(other.y));
- }
- scale(s) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) * dart.notNull(s), dart.notNull(this.y) * dart.notNull(s));
- }
- abs() {
- return new NativeFloat64x2._doubles(this.x.abs(), this.y.abs());
- }
- clamp(lowerLimit, upperLimit) {
- let _lx = lowerLimit.x;
- let _ly = lowerLimit.y;
- let _ux = upperLimit.x;
- let _uy = upperLimit.y;
- let _x = this.x;
- let _y = this.y;
- _x = dart.notNull(_x) > dart.notNull(_ux) ? _ux : _x;
- _y = dart.notNull(_y) > dart.notNull(_uy) ? _uy : _y;
- _x = dart.notNull(_x) < dart.notNull(_lx) ? _lx : _x;
- _y = dart.notNull(_y) < dart.notNull(_ly) ? _ly : _y;
- return new NativeFloat64x2._doubles(_x, _y);
- }
- get signMask() {
- let view = _uint32View;
- _list.set(0, this.x);
- _list.set(1, this.y);
- let mx = (dart.notNull(view.get(1)) & 2147483648) >> 31;
- let my = (dart.notNull(view.get(3)) & 2147483648) >> 31;
- return dart.notNull(mx) | dart.notNull(my) << 1;
- }
- withX(x) {
- if (!dart.is(x, core.num))
- throw new core.ArgumentError(x);
- return new NativeFloat64x2._doubles(x, this.y);
- }
- withY(y) {
- if (!dart.is(y, core.num))
- throw new core.ArgumentError(y);
- return new NativeFloat64x2._doubles(this.x, y);
- }
- min(other) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) < dart.notNull(other.x) ? this.x : other.x, dart.notNull(this.y) < dart.notNull(other.y) ? this.y : other.y);
- }
- max(other) {
- return new NativeFloat64x2._doubles(dart.notNull(this.x) > dart.notNull(other.x) ? this.x : other.x, dart.notNull(this.y) > dart.notNull(other.y) ? this.y : other.y);
- }
- sqrt() {
- return new NativeFloat64x2._doubles(Math.sqrt(this.x), Math.sqrt(this.y));
- }
- }
- dart.defineNamedConstructor(NativeFloat64x2, 'splat');
- dart.defineNamedConstructor(NativeFloat64x2, 'zero');
- dart.defineNamedConstructor(NativeFloat64x2, 'fromFloat32x4');
- dart.defineNamedConstructor(NativeFloat64x2, '_doubles');
- dart.defineLazyProperties(NativeFloat64x2, {
- get _list() {
- return new NativeFloat64List(2);
- },
- set _list(_) {},
- get _uint32View() {
- return dart.as(_list.buffer.asUint32List(), NativeUint32List);
- },
- set _uint32View(_) {}
- });
- // Exports:
- exports.NativeByteBuffer = NativeByteBuffer;
- exports.NativeFloat32x4List = NativeFloat32x4List;
- exports.NativeInt32x4List = NativeInt32x4List;
- exports.NativeFloat64x2List = NativeFloat64x2List;
- exports.NativeTypedData = NativeTypedData;
- exports.NativeByteData = NativeByteData;
- exports.NativeTypedArray = NativeTypedArray;
- exports.NativeTypedArrayOfDouble = NativeTypedArrayOfDouble;
- exports.NativeTypedArrayOfInt = NativeTypedArrayOfInt;
- exports.NativeFloat32List = NativeFloat32List;
- exports.NativeFloat64List = NativeFloat64List;
- exports.NativeInt16List = NativeInt16List;
- exports.NativeInt32List = NativeInt32List;
- exports.NativeInt8List = NativeInt8List;
- exports.NativeUint16List = NativeUint16List;
- exports.NativeUint32List = NativeUint32List;
- exports.NativeUint8ClampedList = NativeUint8ClampedList;
- exports.NativeUint8List = NativeUint8List;
- exports.NativeFloat32x4 = NativeFloat32x4;
- exports.NativeInt32x4 = NativeInt32x4;
- exports.NativeFloat64x2 = NativeFloat64x2;
-})(_native_typed_data || (_native_typed_data = {}));
« no previous file with comments | « test/codegen/expect/dart/_js_primitives.js ('k') | test/codegen/expect/dart/async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698