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

unsupport to use Object.defineProperty to change the 'name' of a function. #19674

Closed
fishmwei opened this issue Jun 12, 2018 · 6 comments
Closed
Labels
Bug JavaScript Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@fishmwei
Copy link

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 8.4.0
Yarn: 1.3.2
npm: 6.0.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Description

Cannot change the name of anonymous function; like this:

function _genSynMethod(moduleName, methodName) {
    return Object.defineProperty(
        function () {
           ... 
           }, 'name', {value:methodName}) ;
}

Steps to Reproduce

just call function _genSynMethod

Expected Behavior

running normal , just like iOS.

Actual Behavior

2

@react-native-bot react-native-bot added the Platform: Android Android applications. label Jun 12, 2018
@timwangdev timwangdev changed the title 【Android】Attempting to change value of a readonly property. [Android] Attempting to change value of a readonly property. Jun 13, 2018
@fishmwei
Copy link
Author

@hramos
Android does not support to use Object.defineProperty to change the 'name' of a function.

@fishmwei fishmwei changed the title [Android] Attempting to change value of a readonly property. 【Android】unsupport to use Object.defineProperty to change the 'name' of a function. Jun 13, 2018
@stale
Copy link

stale bot commented Sep 11, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 11, 2018
@fishmwei
Copy link
Author

For Discussion

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 12, 2018
@stale
Copy link

stale bot commented Dec 11, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 11, 2018
@hramos hramos changed the title 【Android】unsupport to use Object.defineProperty to change the 'name' of a function. unsupport to use Object.defineProperty to change the 'name' of a function. Dec 14, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 14, 2018
@hramos
Copy link
Contributor

hramos commented Dec 14, 2018

This will likely be fixed once we move on from the old JSC used in Android: #19737

@hramos
Copy link
Contributor

hramos commented Mar 14, 2019

0.59 is now out. If anyone happens to verify this on 0.59 and it's still an issue, please let us know.

@hramos hramos closed this as completed Mar 14, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 14, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug JavaScript Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants