WARN Removing intrinsics.%AsyncGenerator%.length
ERROR failed to delete intrinsics.%AsyncGenerator%.length [TypeError: Unable to delete property.]
ERROR TypeError: Unable to delete property.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Android emu: screenshot, then tapping empty white view
ERROR Invariant Violation: Module RCTEventEmitter is not a registered callable module (calling receiveTouches). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
And applying the return _ref.apply(this, arguments); (Out) transform
Since disabling it persists the error (and further disabling Babel plugins w/o breaking React Native)
metro-react-native-babel-preset@0.66.2 ❌ (default)
metro-react-native-babel-preset@0.75.1 ❌ (bumped)
nb: can't bump to 0.76 since this requires Node v16 instead of Node v14 and we're on RN 0.66.5
our %AsyncGenerator% exists since it works i.e. we have desired output and it's correctour length descriptor (inherited prop fn from Function.prototype) exists and is configurable, so SES should be able to delete it during lockdown
lockdown.umd.js test (instead of importing ses)
Result
WARN Removing intrinsics.%AsyncFunctionPrototype%.length
ERROR failed to delete intrinsics.%AsyncFunctionPrototype%.length [TypeError: Unable to delete property.]
But ofc this isn't the right path, but we've got another problem 👆 AsyncFunctionPrototype
WARN Removing intrinsics.%AsyncGenerator%.length
LOG {"obj": {}}
LOG {"prop": "length"}
LOG obj[prop] 0
ERROR failed to delete intrinsics.%AsyncGenerator%.length [TypeError: Unable to delete property.]
ERROR TypeError: Unable to delete property.
Why when we call lockdown with android-jsc (WebKitGTK) our %AsyncGenerator%obj doesn't exist (to delete it's props), but it works w/o calling lockdown 🤔
Follow-up to
As seen in
No error on iOS jsc
No error on Android v8
Android emu: screenshot, then tapping empty white view
Bundle: http://localhost:8081/index.bundle?platform=android
es2018.asyncgenerator https://tc39.es/proposal-async-iteration/#sec-well-known-intrinsic-objects-patch https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator https://github.com/tc39/proposal-async-iteration#async-generator-functions
Our AsyncGenerator is defined in our whitelist.js
More: https://github.com/search?q=repo%3Aendojs%2Fendo%20%25AsyncGenerator%25&type=code
With methods:
AsyncGenerator.prototype.(next|return|throw)
Inheriting prop functions:
Function.prototype.(length|name|prototype)
(error failing to deletetheseone or more of these props)Disabling
@babel/plugin-proposal-async-generator-functions
is a red herring, despite being required and pushed in our default preset:And applying the
return _ref.apply(this, arguments);
(Out) transform Since disabling it persists the error (and further disabling Babel plugins w/o breaking React Native)metro-react-native-babel-preset@0.66.2 ❌ (default) metro-react-native-babel-preset@0.75.1 ❌ (bumped) nb: can't bump to 0.76 since this requires Node v16 instead of Node v14 and we're on RN 0.66.5
"@babel/core": "^7.12.9" ❌ (default) "@babel/core": "7.21.0" ❌ (bumped)
"@babel/runtime": "^7.12.5" ❌ (default) "@babel/runtime": "7.21.0" ❌ (bumped)
metro-react-native-babel-preset applies no Android/iOS/jsc/v8-specific transforms (only on Hermes)
It doesn't appear to be Babel transforming android-jsc differently to iOS jsc and/or android-v8
Patch
react-native
to use "jsc-android": "294992.0.0" (WebKitGTK 2.36.3) instead of default "jsc-android": "^250231.0.0" (WebKitGTK 2.26.1) ❌Test w/o lockdown
brave/chrome-v8
RN v8-android
RN android-jsc (not-so-expandable logs output to Metro terminal window)
our
%AsyncGenerator%
exists since it works i.e. we have desired output and it's correct ourlength
descriptor (inherited prop fn fromFunction.prototype
) exists and is configurable, so SES should be able todelete
it duringlockdown
lockdown.umd.js
test (instead of importingses
)Result
But ofc this isn't the right path, but we've got another problem 👆 AsyncFunctionPrototype
Delete snippet of lockdown below
Adding logs
Why when we call
lockdown
with android-jsc (WebKitGTK) our%AsyncGenerator%
obj doesn't exist (to delete it's props), but it works w/o callinglockdown
🤔V8
After further debugging, issue raised here
No console output in Metro bundler
Android emu: screenshot (OCR'ed to text below)
Current/only vanilla RN 0.66.5 blocker before metamask-mobile integration