Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-standard ownProperty length on AsyncGenerator and AsyncFunctionPrototype #181

Open
leotm opened this issue Mar 14, 2023 · 0 comments
Open

Comments

@leotm
Copy link

leotm commented Mar 14, 2023

Issue Description

In android-jsc we're adding non-standard ownProperty length
On our AsyncGenerator (shown below) and AsyncFunctionPrototype

Reflect.ownKeys(AsyncGenerator) on iOS

["constructor", "prototype", Symbol(Symbol.toStringTag)]

Other engines (like android-v8 when remote debugging) don't add the length property too

Reflect.ownKeys(AsyncGenerator) on Android

["length", "constructor", "prototype", Symbol(Symbol.toStringTag)]

This only happens on Android, which is against the ECMAScript standard

WebKitGTK everywhere else isn't adding our length property here ^

Repro

grab.cjs

module.exports = function grab() {
  async function* AsyncGeneratorFunctionInstance() {}
  const AsyncGeneratorFunction = Object.getPrototypeOf(
    AsyncGeneratorFunctionInstance,
  ).constructor;

  const AsyncGenerator = AsyncGeneratorFunction.prototype;

  return Reflect.ownKeys(AsyncGenerator);
};

.babelignore

grab.cjs

index.js

import grab from './grab.cjs';

console.log(grab());

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);

Version, config, any additional info

RN 0.66.5, so default "jsc-android": "^250231.0.0" (WebKitGTK 2.26.1)
RN 0.66.5, iOS default

Not yet tested on later versions

@leotm leotm changed the title Non-standard ownProperty length on AsyncGenerator and AsyncFunctionPrototype only on jsc-android Non-standard ownProperty length on AsyncGenerator and AsyncFunctionPrototype Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant