Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: third_party/WebKit/Source/core/streams/ReadableStream.js

Issue 2933853003: Streams: Fix exception message for NaN HWM (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 // Other helpers 1033 // Other helpers
1034 // 1034 //
1035 1035
1036 function ValidateAndNormalizeQueuingStrategy(size, highWaterMark) { 1036 function ValidateAndNormalizeQueuingStrategy(size, highWaterMark) {
1037 if (size !== undefined && typeof size !== 'function') { 1037 if (size !== undefined && typeof size !== 'function') {
1038 throw new TypeError(streamErrors.sizeNotAFunction); 1038 throw new TypeError(streamErrors.sizeNotAFunction);
1039 } 1039 }
1040 1040
1041 highWaterMark = Number(highWaterMark); 1041 highWaterMark = Number(highWaterMark);
1042 if (Number_isNaN(highWaterMark)) { 1042 if (Number_isNaN(highWaterMark)) {
1043 throw new RangeError(streamErrors.errInvalidHWM); 1043 throw new RangeError(streamErrors.invalidHWM);
1044 } 1044 }
1045 if (highWaterMark < 0) { 1045 if (highWaterMark < 0) {
1046 throw new RangeError(streamErrors.invalidHWM); 1046 throw new RangeError(streamErrors.invalidHWM);
1047 } 1047 }
1048 1048
1049 return {size, highWaterMark}; 1049 return {size, highWaterMark};
1050 } 1050 }
1051 1051
1052 // Modified from InvokeOrNoop in spec 1052 // Modified from InvokeOrNoop in spec
1053 function CallOrNoop(O, P, arg, nameForError) { 1053 function CallOrNoop(O, P, arg, nameForError) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC ontrollerGetDesiredSize; 1120 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC ontrollerGetDesiredSize;
1121 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll erEnqueue; 1121 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll erEnqueue;
1122 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController Error; 1122 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController Error;
1123 1123
1124 binding.createReadableStreamWithExternalController = 1124 binding.createReadableStreamWithExternalController =
1125 (underlyingSource, strategy) => { 1125 (underlyingSource, strategy) => {
1126 return new ReadableStream( 1126 return new ReadableStream(
1127 underlyingSource, strategy, createWithExternalControllerSentinel); 1127 underlyingSource, strategy, createWithExternalControllerSentinel);
1128 }; 1128 };
1129 }); 1129 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698