{"action":"closed","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4641","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4641/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4641/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4641/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/4641","id":116909099,"number":4641,"title":"@:jsRequire does not work for enums and interfaces","user":{"login":"vroad","id":396351,"avatar_url":"https://avatars.githubusercontent.com/u/396351?v=3","gravatar_id":"","url":"https://api.github.com/users/vroad","html_url":"https://github.com/vroad","followers_url":"https://api.github.com/users/vroad/followers","following_url":"https://api.github.com/users/vroad/following{/other_user}","gists_url":"https://api.github.com/users/vroad/gists{/gist_id}","starred_url":"https://api.github.com/users/vroad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vroad/subscriptions","organizations_url":"https://api.github.com/users/vroad/orgs","repos_url":"https://api.github.com/users/vroad/repos","events_url":"https://api.github.com/users/vroad/events{/privacy}","received_events_url":"https://api.github.com/users/vroad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/platform-javascript","name":"platform-javascript","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"nadako","id":49749,"avatar_url":"https://avatars.githubusercontent.com/u/49749?v=3","gravatar_id":"","url":"https://api.github.com/users/nadako","html_url":"https://github.com/nadako","followers_url":"https://api.github.com/users/nadako/followers","following_url":"https://api.github.com/users/nadako/following{/other_user}","gists_url":"https://api.github.com/users/nadako/gists{/gist_id}","starred_url":"https://api.github.com/users/nadako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadako/subscriptions","organizations_url":"https://api.github.com/users/nadako/orgs","repos_url":"https://api.github.com/users/nadako/repos","events_url":"https://api.github.com/users/nadako/events{/privacy}","received_events_url":"https://api.github.com/users/nadako/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-11-14T07:48:27Z","updated_at":"2015-11-15T11:28:36Z","closed_at":"2015-11-15T11:28:36Z","body":"I'm trying to import enums from another js file with @:jsRequire metadata. While @:jsRequire works perfectly for classes, Haxe compiler just ignore jsRequire meta of enums and interfaces.\r\nThat makes impossible to do things like equality checks across js files, or implementing interfaces from other js files. Switching with enums still work across modules though, since it uses integer value of enums.\r\n\r\n```Haxe\r\npackage openfl.display3D;\r\n\r\n@:flatEnum @:jsRequire(\"openfl\", \"openfl_display3D_Context3DProfile\") enum Context3DProfile\r\n{\r\n\tBASELINE;\r\n\tBASELINE_CONSTRAINED;\r\n\tBASELINE_EXTENDED;\r\n}\r\n```\r\n\r\n```Haxe\r\n// @:jsRequire is ignored\r\nvar openfl_display3D_Context3DProfile = $hxClasses[\"openfl.display3D.Context3DProfile\"] = { __ename__ : [\"openfl\",\"display3D\",\"Context3DProfile\"], __constructs__ : [\"BASELINE\",\"BASELINE_CONSTRAINED\",\"BASELINE_EXTENDED\"] };\r\n```\r\n\r\nI'm avoiding this issue by manually importing enums with require calls.\r\n\r\n```Haxe\r\n    #if (nodejs && shared_code)\r\n    public static function __init__():Void\r\n    {\r\n        untyped\r\n        {\r\n\t\t\tvar openfl_display3D_Context3DProfile = require(\"openfl\").openfl_display3D_Context3DProfile;\r\n            var openfl_display_StageAlign = require(\"openfl\").openfl_display_StageAlign;\r\n            var openfl_display_StageScaleMode = require(\"openfl\").openfl_display_StageScaleMode;\r\n            var starling_animation_IAnimatable = require(\"starling\").starling_animation_IAnimatable;\r\n        }\r\n    }\r\n    #end\r\n```"}}