Skip to content

undefined is not an object (evaluating hasOwnProperty.call(it, key)) when accessing global object with Symbol #22974

@thiagoh

Description

@thiagoh

Environment

Environment:
OS: macOS High Sierra 10.13.6
Node: 8.11.2
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.2 AI-181.5540.7.32.5056338

Packages: (wanted => installed)
react: 16.6.1 => 16.6.1
react-native: ^0.55 => 0.55.4

Description

This only happens in Android devices.
I'm using react-native 0.55.4; can't update to the latest version now
I'm getting an error undefined is not an object (evaluating hasOwnProperty.call(it, key)) when I try to access the global object at the position of a Symbol

import 'core-js'; // needed for Symbol otherwise I get a different error
const symbolAAA = Symbol.for('AAA');

global.dependencies = {};
global.dependencies[symbolAAA] = 'name'; // this is fine

global[symbolAAA] = 'name'; // ERROR!

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPlatform: AndroidAndroid applications.Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions