Changeset 192874 in webkit
- Timestamp:
- Dec 1, 2015 1:06:25 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r192865 r192874 1 2015-12-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 [Streams API] streams should not directly use Number and related methods 4 https://bugs.webkit.org/show_bug.cgi?id=151499 5 6 Reviewed by Darin Adler. 7 8 Added a non-regression test. 9 10 * streams/streams-promises-expected.txt: 11 * streams/streams-promises.html: 12 1 13 2015-12-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 14 -
trunk/LayoutTests/streams/streams-promises-expected.txt
r192207 r192874 7 7 PASS Streams and promises: replace catch method in Promise prototype 8 8 PASS Streams and promises: replace then method in promise object 9 PASS Streams should not directly use Number and related methods 9 10 -
trunk/LayoutTests/streams/streams-promises.html
r192865 r192874 90 90 new WritableStream({ start: function() { return createMangledPromise(); } }) 91 91 }, 'Streams and promises: replace then method in promise object'); 92 93 test(function() { 94 const NumberBackup = Number; 95 const NumberIsNaNBackup = Number.isNaN; 96 const NumberIsFiniteBackup = Number.isFinite; 97 98 try { 99 Number.isNaN = function() { assert_unreached("streams should not use this Number.isNaN method"); }; 100 Number.isFinite = function() { assert_unreached("streams should not use this Number.isFinite method"); }; 101 Number = null; 102 103 new ReadableStream({ 104 start: function(controller) { 105 controller.enqueue("small potato"); 106 } 107 }, { 108 size: function(chunk) { return 2; }, 109 highWaterMark: 1 110 }); 111 112 } finally { 113 Number = NumberBackup; 114 Number.isNaN = NumberIsNaNBackup; 115 Number.isFinite = NumberIsFiniteBackup; 116 } 117 }, 'Streams should not directly use Number and related methods'); 92 118 </script> -
trunk/Source/JavaScriptCore/ChangeLog
r192873 r192874 1 2015-12-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 [Streams API] streams should not directly use Number and related methods 4 https://bugs.webkit.org/show_bug.cgi?id=151499 5 6 Reviewed by Darin Adler. 7 8 * runtime/CommonIdentifiers.h: Adding isNaN as private symbol. 9 * runtime/JSGlobalObject.cpp: 10 (JSC::JSGlobalObject::init): Adding @isNaN function. 11 1 12 2015-12-01 Csaba Osztrogonác <ossy@webkit.org> 2 13 -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r192155 r192874 298 298 macro(floor) \ 299 299 macro(isFinite) \ 300 macro(isNaN) \ 300 301 macro(getPrototypeOf) \ 301 302 macro(getOwnPropertyNames) \ -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r192855 r192874 501 501 JSFunction* privateFuncFloor = JSFunction::create(vm, this, 0, String(), mathProtoFuncFloor, FloorIntrinsic); 502 502 JSFunction* privateFuncIsFinite = JSFunction::create(vm, this, 0, String(), globalFuncIsFinite); 503 JSFunction* privateFuncIsNaN = JSFunction::create(vm, this, 0, String(), globalFuncIsNaN); 503 504 504 505 JSFunction* privateFuncGetTemplateObject = JSFunction::create(vm, this, 0, String(), getTemplateObject); … … 528 529 GlobalPropertyInfo(vm.propertyNames->floorPrivateName, privateFuncFloor, DontEnum | DontDelete | ReadOnly), 529 530 GlobalPropertyInfo(vm.propertyNames->isFinitePrivateName, privateFuncIsFinite, DontEnum | DontDelete | ReadOnly), 531 GlobalPropertyInfo(vm.propertyNames->isNaNPrivateName, privateFuncIsNaN, DontEnum | DontDelete | ReadOnly), 530 532 GlobalPropertyInfo(vm.propertyNames->arrayIterationKindKeyPrivateName, jsNumber(ArrayIterateKey), DontEnum | DontDelete | ReadOnly), 531 533 GlobalPropertyInfo(vm.propertyNames->arrayIterationKindValuePrivateName, jsNumber(ArrayIterateValue), DontEnum | DontDelete | ReadOnly), -
trunk/Source/WebCore/ChangeLog
r192872 r192874 1 2015-12-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 [Streams API] streams should not directly use Number and related methods 4 https://bugs.webkit.org/show_bug.cgi?id=151499 5 6 Reviewed by Darin Adler. 7 8 Covered by updated test. 9 10 Using @Number, @isFinite and @isNaN in place of Number, Number.isFinite and Number.isNaN. 11 12 * Modules/streams/ReadableStreamInternals.js: 13 (enqueueInReadableStream): 14 * Modules/streams/StreamInternals.js: 15 (validateAndNormalizeQueuingStrategy): 16 (enqueueValueWithSize): 17 1 18 2015-12-01 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js
r192865 r192874 323 323 let size = 1; 324 324 if (stream.@strategy.size) { 325 size = Number(stream.@strategy.size(chunk));326 if ( Number.isNaN(size) || size === +Infinity|| size < 0)325 size = @Number(stream.@strategy.size(chunk)); 326 if (!@isFinite(size) || size < 0) 327 327 throw new @RangeError("Chunk size is not valid"); 328 328 } -
trunk/Source/WebCore/Modules/streams/StreamInternals.js
r192246 r192874 79 79 80 80 normalizedStrategy.size = size; 81 normalizedStrategy.highWaterMark = Number(highWaterMark);81 normalizedStrategy.highWaterMark = @Number(highWaterMark); 82 82 83 if ( Number.isNaN(normalizedStrategy.highWaterMark))83 if (@isNaN(normalizedStrategy.highWaterMark)) 84 84 throw new @TypeError("highWaterMark parameter is not a number"); 85 85 if (normalizedStrategy.highWaterMark < 0) … … 109 109 "use strict"; 110 110 111 size = Number(size);112 if ( Number.isNaN(size) || !Number.isFinite(size) || size < 0)111 size = @Number(size); 112 if (!@isFinite(size) || size < 0) 113 113 throw new @RangeError("size has an incorrect value"); 114 114 queue.content.push({ value: value, size: size });
Note: See TracChangeset
for help on using the changeset viewer.