| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 $String = global.String; | 10 // var $String = global.String; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 %FunctionSetPrototype(StringIterator, new $Object()); | 81 %FunctionSetPrototype(StringIterator, new $Object()); |
| 82 %FunctionSetInstanceClassName(StringIterator, 'String Iterator'); | 82 %FunctionSetInstanceClassName(StringIterator, 'String Iterator'); |
| 83 | 83 |
| 84 InstallFunctions(StringIterator.prototype, DONT_ENUM, $Array( | 84 InstallFunctions(StringIterator.prototype, DONT_ENUM, $Array( |
| 85 'next', StringIteratorNext | 85 'next', StringIteratorNext |
| 86 )); | 86 )); |
| 87 %FunctionSetName(StringIteratorIterator, '[Symbol.iterator]'); | 87 %FunctionSetName(StringIteratorIterator, '[Symbol.iterator]'); |
| 88 %AddNamedProperty(StringIterator.prototype, symbolIterator, | 88 %AddNamedProperty(StringIterator.prototype, symbolIterator, |
| 89 StringIteratorIterator, DONT_ENUM); | 89 StringIteratorIterator, DONT_ENUM); |
| 90 %AddNamedProperty(StringIterator.prototype, symbolToStringTag, |
| 91 "String Iterator", READ_ONLY | DONT_ENUM); |
| 90 } | 92 } |
| 91 SetUpStringIterator(); | 93 SetUpStringIterator(); |
| 92 | 94 |
| 93 | 95 |
| 94 // 21.1.3.27 String.prototype [ @@iterator ]( ) | 96 // 21.1.3.27 String.prototype [ @@iterator ]( ) |
| 95 function StringPrototypeIterator() { | 97 function StringPrototypeIterator() { |
| 96 return CreateStringIterator(this); | 98 return CreateStringIterator(this); |
| 97 } | 99 } |
| 98 | 100 |
| 99 | 101 |
| 100 function ExtendStringPrototypeWithIterator() { | 102 function ExtendStringPrototypeWithIterator() { |
| 101 %CheckIsBootstrapping(); | 103 %CheckIsBootstrapping(); |
| 102 | 104 |
| 103 %FunctionSetName(StringPrototypeIterator, '[Symbol.iterator]'); | 105 %FunctionSetName(StringPrototypeIterator, '[Symbol.iterator]'); |
| 104 %AddNamedProperty($String.prototype, symbolIterator, | 106 %AddNamedProperty($String.prototype, symbolIterator, |
| 105 StringPrototypeIterator, DONT_ENUM); | 107 StringPrototypeIterator, DONT_ENUM); |
| 106 } | 108 } |
| 107 ExtendStringPrototypeWithIterator(); | 109 ExtendStringPrototypeWithIterator(); |
| OLD | NEW |