Merge pull request #903 from alexcrichton/doc-constructors

Add more documentation to `web-sys` constructors
This commit is contained in:
Alex Crichton 2018-09-27 13:51:07 -07:00 committed by GitHub
commit 7447c30ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -647,7 +647,13 @@ impl<'src> FirstPassRecord<'src> {
} }
}; };
let doc = match id { let doc = match id {
OperationId::Constructor(_) | OperationId::Operation(None) => Some(String::new()), OperationId::Operation(None) => Some(String::new()),
OperationId::Constructor(_) => {
Some(format!("The `new {}(..)` constructor, creating a new \
instance of `{0}`\n\n{}",
self_name,
mdn_doc(self_name, Some(self_name))))
}
OperationId::Operation(Some(name)) => Some(format!( OperationId::Operation(Some(name)) => Some(format!(
"The `{}()` method\n\n{}", "The `{}()` method\n\n{}",
name, name,