OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium 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 (function(global, binding, v8) { | 5 (function(global, binding, v8) { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 const _reader = v8.createPrivateSymbol('[[reader]]'); | 8 const _reader = v8.createPrivateSymbol('[[reader]]'); |
9 const _storedError = v8.createPrivateSymbol('[[storedError]]'); | 9 const _storedError = v8.createPrivateSymbol('[[storedError]]'); |
10 const _controller = v8.createPrivateSymbol('[[controller]]'); | 10 const _controller = v8.createPrivateSymbol('[[controller]]'); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 if (mode === undefined) { | 172 if (mode === undefined) { |
173 return AcquireReadableStreamDefaultReader(this); | 173 return AcquireReadableStreamDefaultReader(this); |
174 } | 174 } |
175 | 175 |
176 throw new RangeError(errGetReaderBadMode); | 176 throw new RangeError(errGetReaderBadMode); |
177 } | 177 } |
178 | 178 |
179 pipeThrough({writable, readable}, options) { | 179 pipeThrough({writable, readable}, options) { |
180 this.pipeTo(writable, options); | 180 const promise = this.pipeTo(writable, options); |
| 181 if (v8.isPromise(promise)) { |
| 182 v8.markPromiseAsHandled(promise); |
| 183 } |
181 return readable; | 184 return readable; |
182 } | 185 } |
183 | 186 |
184 pipeTo(dest, {preventClose, preventAbort, preventCancel} = {}) { | 187 pipeTo(dest, {preventClose, preventAbort, preventCancel} = {}) { |
185 if (!IsReadableStream(this)) { | 188 if (!IsReadableStream(this)) { |
186 return Promise_reject(new TypeError(streamErrors.illegalInvocation)); | 189 return Promise_reject(new TypeError(streamErrors.illegalInvocation)); |
187 } | 190 } |
188 | 191 |
189 if (!binding.IsWritableStream(dest)) { | 192 if (!binding.IsWritableStream(dest)) { |
190 // TODO(ricea): Think about having a better error message. | 193 // TODO(ricea): Think about having a better error message. |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC
ontrollerGetDesiredSize; | 1114 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC
ontrollerGetDesiredSize; |
1112 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll
erEnqueue; | 1115 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll
erEnqueue; |
1113 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController
Error; | 1116 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController
Error; |
1114 | 1117 |
1115 binding.createReadableStreamWithExternalController = | 1118 binding.createReadableStreamWithExternalController = |
1116 (underlyingSource, strategy) => { | 1119 (underlyingSource, strategy) => { |
1117 return new ReadableStream( | 1120 return new ReadableStream( |
1118 underlyingSource, strategy, createWithExternalControllerSentinel); | 1121 underlyingSource, strategy, createWithExternalControllerSentinel); |
1119 }; | 1122 }; |
1120 }); | 1123 }); |
OLD | NEW |