Chromium Code Reviews| Index: tools/dom/scripts/systemnative.py |
| diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py |
| index bbd9be37b82fc11bf06ef664c1e756ed1c4d9b07..51e578e22c6eb97c622249bb431715010fbda7e4 100644 |
| --- a/tools/dom/scripts/systemnative.py |
| +++ b/tools/dom/scripts/systemnative.py |
| @@ -428,7 +428,11 @@ class DartiumBackend(HtmlDartGenerator): |
| else: |
| self._members_emitter.Emit( |
| '\n' |
| - ' $TYPE operator[](int index) native "$(INTERFACE)_item_Callback";\n', |
| + ' $TYPE operator[](int index) {\n' |
|
sra1
2013/05/09 19:55:50
Does the native code to a bounds check?
blois
2013/05/09 20:00:25
It appears to have the same behavior as JS.
|
| + ' if (index < 0 || index >= length) throw new RangeError.range(index, 0, length);\n' |
|
sra1
2013/05/09 19:55:50
line length
blois
2013/05/09 22:49:24
Done.
|
| + ' return _nativeIndexedGetter(index);\n' |
| + ' }\n' |
| + ' $TYPE _nativeIndexedGetter(int index) native "$(INTERFACE)_item_Callback";\n', |
| TYPE=self.SecureOutputType(element_type), |
| INTERFACE=self._interface.id) |