Guarantee static_method_of uses the right this (#1795)

This came up during #1760 where `Promise.resolve` must be invoked with
`this` as the `Promise` object, but we were erroneously importing it in
such a way that it didn't have a shim and `this` was `undefined`.
This commit is contained in:
Alex Crichton
2019-09-26 12:33:04 -05:00
committed by GitHub
parent 025b1d8bca
commit 0b1a764f8a
6 changed files with 32 additions and 2 deletions

View File

@ -574,6 +574,9 @@ fn check_standard_import(import: &AuxImport) -> Result<(), Error> {
| AuxImport::Value(AuxValue::ClassSetter(js, name)) => {
format!("field access of `{}` for {}", name, desc_js(js))
}
AuxImport::ValueWithThis(js, method) => {
format!("method `{}.{}`", desc_js(js), method)
}
AuxImport::Instanceof(js) => format!("instance of check of {}", desc_js(js)),
AuxImport::Static(js) => format!("static js value {}", desc_js(js)),
AuxImport::StructuralMethod(name) => format!("structural method `{}`", name),