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

getOriginalConstructor vs getOriginalProperty examples may not make sense #3

Closed
bzbarsky opened this issue May 31, 2018 · 3 comments
Closed

Comments

@bzbarsky
Copy link

It's really not clear to me how we decided what things are returned by getOriginalConstructor vs getOriginalProperty.

In terms of implementation, JSON is in more or less the same bucket as Array at least in SpiderMonkey. And Reflect is in the same bucket too.

Just like CSS is more or less in the same bucket as Node and `Image'.

Per the current definition in the spec, it would return 'Array' and 'Node', but not the other ones, right?

@domenic
Copy link
Owner

domenic commented May 31, 2018

Per the current definition in the spec, it would return 'Array' and 'Node', but not the other ones, right?

Right. Note that none of these are returned by getOriginalProperty().

If you think it's not a big deal to open up getOriginalConstructor() [presumably renamed] to the "namespaces", we could. But it's not clear exactly how you'd use those. Would getOriginalProperty() work on the returned namespace objects? I was assuming an "unwrap the JS wrapper" strategy for getOriginalProperty(), in which case it would not. At which point having these namespace objects is fairly pointless.

@bzbarsky
Copy link
Author

bzbarsky commented May 31, 2018

Would getOriginalProperty() work on the returned namespace objects?

In Gecko it presumably would. This is how current privileged script touching web pages works, for example. There's a membrane in there, but in the end that's what happens.

I was assuming an "unwrap the JS wrapper" strategy for getOriginalProperty()

I'm not sure what you mean...

@domenic
Copy link
Owner

domenic commented May 31, 2018

I'm not sure what you mean...

Rephrased in terms of #10 (comment), I was assuming a "prototype based" strategy for getOriginalProperty(). But maybe that's not necessary.

@domenic domenic closed this as completed in 85b139f Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants