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

Native inheritance/prototype chaining is not working correctly #42

Open
Arshia001 opened this issue Jan 15, 2024 · 1 comment · May be fixed by #44
Open

Native inheritance/prototype chaining is not working correctly #42

Arshia001 opened this issue Jan 15, 2024 · 1 comment · May be fixed by #44

Comments

@Arshia001
Copy link
Contributor

From the latest commit on master:

> new File(['a'], 'b').__proto__.__proto__
{}

The second __proto__ should be Blob, but it's Object instead. I'm investigating this myself, but I thought it was best to create an issue anyway.

@Arshia001
Copy link
Contributor Author

From the class code generated by ion for File:

impl ::ion::ClassDefinition for File {
	const NAME: &'static str = ::std::stringify!(File);
	fn class() -> &'static ::ion::class::NativeClass {
		Self::__ion_native_class()
	}
	fn constructor() -> (::ion::functions::NativeFunction, ::core::primitive::u32) {
		(Self::__ion_bindings_constructor, 2u32)
	}
	fn functions() -> &'static [::mozjs::jsapi::JSFunctionSpec] {
		Self::__ion_function_specs()
	}
	fn properties() -> &'static [::mozjs::jsapi::JSPropertySpec] {
		Self::__ion_property_specs()
	}
	fn static_functions() -> &'static [::mozjs::jsapi::JSFunctionSpec] {
		Self::__ion_static_function_specs()
	}
	fn static_properties() -> &'static [::mozjs::jsapi::JSPropertySpec] {
		Self::__ion_static_property_specs()
	}
}

I think the problem is a missing implementation for parent_class_info.

Arshia001 added a commit to wasmerio/spiderfire that referenced this issue Jan 15, 2024
Arshia001 added a commit to wasmerio/spiderfire that referenced this issue Jan 15, 2024
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

Successfully merging a pull request may close this issue.

1 participant