shadowrealm-api icon indicating copy to clipboard operation
shadowrealm-api copied to clipboard

question: can't return anything other than primitives?

Open tennox opened this issue 1 year ago • 0 comments

Testing this (seemingly awesome) polyfill (aside: how secure is it?) - thanks!

But it seems to me I cannot return/export anything except primitives (or a function that returns primitives):

const test = { a: 1 }
export { test }
realm.importValue('/script.js', 'test')

=> Cross-Realm Error: TypeError: need primitive or callable, got [object Object]

This seems to be related to #4 - but I thought this might actually be according to spec (?!), so I created a separate issue :thinking:

tennox avatar Mar 06 '24 00:03 tennox