@nativescript/android 8.9.0-napi-v8.5 → 8.9.0-napi-v8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,193 +1,272 @@
1
1
  (function () {
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length;
4
- var r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
-
6
- if (typeof global.Reflect === "object" && typeof global.Reflect.decorate === "function") {
7
- r = global.Reflect.decorate(decorators, target, key, desc);
8
- }
9
- else {
10
- for (var i = decorators.length - 1; i >= 0; i--) {
11
- if (d = decorators[i]) {
12
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
- }
14
- }
15
- }
16
- return c > 3 && r && Object.defineProperty(target, key, r), r;
17
- };
18
-
19
- // For backward compatibility.
20
- var __native = function (thiz) {
21
- // we are setting the __container__ property to the base class when the super method is called
22
- // if the constructor returns the __native(this) call we will use the old implementation
23
- // copying all the properties to the result
24
- // otherwise if we are using the result from the super() method call we won't need such logic
25
- // as thiz already contains the parent properties
26
- // this way we now support both implementations in typescript generated constructors:
27
- // 1: super(); return __native(this);
28
- // 2: return super() || this;
29
- // if (thiz.__container__) {
30
- // var result = thiz.__proto__;
31
- //
32
- // for (var prop in thiz) {
33
- // if (thiz.hasOwnProperty(prop)) {
34
- // thiz.__proto__[prop] = thiz[prop];
35
- // delete thiz[prop];
36
- // }
37
- // }
38
- //
39
- // thiz.constructor = undefined;
40
- // thiz.__proto__ = undefined;
41
- // Object.freeze(thiz);
42
- // Object.preventExtensions(thiz);
43
- // return result;
44
- // } else {
45
- return thiz;
46
- // }
47
- };
48
-
49
- var __extends = function (Child, Parent) {
50
- var extendNativeClass = !!Parent.extend && (Parent.extend.toString().indexOf("[native code]") > -1);
51
- if (!extendNativeClass) {
52
- __extends_ts(Child, Parent);
53
- return;
54
- }
55
- if (Parent.__isPrototypeImplementationObject) {
56
- throw new Error("Can not extend an already extended native object.");
57
- }
58
-
59
- function extend(thiz) {
60
- var child = thiz.__proto__.__child;
61
- if (!child.__extended) {
62
- var parent = thiz.__proto__.__parent;
63
- child.__extended = parent.extend(child.name, child.prototype, true);
64
- // This will deal with "i instanceof child"
65
- child[Symbol.hasInstance] = function (instance) {
66
- return instance instanceof this.__extended;
67
- }
68
- }
69
- return child.__extended;
70
- };
71
-
72
- Parent.__activityExtend = function (parent, name, implementationObject) {
73
- __log("__activityExtend called");
74
- return parent.extend(name, implementationObject);
75
- };
76
-
77
- Parent.call = function (thiz) {
78
- var Extended = extend(thiz);
79
- thiz.__container__ = true;
80
- if (arguments.length > 1) {
81
- if (typeof Extended !== "function") {
82
- thiz.__proto__ = Reflect.construct(Extended, Array.prototype.slice.call(arguments, 1));
83
- } else {
84
- thiz.__proto__ = new (Function.prototype.bind.apply(Extended, [null].concat(Array.prototype.slice.call(arguments, 1))));
85
- }
86
- }
87
- else {
88
- thiz.__proto__ = new Extended()
89
- }
90
- return thiz;
91
- };
92
-
93
- Parent.apply = function (thiz, args) {
94
- var Extended = extend(thiz);
95
- thiz.__container__ = true;
96
- if (args && args.length > 0) {
97
- thiz.__proto__ = new (Function.prototype.bind.apply(Extended, [null].concat(args)));
98
- }
99
- else {
100
- thiz.__proto__ = new Extended();
101
- }
102
- return thiz;
103
- };
104
- __extends_ns(Child, Parent);
105
- Child.__isPrototypeImplementationObject = true;
106
- Child.__proto__ = Parent;
107
- Child.prototype.__parent = Parent;
108
- Child.prototype.__child = Child;
109
- }
110
-
111
- var __extends_ts = function (child, parent) {
112
- extendStaticFunctions(child, parent);
113
- assignPrototypeFromParentToChild(parent, child);
114
- };
115
-
116
- var __extends_ns = function (child, parent) {
117
- if (!parent.extend) {
118
- assignPropertiesFromParentToChild(parent, child);
119
- }
120
-
121
- assignPrototypeFromParentToChild(parent, child);
122
- };
123
-
124
- var extendStaticFunctions =
125
- Object.setPrototypeOf
126
- || (hasInternalProtoProperty() && function (child, parent) { child.__proto__ = parent; })
127
- || assignPropertiesFromParentToChild;
128
-
129
- function hasInternalProtoProperty() {
130
- return { __proto__: [] } instanceof Array;
131
- }
132
-
133
- function assignPropertiesFromParentToChild(parent, child) {
134
- for (var property in parent) {
135
- if (parent.hasOwnProperty(property)) {
136
- child[property] = parent[property];
137
- }
138
- }
139
- }
140
-
141
- function assignPrototypeFromParentToChild(parent, child) {
142
- function __() {
143
- this.constructor = child;
144
- }
145
-
146
- if (parent === null) {
147
- child.prototype = Object.create(null);
148
- } else {
149
- __.prototype = parent.prototype;
150
- child.prototype = new __();
151
- }
152
- }
153
-
154
-
155
- function JavaProxy(className) {
156
- return function (target) {
157
- var extended = target.extend(className, target.prototype)
158
- extended.name = className;
159
- return extended;
160
- };
161
- }
162
-
163
- function Interfaces(interfacesArr) {
164
- return function (target) {
165
- if (interfacesArr instanceof Array) {
166
- // attach interfaces: [] to the object
167
- target.prototype.interfaces = interfacesArr;
168
- }
169
- }
170
- }
171
-
172
- Object.defineProperty(global, "__native", { value: __native });
173
- Object.defineProperty(global, "__extends", { value: __extends });
174
- Object.defineProperty(global, "__decorate", { value: __decorate });
175
-
176
- if (!global.__ns__worker) {
177
- global.JavaProxy = JavaProxy;
178
- }
179
- global.Interfaces = Interfaces;
180
-
181
- if (global.WeakRef && !global.WeakRef.prototype.get) {
182
- global.WeakRef.prototype.get = global.WeakRef.prototype.deref;
183
- }
184
-
2
+ var __decorate =
3
+ (this && this.__decorate) ||
4
+ function (decorators, target, key, desc) {
5
+ var c = arguments.length;
6
+ var r =
7
+ c < 3
8
+ ? target
9
+ : desc === null
10
+ ? (desc = Object.getOwnPropertyDescriptor(target, key))
11
+ : desc,
12
+ d;
13
+
14
+ if (
15
+ typeof global.Reflect === "object" &&
16
+ typeof global.Reflect.decorate === "function"
17
+ ) {
18
+ r = global.Reflect.decorate(decorators, target, key, desc);
19
+ } else {
20
+ for (var i = decorators.length - 1; i >= 0; i--) {
21
+ if ((d = decorators[i])) {
22
+ r =
23
+ (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
+ }
25
+ }
26
+ }
27
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
28
+ };
29
+
30
+ // For backward compatibility.
31
+ var __native = function (thiz) {
32
+ // we are setting the __container__ property to the base class when the super method is called
33
+ // if the constructor returns the __native(this) call we will use the old implementation
34
+ // copying all the properties to the result
35
+ // otherwise if we are using the result from the super() method call we won't need such logic
36
+ // as thiz already contains the parent properties
37
+ // this way we now support both implementations in typescript generated constructors:
38
+ // 1: super(); return __native(this);
39
+ // 2: return super() || this;
40
+ // if (thiz.__container__) {
41
+ // if (__useHostObjects) {
42
+ // for (var prop in thiz) {
43
+ // if (thiz.hasOwnProperty(prop)) {
44
+ // thiz.__proto__[prop] = thiz[prop];
45
+ // delete thiz[prop];
46
+ // }
47
+ // }
48
+ // }
49
+
50
+ return thiz;
51
+ // } else {
52
+ // return thiz;
53
+ // }
54
+ };
55
+
56
+ var __extends = function (Child, Parent) {
57
+ var extendNativeClass =
58
+ !!Parent.extend && Parent.extend.toString().indexOf("[native code]") > -1;
59
+ if (!extendNativeClass) {
60
+ __extends_ts(Child, Parent);
61
+ return;
62
+ }
63
+ if (Parent.__isPrototypeImplementationObject) {
64
+ throw new Error("Can not extend an already extended native object.");
65
+ }
66
+
67
+ function extend(thiz) {
68
+ var child = thiz.__proto__.__child;
69
+ if (!child.__extended) {
70
+ var parent = thiz.__proto__.__parent;
71
+ child.__extended = parent.extend(child.name, child.prototype, true);
72
+ // This will deal with "i instanceof child"
73
+ child[Symbol.hasInstance] = function (instance) {
74
+ return instance instanceof this.__extended;
75
+ };
76
+ }
77
+ return child.__extended;
78
+ }
79
+
80
+ Parent.__activityExtend = function (parent, name, implementationObject) {
81
+ __log("__activityExtend called");
82
+ return parent.extend(name, implementationObject);
83
+ };
84
+
85
+ Parent.call = function (thiz) {
86
+ var Extended = extend(thiz);
87
+ thiz.__container__ = true;
88
+ if (arguments.length > 1) {
89
+ if (typeof Extended !== "function") {
90
+ thiz = Reflect.construct(
91
+ Extended,
92
+ Array.prototype.slice.call(arguments, 1)
93
+ );
94
+ } else {
95
+ thiz = new (Function.prototype.bind.apply(
96
+ Extended,
97
+ [null].concat(Array.prototype.slice.call(arguments, 1))
98
+ ))();
99
+ }
100
+ } else {
101
+ thiz = new Extended();
102
+ }
103
+ return thiz;
104
+ };
105
+
106
+ Parent.apply = function (thiz, args) {
107
+ var Extended = extend(thiz);
108
+ thiz.__container__ = true;
109
+ if (args && args.length > 0) {
110
+ thiz = new (Function.prototype.bind.apply(
111
+ Extended,
112
+ [null].concat(args)
113
+ ))();
114
+ } else {
115
+ thiz = new Extended();
116
+ }
117
+ return thiz;
118
+ };
119
+ __extends_ns(Child, Parent);
120
+ Child.__isPrototypeImplementationObject = true;
121
+ Child.__proto__ = Parent;
122
+ Child.prototype.__parent = Parent;
123
+ Child.prototype.__child = Child;
124
+ };
125
+
126
+ var __extends_ts = function (child, parent) {
127
+ extendStaticFunctions(child, parent);
128
+ assignPrototypeFromParentToChild(parent, child);
129
+ };
130
+
131
+ var __extends_ns = function (child, parent) {
132
+ if (!parent.extend) {
133
+ assignPropertiesFromParentToChild(parent, child);
134
+ }
135
+
136
+ assignPrototypeFromParentToChild(parent, child);
137
+ };
138
+
139
+ var extendStaticFunctions =
140
+ Object.setPrototypeOf ||
141
+ (hasInternalProtoProperty() &&
142
+ function (child, parent) {
143
+ child.__proto__ = parent;
144
+ }) ||
145
+ assignPropertiesFromParentToChild;
146
+
147
+ function hasInternalProtoProperty() {
148
+ return { __proto__: [] } instanceof Array;
149
+ }
150
+
151
+ function assignPropertiesFromParentToChild(parent, child) {
152
+ for (var property in parent) {
153
+ if (parent.hasOwnProperty(property)) {
154
+ child[property] = parent[property];
155
+ }
156
+ }
157
+ }
158
+
159
+ function assignPrototypeFromParentToChild(parent, child) {
160
+ function __() {
161
+ this.constructor = child;
162
+ }
163
+
164
+ if (parent === null) {
165
+ child.prototype = Object.create(null);
166
+ } else {
167
+ __.prototype = parent.prototype;
168
+ child.prototype = new __();
169
+ }
170
+ }
171
+
172
+ function JavaProxy(className) {
173
+ return function (target) {
174
+ var extended = target.extend(className, target.prototype);
175
+ extended.name = className;
176
+ return extended;
177
+ };
178
+ }
179
+
180
+ function Interfaces(interfacesArr) {
181
+ return function (target) {
182
+ if (interfacesArr instanceof Array) {
183
+ // attach interfaces: [] to the object
184
+ target.prototype.interfaces = interfacesArr;
185
+ }
186
+ };
187
+ }
188
+
189
+ Object.defineProperty(global, "__native", { value: __native });
190
+ Object.defineProperty(global, "__extends", { value: __extends });
191
+ Object.defineProperty(global, "__decorate", { value: __decorate });
192
+
193
+ if (!global.__ns__worker) {
194
+ global.JavaProxy = JavaProxy;
195
+ }
196
+ global.Interfaces = Interfaces;
197
+
198
+ if (global.WeakRef && !global.WeakRef.prototype.get) {
199
+ global.WeakRef.prototype.get = global.WeakRef.prototype.deref;
200
+ }
201
+
202
+ global.setNativeArrayProp = (target, prop, value, receiver) => {
203
+ if (!isNaN(prop)) {
204
+ receiver.setValueAtIndex(parseInt(prop), value);
205
+ return true;
206
+ }
207
+ target[prop] = value;
208
+ return true;
209
+ };
210
+
211
+ global.getNativeArrayProp = (target, prop, receiver) => {
212
+ if (!isNaN(prop)) {
213
+ return receiver.getValueAtIndex(parseInt(prop));
214
+ }
215
+
216
+ if (prop === Symbol.iterator) {
217
+ let index = 0;
218
+ const l = target.length;
219
+ return function () {
220
+ return {
221
+ next: function () {
222
+ if (index < l) {
223
+ return {
224
+ value: receiver.getValueAtIndex(index++),
225
+ done: false,
226
+ };
227
+ } else {
228
+ return { done: true };
229
+ }
230
+ },
231
+ };
232
+ };
233
+ }
234
+ if (prop === "map") {
235
+ return function (callback) {
236
+ const values = receiver.getAllValues();
237
+ const result = [];
238
+ const l = target.length;
239
+ for (let i = 0; i < l; i++) {
240
+ result.push(callback(values[i], i, target));
241
+ }
242
+ return result;
243
+ };
244
+ }
245
+
246
+ if (prop === "toString") {
247
+ return function () {
248
+ const result = receiver.getAllValues();
249
+ return result.join(",");
250
+ };
251
+ }
252
+
253
+ if (prop === "forEach") {
254
+ return function (callback) {
255
+ const values = receiver.getAllValues();
256
+ const l = values.length;
257
+ for (let i = 0; i < l; i++) {
258
+ callback(values[i], i, target);
259
+ }
260
+ };
261
+ }
262
+ return target[prop];
263
+ };
185
264
  })();
186
265
  globalThis.getErrorStack = (err) => {
187
- if (err) return err.stack;
188
- const stack = new Error("").stack;
189
- const lines = stack.split("\n");
190
- // Line 2 results in invalid stack if not replaced when doing typescript extend.
191
- lines[2] = " at extend(native)";
192
- return lines.join("\n");
193
- }
266
+ if (err) return err.stack;
267
+ const stack = new Error("").stack;
268
+ const lines = stack.split("\n");
269
+ // Line 2 results in invalid stack if not replaced when doing typescript extend.
270
+ lines[2] = " at extend(native)";
271
+ return lines.join("\n");
272
+ };
@@ -1,4 +1,4 @@
1
- #Thu, 13 Feb 2025 09:56:10 -0800
1
+ #Sun, 16 Feb 2025 09:10:30 -0800
2
2
  # Project-wide Gradle settings.
3
3
 
4
4
  # IDE (e.g. Android Studio) users:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nativescript/android",
3
3
  "description": "NativeScript for Android using Node-API",
4
- "version": "8.9.0-napi-v8.5",
4
+ "version": "8.9.0-napi-v8.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/NativeScript/android.git"