| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | - Symbol, | ||
| 4 | + SymbolIterator, | ||
| 5 | 5 | } = primordials; | |
| 6 | 6 | ||
| 7 | 7 | const { Buffer } = require('buffer'); | |
@@ -94,7 +94,7 @@ module.exports = class BufferList { | |||
| 94 | 94 | return this.head.data; | |
| 95 | 95 | } | |
| 96 | 96 | ||
| 97 | - *[Symbol.iterator]() { | ||
| 97 | + *[SymbolIterator]() { | ||
| 98 | 98 | for (let p = this.head; p; p = p.next) { | |
| 99 | 99 | yield p.data; | |
| 100 | 100 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | 4 | Symbol, | |
| 5 | + SymbolIterator | ||
| 5 | 6 | } = primordials; | |
| 6 | 7 | ||
| 7 | 8 | const { | |
@@ -12,8 +13,8 @@ function from(Readable, iterable, opts) { | |||
| 12 | 13 | let iterator; | |
| 13 | 14 | if (iterable && iterable[Symbol.asyncIterator]) | |
| 14 | 15 | iterator = iterable[Symbol.asyncIterator](); | |
| 15 | - else if (iterable && iterable[Symbol.iterator]) | ||
| 16 | - iterator = iterable[Symbol.iterator](); | ||
| 16 | + else if (iterable && iterable[SymbolIterator]) | ||
| 17 | + iterator = iterable[SymbolIterator](); | ||
| 17 | 18 | else | |
| 18 | 19 | throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); | |
| 19 | 20 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,7 @@ const { | |||
| 12 | 12 | ReflectGetOwnPropertyDescriptor, | |
| 13 | 13 | ReflectOwnKeys, | |
| 14 | 14 | Symbol, | |
| 15 | + SymbolIterator, | ||
| 15 | 16 | } = primordials; | |
| 16 | 17 | ||
| 17 | 18 | const { inspect } = require('internal/util/inspect'); | |
@@ -87,7 +88,7 @@ const kFormat = Symbol('format'); | |||
| 87 | 88 | ||
| 88 | 89 | // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object | |
| 89 | 90 | const IteratorPrototype = ObjectGetPrototypeOf( | |
| 90 | - ObjectGetPrototypeOf([][Symbol.iterator]()) | ||
| 91 | + ObjectGetPrototypeOf([][SymbolIterator]()) | ||
| 91 | 92 | ); | |
| 92 | 93 | ||
| 93 | 94 | const unpairedSurrogateRe = | |
@@ -139,8 +140,8 @@ class URLSearchParams { | |||
| 139 | 140 | if (init === null || init === undefined) { | |
| 140 | 141 | this[searchParams] = []; | |
| 141 | 142 | } else if (typeof init === 'object' || typeof init === 'function') { | |
| 142 | - const method = init[Symbol.iterator]; | ||
| 143 | - if (method === this[Symbol.iterator]) { | ||
| 143 | + const method = init[SymbolIterator]; | ||
| 144 | + if (method === this[SymbolIterator]) { | ||
| 144 | 145 | // While the spec does not have this branch, we can use it as a | |
| 145 | 146 | // shortcut to avoid having to go through the costly generic iterator. | |
| 146 | 147 | const childParams = init[searchParams]; | |
@@ -156,7 +157,7 @@ class URLSearchParams { | |||
| 156 | 157 | for (const pair of init) { | |
| 157 | 158 | if ((typeof pair !== 'object' && typeof pair !== 'function') || | |
| 158 | 159 | pair === null || | |
| 159 | - typeof pair[Symbol.iterator] !== 'function') { | ||
| 160 | + typeof pair[SymbolIterator] !== 'function') { | ||
| 160 | 161 | throw new ERR_INVALID_TUPLE('Each query pair', '[name, value]'); | |
| 161 | 162 | } | |
| 162 | 163 | const convertedPair = []; | |
@@ -1149,7 +1150,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { | |||
| 1149 | 1150 | }); | |
| 1150 | 1151 | ||
| 1151 | 1152 | // https://heycam.github.io/webidl/#es-iterable-entries | |
| 1152 | - ObjectDefineProperty(URLSearchParams.prototype, Symbol.iterator, { | ||
| 1153 | + ObjectDefineProperty(URLSearchParams.prototype, SymbolIterator, { | ||
| 1153 | 1154 | writable: true, | |
| 1154 | 1155 | configurable: true, | |
| 1155 | 1156 | value: URLSearchParams.prototype.entries | |
| Back | FazBrowse Home | New Git URL |
0 commit comments