Add missing indexing words

This commit is contained in:
Anton Danilkin
2018-08-07 02:40:55 +03:00
parent f54d51e045
commit 86b5ba6431
3 changed files with 14 additions and 13 deletions

View File

@ -1881,9 +1881,9 @@ impl<'a, 'b> SubContext<'a, 'b> {
class, location, s, class, location, s,
) )
} }
shared::OperationKind::IndexingGetter => panic!("getter should be structural"), shared::OperationKind::IndexingGetter => panic!("indexing getter should be structural"),
shared::OperationKind::IndexingSetter => panic!("setter should be structural"), shared::OperationKind::IndexingSetter => panic!("indexing setter should be structural"),
shared::OperationKind::IndexingDeleter => panic!("deleter should be structural"), shared::OperationKind::IndexingDeleter => panic!("indexing deleter should be structural"),
} }
}; };

View File

@ -973,9 +973,9 @@ impl<'src> FirstPassRecord<'src> {
mdn_doc(self_name, Some(&name)) mdn_doc(self_name, Some(&name))
) )
), ),
::first_pass::OperationId::IndexingGetter => Some("The getter\n\n".to_string()), ::first_pass::OperationId::IndexingGetter => Some("The indexing getter\n\n".to_string()),
::first_pass::OperationId::IndexingSetter => Some("The setter\n\n".to_string()), ::first_pass::OperationId::IndexingSetter => Some("The indexing setter\n\n".to_string()),
::first_pass::OperationId::IndexingDeleter => Some("The deleter\n\n".to_string()), ::first_pass::OperationId::IndexingDeleter => Some("The indexing deleter\n\n".to_string()),
}; };
self.create_function( self.create_function(

View File

@ -129,13 +129,14 @@ possibilities!
an object we can use the `structural` flag. an object we can use the `structural` flag.
* `indexing_getter`, `indexing_setter` and `indexing_deleter` - these three * `indexing_getter`, `indexing_setter` and `indexing_deleter` - these three
attributes can be combined with `method` to indicate that this is a getter, attributes can be combined with `method` to indicate that this is a indexing
setter or deleter method. They are different from `getter` and `setter` in a getter, indexing setter or indexing deleter method. They are different from
way that `getter` and `setter` can only access properties that have a name `getter` and `setter` in a way that `getter` and `setter` can only access
corresponding to the function name or their argument, but `indexing_getter`, properties that have a name corresponding to the function name or their
`indexing_setter` and `indexing_deleter` work in a dynamic manner, similarly argument, but `indexing_getter`, `indexing_setter` and `indexing_deleter`
to the indexing syntax in JS (`object[propertyName]`), hence the name. Should work in a dynamic manner, similarly to the indexing syntax in JS
always be used together with the `structural` flag. For example: (`object[propertyName]`), hence the name. Should always be used together with
the `structural` flag. For example:
```rust ```rust
#[wasm_bindgen] #[wasm_bindgen]