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

Ensure Object type in dynamic import() Runtime Semantics #108

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

dandclark
Copy link
Collaborator

@dandclark dandclark commented Jan 13, 2021

In the Runtime Semantics for the version of dynamic import() that takes an assertions argument, the second argRef and the assertionsObj are not guaranteed to be Objects. e.g:

import("./foo", 42);
import("./foo", { assert: 42 });

But, Get() and EnumerableOwnPropertyNames both assert that the argument to them is an Object.

This change adds checks that these are of Type Object, and reject the promise with a TypeError if either is not.

assertionsObj is still allowed to be undefined. This will be useful if we use the options bag for other things such as evaluator attributes, where a missing assertionsObj shouldn't result in failure:

import('./foo", { with: { transformA: "value" } });

spec.html Outdated Show resolved Hide resolved
@dandclark dandclark force-pushed the dandclark/reject-if-assert-not-object branch from 447756e to 5fe5340 Compare April 29, 2021 23:18
@bmeck
Copy link
Member

bmeck commented Apr 30, 2021 via email

@dandclark dandclark merged commit 69183bd into master Apr 30, 2021
@dandclark dandclark deleted the dandclark/reject-if-assert-not-object branch April 30, 2021 17:28
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 this pull request may close these issues.

5 participants