Skip to content

Commit 8987330

Browse files
committed
hermes: class syntax is not supported
1 parent 5a34d86 commit 8987330

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

test-app/app/src/main/assets/internal/ts_helpers.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if (Parent.__isPrototypeImplementationObject) {
6464
throw new Error("Can not extend an already extended native object.");
6565
}
66-
66+
6767
function extend(thiz) {
6868
var child = thiz.__proto__.__child;
6969
if (!child.__extended) {
@@ -204,7 +204,7 @@
204204
}
205205

206206
global.setNativeArrayProp = (target, prop, value, receiver) => {
207-
if (typeof prop !== "symbol" && !isNaN(prop)) {
207+
if (typeof prop !== "symbol" && !isNaN(prop)) {
208208
receiver.setValueAtIndex(parseInt(prop), value);
209209
return true;
210210
}
@@ -218,7 +218,7 @@
218218
}
219219

220220
if (prop === Symbol.iterator) {
221-
let index = 0;
221+
var index = 0;
222222
const l = target.length;
223223
return function () {
224224
return {
@@ -240,7 +240,7 @@
240240
const values = receiver.getAllValues();
241241
const result = [];
242242
const l = target.length;
243-
for (let i = 0; i < l; i++) {
243+
for (var i = 0; i < l; i++) {
244244
result.push(callback(values[i], i, target));
245245
}
246246
return result;
@@ -258,7 +258,7 @@
258258
return function (callback) {
259259
const values = receiver.getAllValues();
260260
const l = values.length;
261-
for (let i = 0; i < l; i++) {
261+
for (var i = 0; i < l; i++) {
262262
callback(values[i], i, target);
263263
}
264264
};
@@ -351,7 +351,7 @@
351351
URL.revokeObjectURL = function (url) {
352352
BLOB_STORE.delete(url);
353353
};
354-
const InternalAccessor = class {};
354+
function InternalAccessor() {}
355355
InternalAccessor.getData = function (url) {
356356
return BLOB_STORE.get(url);
357357
};

test-app/runtime/src/main/cpp/napi/hermes/jsr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ napi_status js_execute_pending_jobs(napi_env env) {
110110
itFound->second->rt->drainMicrotasks();
111111
return napi_ok;
112112
#else
113+
bool result;
113114
return jsr_drain_microtasks(env, 0, &result);
114115
#endif
115-
116-
117116
}
118117

119118
napi_status js_get_engine_ptr(napi_env env, int64_t *engine_ptr) {

0 commit comments

Comments
 (0)