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

Side by Side Diff: third_party/WebKit/Source/core/streams/WritableStream.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
« no previous file with comments | « third_party/WebKit/Source/core/streams/ReadableStream.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // Implementation of WritableStream for Blink. See 5 // Implementation of WritableStream for Blink. See
6 // https://streams.spec.whatwg.org/#ws. The implementation closely follows the 6 // https://streams.spec.whatwg.org/#ws. The implementation closely follows the
7 // standard, except where required for performance or integration with Blink. In 7 // standard, except where required for performance or integration with Blink. In
8 // particular, classes, methods and abstract operations are implemented in the 8 // particular, classes, methods and abstract operations are implemented in the
9 // same order as in the standard, to simplify side-by-side reading. 9 // same order as in the standard, to simplify side-by-side reading.
10 10
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 } 1032 }
1033 1033
1034 // TODO(ricea): Share this operation with ReadableStream.js. 1034 // TODO(ricea): Share this operation with ReadableStream.js.
1035 function ValidateAndNormalizeQueuingStrategy(size, highWaterMark) { 1035 function ValidateAndNormalizeQueuingStrategy(size, highWaterMark) {
1036 if (size !== undefined && typeof size !== 'function') { 1036 if (size !== undefined && typeof size !== 'function') {
1037 throw new TypeError(streamErrors.sizeNotAFunction); 1037 throw new TypeError(streamErrors.sizeNotAFunction);
1038 } 1038 }
1039 1039
1040 highWaterMark = Number(highWaterMark); 1040 highWaterMark = Number(highWaterMark);
1041 if (Number_isNaN(highWaterMark)) { 1041 if (Number_isNaN(highWaterMark)) {
1042 throw new RangeError(streamErrors.errInvalidHWM); 1042 throw new RangeError(streamErrors.invalidHWM);
1043 } 1043 }
1044 if (highWaterMark < 0) { 1044 if (highWaterMark < 0) {
1045 throw new RangeError(streamErrors.invalidHWM); 1045 throw new RangeError(streamErrors.invalidHWM);
1046 } 1046 }
1047 1047
1048 return {size, highWaterMark}; 1048 return {size, highWaterMark};
1049 } 1049 }
1050 1050
1051 // 1051 //
1052 // Additions to the global object 1052 // Additions to the global object
(...skipping 22 matching lines...) Expand all
1075 getWritableStreamDefaultWriterClosedPromise; 1075 getWritableStreamDefaultWriterClosedPromise;
1076 binding.WritableStreamDefaultWriterGetDesiredSize = 1076 binding.WritableStreamDefaultWriterGetDesiredSize =
1077 WritableStreamDefaultWriterGetDesiredSize; 1077 WritableStreamDefaultWriterGetDesiredSize;
1078 binding.getWritableStreamDefaultWriterReadyPromise = 1078 binding.getWritableStreamDefaultWriterReadyPromise =
1079 getWritableStreamDefaultWriterReadyPromise; 1079 getWritableStreamDefaultWriterReadyPromise;
1080 binding.WritableStreamDefaultWriterRelease = 1080 binding.WritableStreamDefaultWriterRelease =
1081 WritableStreamDefaultWriterRelease; 1081 WritableStreamDefaultWriterRelease;
1082 binding.WritableStreamDefaultWriterWrite = WritableStreamDefaultWriterWrite; 1082 binding.WritableStreamDefaultWriterWrite = WritableStreamDefaultWriterWrite;
1083 binding.getWritableStreamStoredError = getWritableStreamStoredError; 1083 binding.getWritableStreamStoredError = getWritableStreamStoredError;
1084 }); 1084 });
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/streams/ReadableStream.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698