Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 | 7 |
| 8 // This file relies on the fact that the following declaration has been made | 8 // This file relies on the fact that the following declaration has been made |
| 9 // in runtime.js: | 9 // in runtime.js: |
| 10 // var $Array = global.Array; | 10 // var $Array = global.Array; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 function ExtendArrayPrototype() { | 119 function ExtendArrayPrototype() { |
| 120 %CheckIsBootstrapping(); | 120 %CheckIsBootstrapping(); |
| 121 | 121 |
| 122 InstallFunctions($Array.prototype, DONT_ENUM, $Array( | 122 InstallFunctions($Array.prototype, DONT_ENUM, $Array( |
| 123 'entries', ArrayEntries, | 123 'entries', ArrayEntries, |
| 124 'values', ArrayValues, | 124 'values', ArrayValues, |
| 125 'keys', ArrayKeys | 125 'keys', ArrayKeys |
| 126 )); | 126 )); |
| 127 } | 127 } |
| 128 ExtendArrayPrototype(); | 128 ExtendArrayPrototype(); |
| 129 | |
| 130 | |
| 131 function ArgumentsIteratorGetter() { | |
| 132 return ArrayValues; | |
| 133 } | |
| 134 | |
| 135 | |
| 136 function ArgumentsIteratorSetter(val) { | |
| 137 ObjectDefineProperty(this, symbolIterator, { | |
| 138 value: val, | |
| 139 writable: true, | |
| 140 enumerable: false, | |
| 141 configurable: true | |
| 142 }); | |
| 143 } | |
| 144 | |
| 145 | |
| 146 function ExtendArgumentsBoilerplateObjects() { | |
| 147 %CheckIsBootstrapping(); | |
| 148 | |
| 149 for (var i = 0; i < 3; i++) { | |
| 150 var boilerplate = %GetArgumentsBoilerplateObject(i); | |
| 151 ObjectDefineProperty(boilerplate, symbolIterator, { | |
| 152 get: ArgumentsIteratorGetter, | |
|
arv (Not doing code reviews)
2014/06/25 15:55:05
It is not clear to me why this cannot be a data pr
| |
| 153 set: ArgumentsIteratorSetter, | |
| 154 enumerable: false, | |
| 155 configurable: true | |
| 156 }); | |
| 157 } | |
| 158 } | |
| 159 ExtendArgumentsBoilerplateObjects(); | |
| OLD | NEW |