From da94613124559112b40046fabf1658a15449c16d Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Fri, 21 Aug 2015 01:31:54 +0600 Subject: [PATCH] temporary remove experimental `es7.observable` module --- build/build.ls | 3 +- build/index.js | 4 +- library/modules/es7.observable.js | 159 ------------------------------ modules/es7.observable.js | 159 ------------------------------ 4 files changed, 3 insertions(+), 322 deletions(-) delete mode 100644 library/modules/es7.observable.js delete mode 100644 modules/es7.observable.js diff --git a/build/build.ls b/build/build.ls index a034ca956377..127124b65785 100644 --- a/build/build.ls +++ b/build/build.ls @@ -100,7 +100,6 @@ list = <[ es7.object.entries es7.map.to-json es7.set.to-json - es7.observable web.immediate web.dom.iterable web.timers @@ -122,7 +121,7 @@ list = <[ ]> experimental = <[ - es7.observable + ]> libraryBlacklist = <[ diff --git a/build/index.js b/build/index.js index 2c598bb795eb..53f28e32e0ab 100644 --- a/build/index.js +++ b/build/index.js @@ -4,8 +4,8 @@ banner = require('./config').banner; ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink; webpack = require('webpack'); - list = ['es5', 'es6.symbol', 'es6.object.assign', 'es6.object.is', 'es6.object.set-prototype-of', 'es6.object.to-string', 'es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.object.get-own-property-descriptor', 'es6.object.get-prototype-of', 'es6.object.keys', 'es6.object.get-own-property-names', 'es6.function.name', 'es6.function.has-instance', 'es6.number.constructor', 'es6.number.epsilon', 'es6.number.is-finite', 'es6.number.is-integer', 'es6.number.is-nan', 'es6.number.is-safe-integer', 'es6.number.max-safe-integer', 'es6.number.min-safe-integer', 'es6.number.parse-float', 'es6.number.parse-int', 'es6.math.acosh', 'es6.math.asinh', 'es6.math.atanh', 'es6.math.cbrt', 'es6.math.clz32', 'es6.math.cosh', 'es6.math.expm1', 'es6.math.fround', 'es6.math.hypot', 'es6.math.imul', 'es6.math.log10', 'es6.math.log1p', 'es6.math.log2', 'es6.math.sign', 'es6.math.sinh', 'es6.math.tanh', 'es6.math.trunc', 'es6.string.from-code-point', 'es6.string.raw', 'es6.string.trim', 'es6.string.code-point-at', 'es6.string.ends-with', 'es6.string.includes', 'es6.string.repeat', 'es6.string.starts-with', 'es6.string.iterator', 'es6.array.from', 'es6.array.of', 'es6.array.iterator', 'es6.array.species', 'es6.array.copy-within', 'es6.array.fill', 'es6.array.find', 'es6.array.find-index', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.promise', 'es6.map', 'es6.set', 'es6.weak-map', 'es6.weak-set', 'es6.reflect.apply', 'es6.reflect.construct', 'es6.reflect.define-property', 'es6.reflect.delete-property', 'es6.reflect.enumerate', 'es6.reflect.get', 'es6.reflect.get-own-property-descriptor', 'es6.reflect.get-prototype-of', 'es6.reflect.has', 'es6.reflect.is-extensible', 'es6.reflect.own-keys', 'es6.reflect.prevent-extensions', 'es6.reflect.set', 'es6.reflect.set-prototype-of', 'es7.array.includes', 'es7.string.at', 'es7.string.pad-left', 'es7.string.pad-right', 'es7.string.trim-left', 'es7.string.trim-right', 'es7.regexp.escape', 'es7.object.get-own-property-descriptors', 'es7.object.values', 'es7.object.entries', 'es7.map.to-json', 'es7.set.to-json', 'es7.observable', 'web.immediate', 'web.dom.iterable', 'web.timers', 'core.dict', 'core.get-iterator-method', 'core.get-iterator', 'core.is-iterable', 'core.delay', 'core.function.part', 'core.object.is-object', 'core.object.classof', 'core.object.define', 'core.object.make', 'core.number.iterator', 'core.string.escape-html', 'core.string.unescape-html', 'core.log', 'js.array.statics']; - experimental = ['es7.observable']; + list = ['es5', 'es6.symbol', 'es6.object.assign', 'es6.object.is', 'es6.object.set-prototype-of', 'es6.object.to-string', 'es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.object.get-own-property-descriptor', 'es6.object.get-prototype-of', 'es6.object.keys', 'es6.object.get-own-property-names', 'es6.function.name', 'es6.function.has-instance', 'es6.number.constructor', 'es6.number.epsilon', 'es6.number.is-finite', 'es6.number.is-integer', 'es6.number.is-nan', 'es6.number.is-safe-integer', 'es6.number.max-safe-integer', 'es6.number.min-safe-integer', 'es6.number.parse-float', 'es6.number.parse-int', 'es6.math.acosh', 'es6.math.asinh', 'es6.math.atanh', 'es6.math.cbrt', 'es6.math.clz32', 'es6.math.cosh', 'es6.math.expm1', 'es6.math.fround', 'es6.math.hypot', 'es6.math.imul', 'es6.math.log10', 'es6.math.log1p', 'es6.math.log2', 'es6.math.sign', 'es6.math.sinh', 'es6.math.tanh', 'es6.math.trunc', 'es6.string.from-code-point', 'es6.string.raw', 'es6.string.trim', 'es6.string.code-point-at', 'es6.string.ends-with', 'es6.string.includes', 'es6.string.repeat', 'es6.string.starts-with', 'es6.string.iterator', 'es6.array.from', 'es6.array.of', 'es6.array.iterator', 'es6.array.species', 'es6.array.copy-within', 'es6.array.fill', 'es6.array.find', 'es6.array.find-index', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.promise', 'es6.map', 'es6.set', 'es6.weak-map', 'es6.weak-set', 'es6.reflect.apply', 'es6.reflect.construct', 'es6.reflect.define-property', 'es6.reflect.delete-property', 'es6.reflect.enumerate', 'es6.reflect.get', 'es6.reflect.get-own-property-descriptor', 'es6.reflect.get-prototype-of', 'es6.reflect.has', 'es6.reflect.is-extensible', 'es6.reflect.own-keys', 'es6.reflect.prevent-extensions', 'es6.reflect.set', 'es6.reflect.set-prototype-of', 'es7.array.includes', 'es7.string.at', 'es7.string.pad-left', 'es7.string.pad-right', 'es7.string.trim-left', 'es7.string.trim-right', 'es7.regexp.escape', 'es7.object.get-own-property-descriptors', 'es7.object.values', 'es7.object.entries', 'es7.map.to-json', 'es7.set.to-json', 'web.immediate', 'web.dom.iterable', 'web.timers', 'core.dict', 'core.get-iterator-method', 'core.get-iterator', 'core.is-iterable', 'core.delay', 'core.function.part', 'core.object.is-object', 'core.object.classof', 'core.object.define', 'core.object.make', 'core.number.iterator', 'core.string.escape-html', 'core.string.unescape-html', 'core.log', 'js.array.statics']; + experimental = []; libraryBlacklist = ['es6.object.to-string', 'es6.function.name', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.number.constructor']; es5SpecialCase = ['es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.string.trim']; module.exports = function(arg$, next){ diff --git a/library/modules/es7.observable.js b/library/modules/es7.observable.js deleted file mode 100644 index 45968c753979..000000000000 --- a/library/modules/es7.observable.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; -// Based on https://github.com/zenparsing/es-observable/blob/master/src/Observable.js -var global = require('./$.global') - , core = require('./$.core') - , $def = require('./$.def') - , $redef = require('./$.redef') - , $mix = require('./$.mix') - , asap = require('./$.task').set - , isObject = require('./$.is-object') - , anObject = require('./$.an-object') - , aFunction = require('./$.a-function') - , OBSERVER = require('./$.wks')('observer'); - -// === Abstract Operations === -var cancelSubscription = function(observer){ - var subscription = observer._subscription; - if(!subscription)return; - // Drop the reference to the subscription so that we don't unsubscribe - // more than once - observer._subscription = undefined; - try { - // Call the unsubscribe function - subscription.unsubscribe(); - } finally { - // Drop the reference to the inner observer so that no more notifications - // will be sent - observer._observer = undefined; - } -}; - -var closeSubscription = function(observer){ - observer._observer = undefined; - cancelSubscription(observer); -}; - -var hasUnsubscribe = function(x){ - return isObject(x) && typeof x.unsubscribe == 'function'; -}; - -var SubscriptionObserver = function(observer){ - this._observer = observer; - this._subscription = undefined; -}; -$mix(SubscriptionObserver.prototype, { - next: function(value){ - var observer = this._observer - , result; - // If the stream if closed, then return a "done" result - if(!observer)return { value: undefined, done: true }; - try { - // Send the next value to the sink - result = observer.next(value); - } catch (e) { - // If the observer throws, then close the stream and rethrow the error - closeSubscription(this); - throw e; - } - // Cleanup if sink is closed - if(result && result.done)closeSubscription(this); - return result; - }, - 'throw': function(value){ - var observer = this._observer; - // If the stream is closed, throw the error to the caller - if(!observer)throw value; - this._observer = undefined; - try { - // If the sink does not support "throw", then throw the error to the caller - if(!('throw' in observer))throw value; - return observer['throw'](value); - } finally { - cancelSubscription(this); - } - }, - 'return': function(value){ - var observer = this._observer; - // If the stream is closed, then return a done result - if (!observer)return {value: value, done: true}; - this._observer = undefined; - try { - // If the sink does not support "return", then return a done result - if (!('return' in observer))return {value: value, done: true}; - return observer['return'](value); - } finally { - cancelSubscription(this); - } - } -}); - -function Observable(subscriber){ - // The stream subscriber must be a function - this._subscriber = aFunction(subscriber); -} -$mix(Observable.prototype, { - subscribe: function(observer){ - // The sink must be an object - anObject(observer); - var unsubscribed = false - , that = this - , subscription; - asap.call(global, function(){ - if(!unsubscribed)subscription = that[OBSERVER](observer); - }); - return { - unsubscribe: function(){ - if(unsubscribed)return; - unsubscribed = true; - if(subscription)subscription.unsubscribe(); - } - }; - }, - forEach: function(fn, thisArg){ - var that = this; - return new (core.Promise || global.Promise)(function(resolve, reject){ - aFunction(fn); - that.subscribe({ - next: function(value){ fn.call(thisArg, value); }, - 'throw': function(value){ reject(value); }, - 'return': function(){ resolve(undefined); } - }); - }); - } -}); -$redef(Observable.prototype, OBSERVER, function(observer){ - // The sink must be an object - // Wrap the observer in order to maintain observation invariants - observer = new SubscriptionObserver(anObject(observer)); - var subscription; - try { - // Call the subscriber function - subscription = this._subscriber.call(undefined, observer); - if(!hasUnsubscribe(subscription)){ - var unsubscribe = typeof subscription == 'function' - ? subscription - : function(){ observer['return'](); }; - subscription = {unsubscribe: unsubscribe}; - } - } catch(e){ - // If an error occurs during startup, then attempt to send the error - // to the observer - observer['throw'](e); - } - observer._subscription = subscription; - // If the stream is already finished, then perform cleanup - if(!observer._observer)cancelSubscription(observer); - // Return the subscription object - return subscription; -}); -$redef(Observable, 'from', function(x){ - if(anObject(x)._subscriber && x.constructor === this)return x; - var subscribeFunction = aFunction(x[OBSERVER]); - return new this(function(sink){ - subscribeFunction.call(x, sink); - }); -}); - - -$def($def.G + $def.F, {Observable: Observable}); -$def($def.S, 'Symbol', {observer: OBSERVER}); \ No newline at end of file diff --git a/modules/es7.observable.js b/modules/es7.observable.js deleted file mode 100644 index 45968c753979..000000000000 --- a/modules/es7.observable.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; -// Based on https://github.com/zenparsing/es-observable/blob/master/src/Observable.js -var global = require('./$.global') - , core = require('./$.core') - , $def = require('./$.def') - , $redef = require('./$.redef') - , $mix = require('./$.mix') - , asap = require('./$.task').set - , isObject = require('./$.is-object') - , anObject = require('./$.an-object') - , aFunction = require('./$.a-function') - , OBSERVER = require('./$.wks')('observer'); - -// === Abstract Operations === -var cancelSubscription = function(observer){ - var subscription = observer._subscription; - if(!subscription)return; - // Drop the reference to the subscription so that we don't unsubscribe - // more than once - observer._subscription = undefined; - try { - // Call the unsubscribe function - subscription.unsubscribe(); - } finally { - // Drop the reference to the inner observer so that no more notifications - // will be sent - observer._observer = undefined; - } -}; - -var closeSubscription = function(observer){ - observer._observer = undefined; - cancelSubscription(observer); -}; - -var hasUnsubscribe = function(x){ - return isObject(x) && typeof x.unsubscribe == 'function'; -}; - -var SubscriptionObserver = function(observer){ - this._observer = observer; - this._subscription = undefined; -}; -$mix(SubscriptionObserver.prototype, { - next: function(value){ - var observer = this._observer - , result; - // If the stream if closed, then return a "done" result - if(!observer)return { value: undefined, done: true }; - try { - // Send the next value to the sink - result = observer.next(value); - } catch (e) { - // If the observer throws, then close the stream and rethrow the error - closeSubscription(this); - throw e; - } - // Cleanup if sink is closed - if(result && result.done)closeSubscription(this); - return result; - }, - 'throw': function(value){ - var observer = this._observer; - // If the stream is closed, throw the error to the caller - if(!observer)throw value; - this._observer = undefined; - try { - // If the sink does not support "throw", then throw the error to the caller - if(!('throw' in observer))throw value; - return observer['throw'](value); - } finally { - cancelSubscription(this); - } - }, - 'return': function(value){ - var observer = this._observer; - // If the stream is closed, then return a done result - if (!observer)return {value: value, done: true}; - this._observer = undefined; - try { - // If the sink does not support "return", then return a done result - if (!('return' in observer))return {value: value, done: true}; - return observer['return'](value); - } finally { - cancelSubscription(this); - } - } -}); - -function Observable(subscriber){ - // The stream subscriber must be a function - this._subscriber = aFunction(subscriber); -} -$mix(Observable.prototype, { - subscribe: function(observer){ - // The sink must be an object - anObject(observer); - var unsubscribed = false - , that = this - , subscription; - asap.call(global, function(){ - if(!unsubscribed)subscription = that[OBSERVER](observer); - }); - return { - unsubscribe: function(){ - if(unsubscribed)return; - unsubscribed = true; - if(subscription)subscription.unsubscribe(); - } - }; - }, - forEach: function(fn, thisArg){ - var that = this; - return new (core.Promise || global.Promise)(function(resolve, reject){ - aFunction(fn); - that.subscribe({ - next: function(value){ fn.call(thisArg, value); }, - 'throw': function(value){ reject(value); }, - 'return': function(){ resolve(undefined); } - }); - }); - } -}); -$redef(Observable.prototype, OBSERVER, function(observer){ - // The sink must be an object - // Wrap the observer in order to maintain observation invariants - observer = new SubscriptionObserver(anObject(observer)); - var subscription; - try { - // Call the subscriber function - subscription = this._subscriber.call(undefined, observer); - if(!hasUnsubscribe(subscription)){ - var unsubscribe = typeof subscription == 'function' - ? subscription - : function(){ observer['return'](); }; - subscription = {unsubscribe: unsubscribe}; - } - } catch(e){ - // If an error occurs during startup, then attempt to send the error - // to the observer - observer['throw'](e); - } - observer._subscription = subscription; - // If the stream is already finished, then perform cleanup - if(!observer._observer)cancelSubscription(observer); - // Return the subscription object - return subscription; -}); -$redef(Observable, 'from', function(x){ - if(anObject(x)._subscriber && x.constructor === this)return x; - var subscribeFunction = aFunction(x[OBSERVER]); - return new this(function(sink){ - subscribeFunction.call(x, sink); - }); -}); - - -$def($def.G + $def.F, {Observable: Observable}); -$def($def.S, 'Symbol', {observer: OBSERVER}); \ No newline at end of file