Skip to content

[Interop] JS modules do not answer KEYS message correctly #84

Open
@fniephaus

Description

@fniephaus

I assume the interop KEYS message is answered using Object.keys(theJSObject) which results in the following behavior:

GraalVM MultiLanguage Shell 1.0.0-rc10
Copyright (c) 2013-2018, Oracle and/or its affiliates
  JavaScript version 1.0
  Python version 3.7.0
  R version 3.4.0
  Ruby version 2.4.4
Usage:
  Use Ctrl+L to switch language and Ctrl+D to exit.
  Enter -usage to get a list of available commands.
python> import polyglot
python> math = polyglot.eval(language='js', string='Math')
python> dir(math)
[]
python> x.min(1, 2) # message is understood even though not listed
1
python> json = polyglot.eval(language='js', string='JSON')
python> dir(json)
[]

Additionally, I think the answer should also include all non-enumerable properties (via Object. getOwnPropertyNames(theJSObject)) including inherited properties by walking up the prototype chain.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestinteropPolyglot Language Interoperability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions