content_type
stringclasses 8
values | main_lang
stringclasses 7
values | message
stringlengths 1
50
| sha
stringlengths 40
40
| patch
stringlengths 52
962k
| file_count
int64 1
300
|
---|---|---|---|---|---|
Python | Python | make version number 0.9.9 until 1.0 comes out | ec6d0629236081a4e24e632f603aa4a0b56926a3 | <ide><path>numpy/lib/function_base.py
<ide> def unique(x):
<ide> """
<ide> try:
<ide> tmp = x.flatten()
<add> if tmp.size == 0:
<add> return tmp
<ide> tmp.sort()
<ide> idx = concatenate(([True],tmp[1:]!=tmp[:-1]))
<ide> return tmp[idx]
<ide><path>numpy/version.py
<del>version='1.1'
<add>version='0.9.9'
<ide>
<ide> import os
<ide> svn_version_file = os.path.join(os.path.dirname(__file__), | 2 |
Javascript | Javascript | remove references to internals apis | 94764ee08910726db1db7a1101c3001500306dea | <ide><path>lib/grunt/utils.js
<ide> module.exports = {
<ide> var mapFile = minFile + '.map';
<ide> var mapFileName = mapFile.match(/[^\/]+$/)[0];
<ide> var errorFileName = file.replace(/\.js$/, '-errors.json');
<del> var versionNumber = this.getVersion().number;
<add> var versionNumber = this.getVersion().full;
<ide> shell.exec(
<ide> 'java ' +
<ide> this.java32flags() + ' ' +
<ide><path>src/minErr.js
<ide> function minErr(module) {
<ide> template = arguments[1],
<ide> templateArgs = arguments,
<ide> stringify = function (obj) {
<del> if (isFunction(obj)) {
<add> if (typeof obj === 'function') {
<ide> return obj.toString().replace(/ \{[\s\S]*$/, '');
<del> } else if (isUndefined(obj)) {
<add> } else if (typeof obj === 'undefined') {
<ide> return 'undefined';
<del> } else if (!isString(obj)) {
<add> } else if (typeof obj !== 'string') {
<ide> return JSON.stringify(obj);
<ide> }
<ide> return obj;
<ide> function minErr(module) {
<ide>
<ide> if (index + 2 < templateArgs.length) {
<ide> arg = templateArgs[index + 2];
<del> if (isFunction(arg)) {
<add> if (typeof arg === 'function') {
<ide> return arg.toString().replace(/ ?\{[\s\S]*$/, '');
<del> } else if (isUndefined(arg)) {
<add> } else if (typeof arg === 'undefined') {
<ide> return 'undefined';
<del> } else if (!isString(arg)) {
<add> } else if (typeof arg !== 'string') {
<ide> return toJson(arg);
<ide> }
<ide> return arg;
<ide> }
<ide> return match;
<ide> });
<ide>
<del> message = message + '\nhttp://errors.angularjs.org/' + version.full + '/' +
<add> message = message + '\nhttp://errors.angularjs.org/"NG_VERSION_FULL"/' +
<ide> (module ? module + '/' : '') + code;
<ide> for (i = 2; i < arguments.length; i++) {
<ide> message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' + | 2 |
PHP | PHP | add ability to directly inject an engine instance | 83b4e2577104731a851d864df7d4c8de57ab62cc | <ide><path>lib/Cake/Cache/Cache.php
<ide> protected static function _buildEngine($name) {
<ide> if (!is_subclass_of($cacheClass, 'Cake\Cache\CacheEngine')) {
<ide> throw new Error\CacheException(__d('cake_dev', 'Cache engines must use Cake\Cache\CacheEngine as a base class.'));
<ide> }
<del> static::$_engines[$name] = new $cacheClass();
<del> if (static::$_engines[$name]->init($config)) {
<del> if (static::$_engines[$name]->settings['probability'] && time() % static::$_engines[$name]->settings['probability'] === 0) {
<del> static::$_engines[$name]->gc();
<add> $engine = new $cacheClass();
<add> if ($engine->init($config)) {
<add> if ($engine->settings['probability'] && time() % $engine->settings['probability'] === 0) {
<add> $engine->gc();
<ide> }
<add> static::$_engines[$name] = $engine;
<ide> return true;
<ide> }
<ide> return false;
<ide> public static function drop($config) {
<ide> * triggered.
<ide> *
<ide> * @param string $config The configuration name you want an engine.
<add> * @param Cake\Cache\CacheEngine $engine An engine instance if you are manually
<add> * injecting a cache engine.
<ide> * @return Cake\Cache\Engine
<ide> */
<del> public static function engine($config) {
<add> public static function engine($config, CacheEngine $engine = null) {
<ide> if (Configure::read('Cache.disable')) {
<ide> return false;
<ide> }
<ide> if (isset(static::$_engines[$config])) {
<ide> return static::$_engines[$config];
<ide> }
<del> if (!static::_buildEngine($config)) {
<add> if (!$engine && !static::_buildEngine($config, $engine)) {
<ide> $message = __d(
<ide> 'cake_dev',
<ide> 'The "%s" cache configuration does not exist, nor could configuration be found at "Cache.%s".',
<ide> public static function engine($config) {
<ide> );
<ide> trigger_error($message, E_USER_WARNING);
<ide> }
<add> if ($engine) {
<add> static::$_engines[$config] = $engine;
<add> }
<ide> return static::$_engines[$config];
<ide> }
<ide>
<ide><path>lib/Cake/Test/TestCase/Cache/CacheTest.php
<ide> public function testDecrementNonExistingConfig() {
<ide> public function testAttemptingToConfigureANonCacheEngineClass() {
<ide> $this->getMock('\StdClass', array(), array(), 'RubbishEngine');
<ide> Configure::write('Cache.wrong', array(
<del> 'engine' => __NAMESPACE__ . '\Rubbish'
<add> 'engine' => '\RubbishEngine'
<ide> ));
<ide> Cache::engine('wrong');
<ide> }
<ide>
<add>/**
<add> * Test that engine() can be used to inject instances.
<add> *
<add> * @return void
<add> */
<add> public function testSetEngineValid() {
<add> $engine = $this->getMockForAbstractClass('\Cake\Cache\CacheEngine');
<add> Cache::engine('test', $engine);
<add> $this->assertSame($engine, Cache::engine('test'));
<add> }
<add>
<ide> /**
<ide> * test that calling config() sets the 'default' configuration up.
<ide> * | 2 |
PHP | PHP | remove option that does not exist anymore | 61a54c1f5ead3d5d85d21149e21aded259d5fd00 | <ide><path>tests/TestCase/View/Helper/FormHelperTest.php
<ide> public function testInputDate() {
<ide> $this->Form->create($this->article);
<ide> $result = $this->Form->input('month_year', array(
<ide> 'label' => false,
<del> 'div' => false,
<ide> 'type' => 'date',
<ide> 'minYear' => 2006,
<ide> 'maxYear' => 2008
<ide> public function testInputDateMaxYear() {
<ide> $this->Form->create($this->article);
<ide> $result = $this->Form->input('birthday', array(
<ide> 'label' => false,
<del> 'div' => false,
<ide> 'type' => 'date',
<ide> 'minYear' => 2006,
<ide> 'maxYear' => 2008 | 1 |
Text | Text | add documentation for running multiple daemons | 3152a706c9b662eb30fd571d42a70f92584a0542 | <ide><path>docs/reference/commandline/dockerd.md
<ide> has been provided in flags and `cluster-advertise` not, `cluster-advertise`
<ide> can be added in the configuration file without accompanied by `--cluster-store`
<ide> Configuration reload will log a warning message if it detects a change in
<ide> previously configured cluster configurations.
<add>
<add>
<add>## Running multiple daemons
<add>
<add>> **Note:** Running multiple daemons on a single host is considered as "experimental". The user should be aware of
<add>> unsolved problems. This solution may not work properly in some cases. Solutions are currently under development
<add>> and will be delivered in the near future.
<add>
<add>This section describes how to run multiple Docker daemons on a single host. To
<add>run multiple daemons, you must configure each daemon so that it does not
<add>conflict with other daemons on the same host. You can set these options either
<add>by providing them as flags, or by using a [daemon configuration file](#daemon-configuration-file).
<add>
<add>The following daemon options must be configured for each daemon:
<add>
<add>```bash
<add>-b, --bridge= Attach containers to a network bridge
<add>--exec-root=/var/run/docker Root of the Docker execdriver
<add>-g, --graph=/var/lib/docker Root of the Docker runtime
<add>-p, --pidfile=/var/run/docker.pid Path to use for daemon PID file
<add>-H, --host=[] Daemon socket(s) to connect to
<add>--config-file=/etc/docker/daemon.json Daemon configuration file
<add>--tlscacert="~/.docker/ca.pem" Trust certs signed only by this CA
<add>--tlscert="~/.docker/cert.pem" Path to TLS certificate file
<add>--tlskey="~/.docker/key.pem" Path to TLS key file
<add>```
<add>
<add>When your daemons use different values for these flags, you can run them on the same host without any problems.
<add>It is very important to properly understand the meaning of those options and to use them correctly.
<add>
<add>- The `-b, --bridge=` flag is set to `docker0` as default bridge network. It is created automatically when you install Docker.
<add>If you are not using the default, you must create and configure the bridge manually or just set it to 'none': `--bridge=none`
<add>- `--exec-root` is the path where the container state is stored. The default value is `/var/run/docker`. Specify the path for
<add>your running daemon here.
<add>- `--graph` is the path where images are stored. The default value is `/var/lib/docker`. To avoid any conflict with other daemons
<add>set this parameter separately for each daemon.
<add>- `-p, --pidfile=/var/run/docker.pid` is the path where the process ID of the daemon is stored. Specify the path for your
<add>pid file here.
<add>- `--host=[]` specifies where the Docker daemon will listen for client connections. If unspecified, it defaults to `/var/run/docker.sock`.
<add>- `--config-file=/etc/docker/daemon.json` is the path where configuration file is stored. You can use it instead of
<add>daemon flags. Specify the path for each daemon.
<add>- `--tls*` Docker daemon supports `--tlsverify` mode that enforces encrypted and authenticated remote connections.
<add>The `--tls*` options enable use of specific certificates for individual daemons.
<add>
<add>Example script for a separate “bootstrap” instance of the Docker daemon without network:
<add>
<add>```bash
<add>$ docker daemon \
<add> -H unix:///var/run/docker-bootstrap.sock \
<add> -p /var/run/docker-bootstrap.pid \
<add> --iptables=false \
<add> --ip-masq=false \
<add> --bridge=none \
<add> --graph=/var/lib/docker-bootstrap \
<add> --exec-root=/var/run/docker-bootstrap
<add>``` | 1 |
Javascript | Javascript | move infinite assertions into constructors | 97556aff45969de4153e1d792076700a0f2c405e | <ide><path>dist/immutable.js
<ide> var $Iterable = Iterable;
<ide> return new ToKeyedSequence(this, true);
<ide> },
<ide> toMap: function() {
<del> assertNotInfinite(this.size);
<ide> return Map(this.toKeyedSeq());
<ide> },
<ide> toObject: function() {
<ide> var $Iterable = Iterable;
<ide> return object;
<ide> },
<ide> toOrderedMap: function() {
<del> assertNotInfinite(this.size);
<ide> return OrderedMap(this.toKeyedSeq());
<ide> },
<ide> toOrderedSet: function() {
<del> assertNotInfinite(this.size);
<ide> return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
<ide> },
<ide> toSet: function() {
<del> assertNotInfinite(this.size);
<ide> return Set(isKeyed(this) ? this.valueSeq() : this);
<ide> },
<ide> toSetSeq: function() {
<ide> var $Iterable = Iterable;
<ide> return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();
<ide> },
<ide> toStack: function() {
<del> assertNotInfinite(this.size);
<ide> return Stack(isKeyed(this) ? this.valueSeq() : this);
<ide> },
<ide> toList: function() {
<del> assertNotInfinite(this.size);
<ide> return List(isKeyed(this) ? this.valueSeq() : this);
<ide> },
<ide> toString: function() {
<ide> var $Iterable = Iterable;
<ide> return this.__iterator(ITERATE_ENTRIES);
<ide> },
<ide> every: function(predicate, context) {
<add> assertNotInfinite(this.size);
<ide> var returnValue = true;
<ide> this.__iterate((function(v, k, c) {
<ide> if (!predicate.call(context, v, k, c)) {
<ide> var $Iterable = Iterable;
<ide> return foundValue;
<ide> },
<ide> forEach: function(sideEffect, context) {
<add> assertNotInfinite(this.size);
<ide> return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
<ide> },
<ide> join: function(separator) {
<add> assertNotInfinite(this.size);
<ide> separator = separator !== undefined ? '' + separator : ',';
<ide> var joined = '';
<ide> var isFirst = true;
<ide> var $Iterable = Iterable;
<ide> return reify(this, mapFactory(this, mapper, context));
<ide> },
<ide> reduce: function(reducer, initialReduction, context) {
<add> assertNotInfinite(this.size);
<ide> var reduction;
<ide> var useFirst;
<ide> if (arguments.length < 2) {
<ide> Collection.Indexed = IndexedCollection;
<ide> Collection.Set = SetCollection;
<ide> var Map = function Map(value) {
<ide> return value === null || value === undefined ? emptyMap() : isMap(value) ? value : emptyMap().withMutations((function(map) {
<del> KeyedIterable(value).forEach((function(v, k) {
<add> var iter = KeyedIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach((function(v, k) {
<ide> return map.set(k, v);
<ide> }));
<ide> }));
<ide> var List = function List(value) {
<ide> if (isList(value)) {
<ide> return value;
<ide> }
<del> value = IndexedIterable(value);
<del> var size = value.size;
<add> var iter = IndexedIterable(value);
<add> var size = iter.size;
<ide> if (size === 0) {
<ide> return empty;
<ide> }
<add> assertNotInfinite(size);
<ide> if (size > 0 && size < SIZE) {
<del> return makeList(0, size, SHIFT, null, new VNode(value.toArray()));
<add> return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
<ide> }
<ide> return empty.withMutations((function(list) {
<ide> list.setSize(size);
<del> value.forEach((function(v, i) {
<add> iter.forEach((function(v, i) {
<ide> return list.set(i, v);
<ide> }));
<ide> }));
<ide> function getTailOffset(size) {
<ide> }
<ide> var OrderedMap = function OrderedMap(value) {
<ide> return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations((function(map) {
<del> KeyedIterable(value).forEach((function(v, k) {
<add> var iter = KeyedIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach((function(v, k) {
<ide> return map.set(k, v);
<ide> }));
<ide> }));
<ide> var $Stack = Stack;
<ide> if (iter.size === 0) {
<ide> return this;
<ide> }
<add> assertNotInfinite(iter.size);
<ide> var newSize = this.size;
<ide> var head = this._head;
<ide> iter.reverse().forEach((function(value) {
<ide> function emptyStack() {
<ide> }
<ide> var Set = function Set(value) {
<ide> return value === null || value === undefined ? emptySet() : isSet(value) ? value : emptySet().withMutations((function(set) {
<del> SetIterable(value).forEach((function(v) {
<add> var iter = SetIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach((function(v) {
<ide> return set.add(v);
<ide> }));
<ide> }));
<ide> function emptySet() {
<ide> }
<ide> var OrderedSet = function OrderedSet(value) {
<ide> return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations((function(set) {
<del> SetIterable(value).forEach((function(v) {
<add> var iter = SetIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach((function(v) {
<ide> return set.add(v);
<ide> }));
<ide> }));
<ide><path>dist/immutable.min.js
<ide> return new Hr(function(){for(;e>s;)s++,u.next();var t=u.next();return r||n===Tr?
<ide> })},r}function Le(t,e,r){e||(e=Ne);var n=x(t),i=0,u=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return u.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),n?sn(u):E(t)?an(u):cn(u)}function Te(t,e,r){if(e||(e=Ne),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return e(r[1],t[1])>0?r:t});return n&&n[0]}return t.reduce(function(t,r){return e(r,t)>0?r:t})}function Be(t,e){return V(t)?e:t.constructor(e)}function We(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Je(t){return h(t.size),c(t)}function Pe(t){return x(t)?$r:E(t)?en:rn}function He(t){return Object.create((x(t)?sn:E(t)?an:cn).prototype)}function Ve(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):nn.prototype.cacheResult.call(this)}function Ne(t,e){return t>e?1:e>t?-1:0}function Ye(t){return!(!t||!t[Qn])}function Qe(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===o?a&&a.array:t&&t.array,i=r>u?0:u-r,h=s-r;return h>br&&(h=br),function(){if(i===h)return $n;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var o,a=t&&t.array,h=i>u?0:u-i>>n,c=(s-i>>n)+1;return c>br&&(c=br),function(){for(;;){if(o){var t=o();if(t!==$n)return t;o=null}if(h===c)return $n;var u=e?--c:h++;o=r(a&&a[u],n-Ir,i+(u<<n))}}}var u=t._origin,s=t._capacity,o=nr(s),a=t._tail;return r(t._root,t._level,0)}function Xe(t,e,r,n,i,u,s){var o=Object.create(Xn);return o.size=e-t,o._origin=t,o._capacity=e,o._level=r,o._root=n,o._tail=i,o.__ownerID=u,o.__hash=s,o.__altered=!1,o}function Fe(){return Zn||(Zn=Xe(0,0,Ir))}function Ge(t,e,r){if(e=f(t,e),e>=t.size||0>e)return t.withMutations(function(t){0>e?er(t,e).set(0,r):er(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,i=t._root,s=u(Or);return e>=nr(t._capacity)?n=Ze(n,t.__ownerID,0,e,r,s):i=Ze(i,t.__ownerID,t._level,e,r,s),s.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Xe(t._origin,t._capacity,t._level,i,n):t
<ide> }function Ze(t,e,r,n,i,u){var o=n>>>r&qr,a=t&&t.array.length>o;if(!a&&void 0===i)return t;var h;if(r>0){var c=t&&t.array[o],f=Ze(c,e,r-Ir,n,i,u);return f===c?t:(h=$e(t,e),h.array[o]=f,h)}return a&&t.array[o]===i?t:(s(u),h=$e(t,e),void 0===i&&o===h.array.length-1?h.array.pop():h.array[o]=i,h)}function $e(t,e){return e&&t&&e===t.ownerID?t:new Fn(t?t.array.slice():[],e)}function tr(t,e){if(e>=nr(t._capacity))return t._tail;if(1<<t._level+Ir>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&qr],n-=Ir;return r}}function er(t,e,r){var n=t.__ownerID||new o,i=t._origin,u=t._capacity,s=i+e,a=void 0===r?u:0>r?u+r:i+r;if(s===i&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new Fn(c&&c.array.length?[void 0,c]:[],n),h+=Ir,f+=1<<h;f&&(s+=f,i+=f,a+=f,u+=f);for(var _=nr(u),l=nr(a);l>=1<<h+Ir;)c=new Fn(c&&c.array.length?[c]:[],n),h+=Ir;var v=t._tail,p=_>l?tr(t,a-1):l>_?new Fn([],n):v;if(v&&l>_&&u>s&&v.array.length){c=$e(c,n);for(var d=c,y=h;y>Ir;y-=Ir){var m=_>>>y&qr;d=d.array[m]=$e(d.array[m],n)}d.array[_>>>Ir&qr]=v}if(u>a&&(p=p&&p.removeAfter(n,0,a)),s>=l)s-=l,a-=l,h=Ir,c=null,p=p&&p.removeBefore(n,0,s);else if(s>i||_>l){for(f=0;c;){var g=s>>>h&qr;if(g!==l>>>h&qr)break;g&&(f+=(1<<h)*g),h-=Ir,c=c.array[g]}c&&s>i&&(c=c.removeBefore(n,h,s-f)),c&&_>l&&(c=c.removeAfter(n,h,l-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=c,t._tail=p,t.__hash=void 0,t.__altered=!0,t):Xe(s,a,h,c,p)}function rr(t,e,r){for(var n=[],i=0,u=0;r.length>u;u++){var s=r[u],o=en(s);o.size>i&&(i=o.size),k(s)||(o=o.map(function(t){return te(t)})),n.push(o)}return i>t.size&&(t=t.setSize(i)),me(t,e,n)}function nr(t){return br>t?0:t-1>>>Ir<<Ir}function ir(t){return ie(t)&&C(t)}function ur(t,e,r,n){var i=Object.create(ti.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function sr(){return ei||(ei=ur(ae(),Fe()))}function or(t,e,r){var n,i,u=t._map,s=t._list,o=u.get(e),a=void 0!==o;if(r===Mr){if(!a)return t;s.size>=br&&s.size>=2*u.size?(i=s.filter(function(t,e){return void 0!==t&&o!==e
<ide> }),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=u.remove(e),i=o===s.size-1?s.pop():s.set(o,void 0))}else if(a){if(r===s.get(o)[1])return t;n=u,i=s.set(o,[e,r])}else n=u.set(e,s.size),i=s.set(s.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):ur(n,i)}function ar(t){return!(!t||!t[ii])}function hr(t,e,r,n){var i=Object.create(ui);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function cr(){return si||(si=hr(0))}function fr(t){return!(!t||!t[ai])}function _r(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function lr(t,e){var r=Object.create(hi);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function vr(){return ci||(ci=lr(ae()))}function pr(t){return fr(t)&&C(t)}function dr(t,e){var r=Object.create(_i);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function yr(){return li||(li=dr(sr()))}function mr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function gr(t){return t._name||t.constructor.name}var wr=Object,Sr={};Sr.createClass=t,Sr.superCall=e,Sr.defaultSuperCall=r;var zr="delete",Ir=5,br=1<<Ir,qr=br-1,Mr={},Dr={value:!1},Or={value:!1},kr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},xr=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),Er="function"==typeof WeakMap&&new WeakMap,Ar=0,Cr="__immutablehash__";"function"==typeof Symbol&&(Cr=Symbol(Cr));var jr=16,Kr=255,Rr=0,Ur={},Lr=0,Tr=1,Br=2,Wr="@@iterator",Jr="function"==typeof Symbol&&Symbol.iterator,Pr=Jr||Wr,Hr=function(t){this.next=t};Sr.createClass(Hr,{toString:function(){return"[Iterator]"}},{}),Hr.KEYS=Lr,Hr.VALUES=Tr,Hr.ENTRIES=Br;var Vr=Hr.prototype;Vr.inspect=Vr.toSource=function(){return""+this},Vr[Pr]=function(){return this};var Nr=function(t){return k(t)?t:nn(t)},Yr=Nr;Sr.createClass(Nr,{toArray:function(){h(this.size);
<del>var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new Hn(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toKeyedSeq:function(){return new Pn(this,!0)},toMap:function(){return h(this.size),qn(this.toKeyedSeq())},toObject:function(){h(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return h(this.size),ti(this.toKeyedSeq())},toOrderedSet:function(){return h(this.size),fi(x(this)?this.valueSeq():this)},toSet:function(){return h(this.size),oi(x(this)?this.valueSeq():this)},toSetSeq:function(){return new Vn(this)},toSeq:function(){return E(this)?this.toIndexedSeq():x(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return h(this.size),ri(x(this)?this.valueSeq():this)},toList:function(){return h(this.size),Yn(x(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Be(this,je(this,t))},contains:function(t){return this.some(function(e){return n(e,t)})},entries:function(){return this.__iterator(Br)},every:function(t,e){var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return Be(this,De(this,t,e,!0))},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},join:function(t){t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(Lr)},map:function(t,e){return Be(this,qe(this,t,e))},reduce:function(t,e,r){var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,s){i?(i=!1,n=e):n=t.call(r,n,e,u,s)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();
<del>return t.reduce.apply(t,arguments)},reverse:function(){return Be(this,Me(this,!0))},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(r!==r||n!==n)return this.toSeq().cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return Be(this,void 0===n||n===this.size?i:i.take(n-r))},some:function(t,e){return!this.every(R(t),e)},sort:function(t){return Be(this,Le(this,t))},values:function(){return this.__iterator(Tr)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return Oe(this,t,e)},equals:function(t){return B(this,t)},entrySeq:function(){var t=this;if(t._cache)return new ln(t._cache);var e=t.toSeq().map(K).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(R(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(_)},flatMap:function(t,e){return Be(this,Re(this,t,e))},flatten:function(t){return Be(this,Ke(this,t,!0))},fromEntrySeq:function(){return new Nn(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)},void 0,e)},getIn:function(t,e){var r=this;if(t)for(var n,i=D(t)||D(Yr(t));!(n=i.next()).done;){var u=n.value;if(r=r&&r.get?r.get(u,Mr):Mr,r===Mr)return e}return r},groupBy:function(t,e){return ke(this,t,e)},has:function(t){return this.get(t,Mr)!==Mr},hasIn:function(t){return this.getIn(t,Mr)!==Mr},isSubset:function(t){return t="function"==typeof t.contains?t:Yr(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(j).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Te(this,t)},maxBy:function(t,e){return Te(this,e,t)},min:function(t){return Te(this,t?U(t):T)},minBy:function(t,e){return Te(this,e?U(e):T,t)},rest:function(){return this.slice(1)},skip:function(t){return Be(this,Ae(this,t,!0))},skipLast:function(t){return Be(this,this.toSeq().reverse().skip(t).reverse())
<add>var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new Hn(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toKeyedSeq:function(){return new Pn(this,!0)},toMap:function(){return qn(this.toKeyedSeq())},toObject:function(){h(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return ti(this.toKeyedSeq())},toOrderedSet:function(){return fi(x(this)?this.valueSeq():this)},toSet:function(){return oi(x(this)?this.valueSeq():this)},toSetSeq:function(){return new Vn(this)},toSeq:function(){return E(this)?this.toIndexedSeq():x(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return ri(x(this)?this.valueSeq():this)},toList:function(){return Yn(x(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Be(this,je(this,t))},contains:function(t){return this.some(function(e){return n(e,t)})},entries:function(){return this.__iterator(Br)},every:function(t,e){h(this.size);var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return Be(this,De(this,t,e,!0))},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return h(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){h(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(Lr)},map:function(t,e){return Be(this,qe(this,t,e))},reduce:function(t,e,r){h(this.size);var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,s){i?(i=!1,n=e):n=t.call(r,n,e,u,s)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)
<add>},reverse:function(){return Be(this,Me(this,!0))},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(r!==r||n!==n)return this.toSeq().cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return Be(this,void 0===n||n===this.size?i:i.take(n-r))},some:function(t,e){return!this.every(R(t),e)},sort:function(t){return Be(this,Le(this,t))},values:function(){return this.__iterator(Tr)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return Oe(this,t,e)},equals:function(t){return B(this,t)},entrySeq:function(){var t=this;if(t._cache)return new ln(t._cache);var e=t.toSeq().map(K).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(R(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(_)},flatMap:function(t,e){return Be(this,Re(this,t,e))},flatten:function(t){return Be(this,Ke(this,t,!0))},fromEntrySeq:function(){return new Nn(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)},void 0,e)},getIn:function(t,e){var r=this;if(t)for(var n,i=D(t)||D(Yr(t));!(n=i.next()).done;){var u=n.value;if(r=r&&r.get?r.get(u,Mr):Mr,r===Mr)return e}return r},groupBy:function(t,e){return ke(this,t,e)},has:function(t){return this.get(t,Mr)!==Mr},hasIn:function(t){return this.getIn(t,Mr)!==Mr},isSubset:function(t){return t="function"==typeof t.contains?t:Yr(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(j).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Te(this,t)},maxBy:function(t,e){return Te(this,e,t)},min:function(t){return Te(this,t?U(t):T)},minBy:function(t,e){return Te(this,e?U(e):T,t)},rest:function(){return this.slice(1)},skip:function(t){return Be(this,Ae(this,t,!0))},skipLast:function(t){return Be(this,this.toSeq().reverse().skip(t).reverse())
<ide> },skipWhile:function(t,e){return Be(this,Ce(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(R(t),e)},sortBy:function(t,e){return Be(this,Le(this,e,t))},take:function(t){return Be(this,xe(this,t))},takeLast:function(t){return Be(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Be(this,Ee(this,t,e))},takeUntil:function(t,e){return this.takeWhile(R(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=W(this))}},{});var Qr="",Xr="",Fr="",Gr="",Zr=Nr.prototype;Zr[Qr]=!0,Zr[Pr]=Zr.values,Zr.toJSON=Zr.toJS,Zr.__toJS=Zr.toArray,Zr.__toStringMapper=L,Zr.inspect=Zr.toSource=function(){return""+this},Zr.chain=Zr.flatMap,function(){try{Object.defineProperty(Zr,"length",{get:function(){if(!Nr.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}();var $r=function(t){return x(t)?t:sn(t)};Sr.createClass($r,{flip:function(){return Be(this,be(this))},findKey:function(t,e){var r;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?(r=i,!1):void 0}),r},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return n(e,t)})},lastKeyOf:function(t){return this.toSeq().reverse().keyOf(t)},mapEntries:function(t,e){var r=this,n=0;return Be(this,this.toSeq().map(function(i,u){return t.call(e,[u,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Be(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}},{},Nr);var tn=$r.prototype;tn[Xr]=!0,tn[Pr]=Zr.entries,tn.__toJS=Zr.toObject,tn.__toStringMapper=function(t,e){return e+": "+L(t)};var en=function(t){return E(t)?t:an(t)};Sr.createClass(en,{toKeyedSeq:function(){return new Pn(this,!1)
<ide> },filter:function(t,e){return Be(this,De(this,t,e,!1))},findIndex:function(t,e){var r=this.toKeyedSeq().findKey(t,e);return void 0===r?-1:r},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Be(this,Me(this,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=v(t,this.size);var n=this.slice(0,t);return Be(this,1===r?n:n.concat(a(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return Be(this,Ke(this,t,!1))},get:function(t,e){return t=f(this,t),0>t||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=f(this,t),t>=0&&(void 0!==this.size?1/0===this.size||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return Be(this,Ue(this,t))},last:function(){return this.get(-1)},skip:function(t){var e=this,r=Ae(e,t,!1);return V(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0?e.get(r+t,n):n}),Be(this,r)},skipWhile:function(t,e){return Be(this,Ce(this,t,e,!1))},take:function(t){var e=this,r=xe(e,t);return V(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0&&t>r?e.get(r,n):n}),Be(this,r)}},{},Nr),en.prototype[Fr]=!0,en.prototype[Gr]=!0;var rn=function(t){return k(t)&&!A(t)?t:cn(t)};Sr.createClass(rn,{get:function(t,e){return this.has(t)?t:e},contains:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}},{},Nr),rn.prototype.has=Zr.contains,Nr.isIterable=k,Nr.isKeyed=x,Nr.isIndexed=E,Nr.isAssociative=A,Nr.isOrdered=C,Nr.Keyed=$r,Nr.Indexed=en,Nr.Set=rn,Nr.Iterator=Hr;var nn=function(t){return null===t||void 0===t?N():k(t)?t.toSeq():X(t)},un=nn;Sr.createClass(nn,{toSeq:function(){return this},toString:function(){return this.__toString("Seq {","}")},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this
<ide> },__iterate:function(t,e){return Z(this,t,e,!0)},__iterator:function(t,e){return $(this,t,e,!0)}},{of:function(){return un(arguments)}},Nr);var sn=function(t){return null===t||void 0===t?N().toKeyedSeq():k(t)?x(t)?t.toSeq():t.fromEntrySeq():Y(t)},on=sn;Sr.createClass(sn,{toKeyedSeq:function(){return this},toSeq:function(){return this}},{of:function(){return on(arguments)}},nn),H(sn,$r.prototype);var an=function(t){return null===t||void 0===t?N():k(t)?x(t)?t.entrySeq():t.toIndexedSeq():Q(t)},hn=an;Sr.createClass(an,{toIndexedSeq:function(){return this},toString:function(){return this.__toString("Seq [","]")},__iterate:function(t,e){return Z(this,t,e,!1)},__iterator:function(t,e){return $(this,t,e,!1)}},{of:function(){return hn(arguments)}},nn),H(an,en.prototype);var cn=function(t){return(null===t||void 0===t?N():k(t)?x(t)?t.entrySeq():t:Q(t)).toSetSeq()},fn=cn;Sr.createClass(cn,{toSetSeq:function(){return this}},{of:function(){return fn(arguments)}},nn),H(cn,rn.prototype),nn.isSeq=V,nn.Keyed=sn,nn.Set=cn,nn.Indexed=an;var _n="";nn.prototype[_n]=!0;var ln=function(t){this._array=t,this.size=t.length};Sr.createClass(ln,{get:function(t,e){return this.has(t)?this._array[f(this,t)]:e},__iterate:function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},__iterator:function(t,e){var r=this._array,n=r.length-1,i=0;return new Hr(function(){return i>n?b():I(t,i,r[e?n-i++:i++])})}},{},an);var vn=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length};Sr.createClass(vn,{get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,u=0;i>=u;u++){var s=n[e?i-u:u];if(t(r[s],s,this)===!1)return u+1}return u},__iterator:function(t,e){var r=this._object,n=this._keys,i=n.length-1,u=0;return new Hr(function(){var s=n[e?i-u:u];return u++>i?b():I(t,s,r[s])})}},{},sn),vn.prototype[Gr]=!0;var pn=function(t){this._iterable=t,this.size=t.length||t.size
<del>};Sr.createClass(pn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(M(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!M(n))return new Hr(b);var i=0;return new Hr(function(){var e=n.next();return e.done?e:I(t,i++,e.value)})}},{},an);var dn=function(t){this._iterator=t,this._iteratorCache=[]};Sr.createClass(dn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var s=u.value;if(n[i]=s,t(s,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new Hr(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return I(t,i,n[i++])})}},{},an);var yn,mn=function(){throw TypeError("Abstract")};Sr.createClass(mn,{},{},Nr);var gn=function(){Sr.defaultSuperCall(this,wn.prototype,arguments)},wn=gn;Sr.createClass(gn,{},{},mn),H(gn,$r.prototype);var Sn=function(){Sr.defaultSuperCall(this,zn.prototype,arguments)},zn=Sn;Sr.createClass(Sn,{},{},mn),H(Sn,en.prototype);var In=function(){Sr.defaultSuperCall(this,bn.prototype,arguments)},bn=In;Sr.createClass(In,{},{},mn),H(In,rn.prototype),mn.Keyed=gn,mn.Indexed=Sn,mn.Set=In;var qn=function(t){return null===t||void 0===t?ae():ie(t)?t:ae().withMutations(function(e){$r(t).forEach(function(t,r){return e.set(r,t)})})};Sr.createClass(qn,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,void 0,t,e):e},set:function(t,e){return he(this,t,e)},setIn:function(t,e){return this.updateIn(t,Mr,function(){return e})},remove:function(t){return he(this,t,Mr)},removeIn:function(t){return this.updateIn(t,function(){return Mr})},update:function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)
<add>};Sr.createClass(pn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(M(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!M(n))return new Hr(b);var i=0;return new Hr(function(){var e=n.next();return e.done?e:I(t,i++,e.value)})}},{},an);var dn=function(t){this._iterator=t,this._iteratorCache=[]};Sr.createClass(dn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var s=u.value;if(n[i]=s,t(s,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new Hr(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return I(t,i,n[i++])})}},{},an);var yn,mn=function(){throw TypeError("Abstract")};Sr.createClass(mn,{},{},Nr);var gn=function(){Sr.defaultSuperCall(this,wn.prototype,arguments)},wn=gn;Sr.createClass(gn,{},{},mn),H(gn,$r.prototype);var Sn=function(){Sr.defaultSuperCall(this,zn.prototype,arguments)},zn=Sn;Sr.createClass(Sn,{},{},mn),H(Sn,en.prototype);var In=function(){Sr.defaultSuperCall(this,bn.prototype,arguments)},bn=In;Sr.createClass(In,{},{},mn),H(In,rn.prototype),mn.Keyed=gn,mn.Indexed=Sn,mn.Set=In;var qn=function(t){return null===t||void 0===t?ae():ie(t)?t:ae().withMutations(function(e){var r=$r(t);h(r.size),r.forEach(function(t,r){return e.set(r,t)})})};Sr.createClass(qn,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,void 0,t,e):e},set:function(t,e){return he(this,t,e)},setIn:function(t,e){return this.updateIn(t,Mr,function(){return e})},remove:function(t){return he(this,t,Mr)},removeIn:function(t){return this.updateIn(t,function(){return Mr})},update:function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)
<ide> },updateIn:function(t,e,r){r||(r=e,e=void 0);var n=ge(this,D(t)||D(Nr(t)),e,r);return n===Mr?void 0:n},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ae()},merge:function(){return de(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return de(this,t,e)},mergeIn:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return this.updateIn(t,ae(),function(t){return t.merge.apply(t,e)})},mergeDeep:function(){return de(this,ye(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return de(this,ye(t),e)},mergeDeepIn:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return this.updateIn(t,ae(),function(t){return t.mergeDeep.apply(t,e)})},sort:function(t){return ti(Le(this,t))},sortBy:function(t,e){return ti(Le(this,e,t))},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new o)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},__iterator:function(t,e){return new Ln(this,t,e)},__iterate:function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?oe(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{},gn),qn.isMap=ie;var Mn="",Dn=qn.prototype;Dn[Mn]=!0,Dn[zr]=Dn.remove;var On=function(t,e){this.ownerID=t,this.entries=e},kn=On;Sr.createClass(On,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){for(var c=u===Mr,f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),!c||1!==f.length){if(!v&&!c&&f.length>=Bn)return le(t,f,i,u);
<ide> var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new kn(t,d)}}},{});var xn=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r},En=xn;Sr.createClass(xn,{get:function(t,e,r,n){void 0===e&&(e=m(r));var i=1<<((0===t?e:e>>>t)&qr),u=this.bitmap;return 0===(u&i)?n:this.nodes[we(u&i-1)].get(t+Ir,e,r,n)},update:function(t,e,r,n,i,u,s){void 0===r&&(r=m(n));var o=(0===e?r:r>>>e)&qr,a=1<<o,h=this.bitmap,c=0!==(h&a);if(!c&&i===Mr)return this;var f=we(h&a-1),_=this.nodes,l=c?_[f]:void 0,v=ce(l,t,e+Ir,r,n,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=Wn)return pe(t,_,h,o,v);if(c&&!v&&2===_.length&&fe(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&fe(v))return v;var p=t&&t===this.ownerID,d=c?v?h:h^a:h|a,y=c?v?Se(_,f,v,p):Ie(_,f,p):ze(_,f,v,p);return p?(this.bitmap=d,this.nodes=y,this):new En(t,d,y)}},{});var An=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r},Cn=An;Sr.createClass(An,{get:function(t,e,r,n){void 0===e&&(e=m(r));var i=(0===t?e:e>>>t)&qr,u=this.nodes[i];return u?u.get(t+Ir,e,r,n):n},update:function(t,e,r,n,i,u,s){void 0===r&&(r=m(n));var o=(0===e?r:r>>>e)&qr,a=i===Mr,h=this.nodes,c=h[o];if(a&&!c)return this;var f=ce(c,t,e+Ir,r,n,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Jn>_))return ve(t,h,_,o)}else _++;var l=t&&t===this.ownerID,v=Se(h,o,f,l);return l?(this.count=_,this.nodes=v,this):new Cn(t,_,v)}},{});var jn=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r},Kn=jn;Sr.createClass(jn,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){void 0===r&&(r=m(i));var c=u===Mr;if(r!==this.keyHash)return c?this:(s(h),s(o),_e(this,t,e,r,[i,u]));for(var f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),c&&2===l)return new Rn(t,this.keyHash,f[1^_]);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new Kn(t,this.keyHash,d)
<ide> }},{});var Rn=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r},Un=Rn;Sr.createClass(Rn,{get:function(t,e,r,i){return n(r,this.entry[0])?this.entry[1]:i},update:function(t,e,r,i,u,o,a){var h=u===Mr,c=n(i,this.entry[0]);return(c?u===this.entry[1]:h)?this:(s(a),h?void s(o):c?t&&t===this.ownerID?(this.entry[1]=u,this):new Un(t,this.keyHash,[i,u]):(s(o),_e(this,t,e,m(i),[i,u])))}},{}),On.prototype.iterate=jn.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},xn.prototype.iterate=An.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var u=r[e?i-n:n];if(u&&u.iterate(t,e)===!1)return!1}},Rn.prototype.iterate=function(t){return t(this.entry)};var Ln=function(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&se(t._root)};Sr.createClass(Ln,{next:function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return ue(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return ue(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var u=n.nodes[this._reverse?r-i:i];if(u){if(u.entry)return ue(t,u.entry);e=this._stack=se(u,e)}continue}e=this._stack=this._stack.__prev}return b()}},{},Hr);var Tn,Bn=br/4,Wn=br/2,Jn=br/4,Pn=function(t,e){this._iter=t,this._useKeys=e,this.size=t.size};Sr.createClass(Pn,{get:function(t,e){return this._iter.get(t,e)},has:function(t){return this._iter.has(t)},valueSeq:function(){return this._iter.valueSeq()},reverse:function(){var t=this,e=Me(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},map:function(t,e){var r=this,n=qe(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},__iterate:function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?Je(this):0,function(i){return t(i,e?--r:r++,n)}),e)},__iterator:function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(Tr,e),n=e?Je(this):0;
<del>return new Hr(function(){var i=r.next();return i.done?i:I(t,e?--n:n++,i.value,i)})}},{},sn),Pn.prototype[Gr]=!0;var Hn=function(t){this._iter=t,this.size=t.size};Sr.createClass(Hn,{contains:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Tr,e),n=0;return new Hr(function(){var e=r.next();return e.done?e:I(t,n++,e.value,e)})}},{},an);var Vn=function(t){this._iter=t,this.size=t.size};Sr.createClass(Vn,{has:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Tr,e);return new Hr(function(){var e=r.next();return e.done?e:I(t,e.value,e.value,e)})}},{},cn);var Nn=function(t){this._iter=t,this.size=t.size};Sr.createClass(Nn,{entrySeq:function(){return this._iter.toSeq()},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(We(e),t(e[1],e[0],r)):void 0},e)},__iterator:function(t,e){var r=this._iter.__iterator(Tr,e);return new Hr(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return We(n),t===Br?e:I(t,n[0],n[1],e)}})}},{},sn),Hn.prototype.cacheResult=Pn.prototype.cacheResult=Vn.prototype.cacheResult=Nn.prototype.cacheResult=Ve;var Yn=function(t){var e=Fe();if(null===t||void 0===t)return e;if(Ye(t))return t;t=en(t);var r=t.size;return 0===r?e:r>0&&br>r?Xe(0,r,Ir,null,new Fn(t.toArray())):e.withMutations(function(e){e.setSize(r),t.forEach(function(t,r){return e.set(r,t)})})};Sr.createClass(Yn,{toString:function(){return this.__toString("List [","]")},get:function(t,e){if(t=f(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=tr(this,t);return r&&r.array[t&qr]},set:function(t,e){return Ge(this,t,e)},remove:function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Ir,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Fe()
<add>return new Hr(function(){var i=r.next();return i.done?i:I(t,e?--n:n++,i.value,i)})}},{},sn),Pn.prototype[Gr]=!0;var Hn=function(t){this._iter=t,this.size=t.size};Sr.createClass(Hn,{contains:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Tr,e),n=0;return new Hr(function(){var e=r.next();return e.done?e:I(t,n++,e.value,e)})}},{},an);var Vn=function(t){this._iter=t,this.size=t.size};Sr.createClass(Vn,{has:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Tr,e);return new Hr(function(){var e=r.next();return e.done?e:I(t,e.value,e.value,e)})}},{},cn);var Nn=function(t){this._iter=t,this.size=t.size};Sr.createClass(Nn,{entrySeq:function(){return this._iter.toSeq()},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(We(e),t(e[1],e[0],r)):void 0},e)},__iterator:function(t,e){var r=this._iter.__iterator(Tr,e);return new Hr(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return We(n),t===Br?e:I(t,n[0],n[1],e)}})}},{},sn),Hn.prototype.cacheResult=Pn.prototype.cacheResult=Vn.prototype.cacheResult=Nn.prototype.cacheResult=Ve;var Yn=function(t){var e=Fe();if(null===t||void 0===t)return e;if(Ye(t))return t;var r=en(t),n=r.size;return 0===n?e:(h(n),n>0&&br>n?Xe(0,n,Ir,null,new Fn(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))};Sr.createClass(Yn,{toString:function(){return this.__toString("List [","]")},get:function(t,e){if(t=f(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=tr(this,t);return r&&r.array[t&qr]},set:function(t,e){return Ge(this,t,e)},remove:function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Ir,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Fe()
<ide> },push:function(){var t=arguments,e=this.size;return this.withMutations(function(r){er(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return er(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){er(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return er(this,1)},merge:function(){return rr(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return rr(this,t,e)},mergeDeep:function(){return rr(this,ye(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return rr(this,ye(t),e)},setSize:function(t){return er(this,0,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:er(this,v(t,r),p(e,r))},__iterator:function(t,e){var r=0,n=Qe(this,e);return new Hr(function(){var e=n();return e===$n?b():I(t,r++,e)})},__iterate:function(t,e){for(var r,n=0,i=Qe(this,e);(r=i())!==$n&&t(r,n++,this)!==!1;);return n},__ensureOwner:function(t){return t===this.__ownerID?this:t?Xe(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{of:function(){return this(arguments)}},Sn),Yn.isList=Ye;var Qn="",Xn=Yn.prototype;Xn[Qn]=!0,Xn[zr]=Xn.remove,Xn.setIn=Dn.setIn,Xn.removeIn=Dn.removeIn,Xn.update=Dn.update,Xn.updateIn=Dn.updateIn,Xn.mergeIn=Dn.mergeIn,Xn.mergeDeepIn=Dn.mergeDeepIn,Xn.withMutations=Dn.withMutations,Xn.asMutable=Dn.asMutable,Xn.asImmutable=Dn.asImmutable,Xn.wasAltered=Dn.wasAltered;var Fn=function(t,e){this.array=t,this.ownerID=e},Gn=Fn;Sr.createClass(Fn,{removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&qr;if(n>=this.array.length)return new Gn([],t);var i,u=0===n;if(e>0){var s=this.array[n];if(i=s&&s.removeBefore(t,e-Ir,r),i===s&&u)return this}if(u&&!i)return this;var o=$e(this,t);if(!u)for(var a=0;n>a;a++)o.array[a]=void 0;return i&&(o.array[n]=i),o},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;
<del>var n=r-1>>>e&qr;if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var s=this.array[n];if(i=s&&s.removeAfter(t,e-Ir,r),i===s&&u)return this}if(u&&!i)return this;var o=$e(this,t);return u||o.array.pop(),i&&(o.array[n]=i),o}},{});var Zn,$n={},ti=function(t){return null===t||void 0===t?sr():ir(t)?t:sr().withMutations(function(e){$r(t).forEach(function(t,r){return e.set(r,t)})})};Sr.createClass(ti,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):sr()},set:function(t,e){return or(this,t,e)},remove:function(t){return or(this,t,Mr)},wasAltered:function(){return this._map.wasAltered()||this._list.wasAltered()},__iterate:function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?ur(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)}},{of:function(){return this(arguments)}},qn),ti.isOrderedMap=ir,ti.prototype[Gr]=!0,ti.prototype[zr]=ti.prototype.remove;var ei,ri=function(t){return null===t||void 0===t?cr():ar(t)?t:cr().unshiftAll(t)},ni=ri;Sr.createClass(ri,{toString:function(){return this.__toString("Stack [","]")},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):hr(t,e)},pushAll:function(t){if(t=en(t),0===t.size)return this;var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}
<del>}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):hr(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):cr()},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(n!==this.size)return Sr.superCall(this,ni.prototype,"slice",[t,e]);for(var i=this.size-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.size=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):hr(i,u)},__ensureOwner:function(t){return t===this.__ownerID?this:t?hr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterate:function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iterator:function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new Hr(function(){if(n){var e=n.value;return n=n.next,I(t,r++,e)}return b()})}},{of:function(){return this(arguments)}},Sn),ri.isStack=ar;var ii="",ui=ri.prototype;ui[ii]=!0,ui.withMutations=Dn.withMutations,ui.asMutable=Dn.asMutable,ui.asImmutable=Dn.asImmutable,ui.wasAltered=Dn.wasAltered;var si,oi=function(t){return null===t||void 0===t?vr():fr(t)?t:vr().withMutations(function(e){rn(t).forEach(function(t){return e.add(t)})})};Sr.createClass(oi,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},add:function(t){return _r(this,this._map.set(t,!0))},remove:function(t){return _r(this,this._map.remove(t))},clear:function(){return _r(this,this._map.clear())},union:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0===this.size&&1===t.length?this.constructor(t[0]):this.withMutations(function(e){for(var r=0;t.length>r;r++)rn(t[r]).forEach(function(t){return e.add(t)
<del>})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return rn(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return rn(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},sort:function(t){return fi(Le(this,t))},sortBy:function(t,e){return fi(Le(this,e,t))},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)}},{of:function(){return this(arguments)},fromKeys:function(t){return this($r(t).keySeq())}},In),oi.isSet=fr;var ai="",hi=oi.prototype;hi[ai]=!0,hi[zr]=hi.remove,hi.mergeDeep=hi.merge,hi.mergeDeepWith=hi.mergeWith,hi.withMutations=Dn.withMutations,hi.asMutable=Dn.asMutable,hi.asImmutable=Dn.asImmutable,hi.__empty=vr,hi.__make=lr;var ci,fi=function(t){return null===t||void 0===t?yr():pr(t)?t:yr().withMutations(function(e){rn(t).forEach(function(t){return e.add(t)})})};Sr.createClass(fi,{toString:function(){return this.__toString("OrderedSet {","}")}},{of:function(){return this(arguments)},fromKeys:function(t){return this($r(t).keySeq())}},oi),fi.isOrderedSet=pr;var _i=fi.prototype;_i[Gr]=!0,_i.__empty=yr,_i.__make=dr;var li,vi=function(t,e){var r=function(t){return this instanceof r?void(this._map=qn(t)):new r(t)},n=Object.keys(t),u=r.prototype=Object.create(pi);
<del>u.constructor=r,e&&(u._name=e),u._defaultValues=t,u._keys=n,u.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){i(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(s){}return r};Sr.createClass(vi,{toString:function(){return this.__toString(gr(this)+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},clear:function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=mr(this,ae()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+gr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:mr(this,r)},remove:function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:mr(this,e)},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){var r=this;return $r(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},__iterate:function(t,e){var r=this;return $r(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?mr(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},gn);var pi=vi.prototype;pi[zr]=pi.remove,pi.merge=Dn.merge,pi.mergeWith=Dn.mergeWith,pi.mergeIn=Dn.mergeIn,pi.mergeDeep=Dn.mergeDeep,pi.mergeDeepWith=Dn.mergeDeepWith,pi.mergeDeepIn=Dn.mergeDeepIn,pi.setIn=Dn.setIn,pi.update=Dn.update,pi.updateIn=Dn.updateIn,pi.withMutations=Dn.withMutations,pi.asMutable=Dn.asMutable,pi.asImmutable=Dn.asImmutable;var di=function(t,e,r){return this instanceof yi?(i(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),t===e&&gi?gi:(r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.size=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new yi(t,e,r)
<add>var n=r-1>>>e&qr;if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var s=this.array[n];if(i=s&&s.removeAfter(t,e-Ir,r),i===s&&u)return this}if(u&&!i)return this;var o=$e(this,t);return u||o.array.pop(),i&&(o.array[n]=i),o}},{});var Zn,$n={},ti=function(t){return null===t||void 0===t?sr():ir(t)?t:sr().withMutations(function(e){var r=$r(t);h(r.size),r.forEach(function(t,r){return e.set(r,t)})})};Sr.createClass(ti,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):sr()},set:function(t,e){return or(this,t,e)},remove:function(t){return or(this,t,Mr)},wasAltered:function(){return this._map.wasAltered()||this._list.wasAltered()},__iterate:function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?ur(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)}},{of:function(){return this(arguments)}},qn),ti.isOrderedMap=ir,ti.prototype[Gr]=!0,ti.prototype[zr]=ti.prototype.remove;var ei,ri=function(t){return null===t||void 0===t?cr():ar(t)?t:cr().unshiftAll(t)},ni=ri;Sr.createClass(ri,{toString:function(){return this.__toString("Stack [","]")},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):hr(t,e)},pushAll:function(t){if(t=en(t),0===t.size)return this;h(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}
<add>}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):hr(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):cr()},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(n!==this.size)return Sr.superCall(this,ni.prototype,"slice",[t,e]);for(var i=this.size-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.size=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):hr(i,u)},__ensureOwner:function(t){return t===this.__ownerID?this:t?hr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterate:function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iterator:function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new Hr(function(){if(n){var e=n.value;return n=n.next,I(t,r++,e)}return b()})}},{of:function(){return this(arguments)}},Sn),ri.isStack=ar;var ii="",ui=ri.prototype;ui[ii]=!0,ui.withMutations=Dn.withMutations,ui.asMutable=Dn.asMutable,ui.asImmutable=Dn.asImmutable,ui.wasAltered=Dn.wasAltered;var si,oi=function(t){return null===t||void 0===t?vr():fr(t)?t:vr().withMutations(function(e){var r=rn(t);h(r.size),r.forEach(function(t){return e.add(t)})})};Sr.createClass(oi,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},add:function(t){return _r(this,this._map.set(t,!0))},remove:function(t){return _r(this,this._map.remove(t))},clear:function(){return _r(this,this._map.clear())},union:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0===this.size&&1===t.length?this.constructor(t[0]):this.withMutations(function(e){for(var r=0;t.length>r;r++)rn(t[r]).forEach(function(t){return e.add(t)
<add>})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return rn(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return rn(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},sort:function(t){return fi(Le(this,t))},sortBy:function(t,e){return fi(Le(this,e,t))},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)}},{of:function(){return this(arguments)},fromKeys:function(t){return this($r(t).keySeq())}},In),oi.isSet=fr;var ai="",hi=oi.prototype;hi[ai]=!0,hi[zr]=hi.remove,hi.mergeDeep=hi.merge,hi.mergeDeepWith=hi.mergeWith,hi.withMutations=Dn.withMutations,hi.asMutable=Dn.asMutable,hi.asImmutable=Dn.asImmutable,hi.__empty=vr,hi.__make=lr;var ci,fi=function(t){return null===t||void 0===t?yr():pr(t)?t:yr().withMutations(function(e){var r=rn(t);h(r.size),r.forEach(function(t){return e.add(t)})})};Sr.createClass(fi,{toString:function(){return this.__toString("OrderedSet {","}")}},{of:function(){return this(arguments)},fromKeys:function(t){return this($r(t).keySeq())}},oi),fi.isOrderedSet=pr;var _i=fi.prototype;_i[Gr]=!0,_i.__empty=yr,_i.__make=dr;var li,vi=function(t,e){var r=function(t){return this instanceof r?void(this._map=qn(t)):new r(t)
<add>},n=Object.keys(t),u=r.prototype=Object.create(pi);u.constructor=r,e&&(u._name=e),u._defaultValues=t,u._keys=n,u.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){i(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(s){}return r};Sr.createClass(vi,{toString:function(){return this.__toString(gr(this)+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},clear:function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=mr(this,ae()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+gr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:mr(this,r)},remove:function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:mr(this,e)},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){var r=this;return $r(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},__iterate:function(t,e){var r=this;return $r(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?mr(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},gn);var pi=vi.prototype;pi[zr]=pi.remove,pi.merge=Dn.merge,pi.mergeWith=Dn.mergeWith,pi.mergeIn=Dn.mergeIn,pi.mergeDeep=Dn.mergeDeep,pi.mergeDeepWith=Dn.mergeDeepWith,pi.mergeDeepIn=Dn.mergeDeepIn,pi.setIn=Dn.setIn,pi.update=Dn.update,pi.updateIn=Dn.updateIn,pi.withMutations=Dn.withMutations,pi.asMutable=Dn.asMutable,pi.asImmutable=Dn.asImmutable;var di=function(t,e,r){return this instanceof yi?(i(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),t===e&&gi?gi:(r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.size=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new yi(t,e,r)
<ide> },yi=di;Sr.createClass(di,{toString:function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},get:function(t,e){return this.has(t)?this._start+f(this,t)*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.size>e&&e===Math.floor(e)},slice:function(t,e){return l(t,e,this.size)?this:(t=v(t,this.size),e=p(e,this.size),t>=e?gi:new yi(this.get(t,this._end),this.get(e,this._end),this._step))},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.size>r)return r}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,Math.max(0,t))},skip:function(t){return this.slice(Math.max(0,t))},__iterate:function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;r>=u;u++){if(t(i,u,this)===!1)return u+1;i+=e?-n:n}return u},__iterator:function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;return new Hr(function(){var s=i;return i+=e?-n:n,u>r?b():I(t,u++,s)})},equals:function(t){return t instanceof yi?this._start===t._start&&this._end===t._end&&this._step===t._step:B(this,t)}},{},an);var mi=di.prototype;mi.__toJS=mi.toArray,mi.first=Xn.first,mi.last=Xn.last;var gi=di(0,0),wi=function(t,e){return 0>=e&&Ii?Ii:this instanceof Si?(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),void(0===this.size&&(Ii=this))):new Si(t,e)},Si=wi;Sr.createClass(wi,{toString:function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return n(this._value,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:new Si(this._value,p(e,r)-v(t,r))},reverse:function(){return this},indexOf:function(t){return n(this._value,t)?0:-1},lastIndexOf:function(t){return n(this._value,t)?this.size:-1},__iterate:function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},__iterator:function(t){var e=this,r=0;
<ide> return new Hr(function(){return e.size>r?I(t,r++,e._value):b()})},equals:function(t){return t instanceof Si?n(this._value,t._value):B(t)}},{},an);var zi=wi.prototype;zi.last=zi.first,zi.has=mi.has,zi.take=mi.take,zi.skip=mi.skip,zi.__toJS=mi.__toJS;var Ii,bi={Iterable:Nr,Seq:nn,Collection:mn,Map:qn,OrderedMap:ti,List:Yn,Stack:ri,Set:oi,OrderedSet:fi,Record:vi,Range:di,Repeat:wi,is:n,fromJS:te};return bi}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();
<ide>\ No newline at end of file
<ide><path>src/Iterable.js
<ide> class Iterable {
<ide>
<ide> toMap() {
<ide> // Use Late Binding here to solve the circular dependency.
<del> assertNotInfinite(this.size);
<ide> return Map(this.toKeyedSeq());
<ide> }
<ide>
<ide> class Iterable {
<ide>
<ide> toOrderedMap() {
<ide> // Use Late Binding here to solve the circular dependency.
<del> assertNotInfinite(this.size);
<ide> return OrderedMap(this.toKeyedSeq());
<ide> }
<ide>
<ide> toOrderedSet() {
<ide> // Use Late Binding here to solve the circular dependency.
<del> assertNotInfinite(this.size);
<ide> return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
<ide> }
<ide>
<ide> toSet() {
<ide> // Use Late Binding here to solve the circular dependency.
<del> assertNotInfinite(this.size);
<ide> return Set(isKeyed(this) ? this.valueSeq() : this);
<ide> }
<ide>
<ide> class Iterable {
<ide>
<ide> toStack() {
<ide> // Use Late Binding here to solve the circular dependency.
<del> assertNotInfinite(this.size);
<ide> return Stack(isKeyed(this) ? this.valueSeq() : this);
<ide> }
<ide>
<ide> toList() {
<ide> // Use Late Binding here to solve the circular dependency.
<del> assertNotInfinite(this.size);
<ide> return List(isKeyed(this) ? this.valueSeq() : this);
<ide> }
<ide>
<ide> class Iterable {
<ide> }
<ide>
<ide> every(predicate, context) {
<add> assertNotInfinite(this.size);
<ide> var returnValue = true;
<ide> this.__iterate((v, k, c) => {
<ide> if (!predicate.call(context, v, k, c)) {
<ide> class Iterable {
<ide> }
<ide>
<ide> forEach(sideEffect, context) {
<add> assertNotInfinite(this.size);
<ide> return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
<ide> }
<ide>
<ide> join(separator) {
<add> assertNotInfinite(this.size);
<ide> separator = separator !== undefined ? '' + separator : ',';
<ide> var joined = '';
<ide> var isFirst = true;
<ide> class Iterable {
<ide> }
<ide>
<ide> reduce(reducer, initialReduction, context) {
<add> assertNotInfinite(this.size);
<ide> var reduction;
<ide> var useFirst;
<ide> if (arguments.length < 2) {
<ide><path>src/List.js
<ide> import "Iterable"
<ide> import "Collection"
<ide> import "Map"
<ide> import "Iterator"
<add>import "Operations"
<ide> /* global fromJS,
<ide> DELETE, SHIFT, SIZE, MASK, DID_ALTER, OwnerID, MakeRef,
<ide> SetRef, wrapIndex, wholeSlice, resolveBegin, resolveEnd,
<ide> isIterable, IndexedIterable,
<ide> IndexedCollection,
<ide> MapPrototype, mergeIntoCollectionWith, deepMerger,
<del> Iterator, iteratorValue, iteratorDone */
<add> Iterator, iteratorValue, iteratorDone,
<add> assertNotInfinite */
<ide> /* exported List, ListPrototype */
<ide>
<ide>
<ide> class List extends IndexedCollection {
<ide> if (isList(value)) {
<ide> return value;
<ide> }
<del> value = IndexedIterable(value);
<del> var size = value.size;
<add> var iter = IndexedIterable(value);
<add> var size = iter.size;
<ide> if (size === 0) {
<ide> return empty;
<ide> }
<add> assertNotInfinite(size);
<ide> if (size > 0 && size < SIZE) {
<del> return makeList(0, size, SHIFT, null, new VNode(value.toArray()));
<add> return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
<ide> }
<ide> return empty.withMutations(list => {
<ide> list.setSize(size);
<del> value.forEach((v, i) => list.set(i, v));
<add> iter.forEach((v, i) => list.set(i, v));
<ide> });
<ide> }
<ide>
<ide><path>src/Map.js
<ide> import "Operations"
<ide> invariant,
<ide> DELETE, SHIFT, SIZE, MASK, NOT_SET, CHANGE_LENGTH, DID_ALTER, OwnerID,
<ide> MakeRef, SetRef, arrCopy, hash, sortFactory, OrderedMap,
<del> Iterator, getIterator, iteratorValue, iteratorDone */
<add> Iterator, getIterator, iteratorValue, iteratorDone,
<add> assertNotInfinite */
<ide> /* exported Map, isMap, MapPrototype */
<ide>
<ide>
<ide> class Map extends KeyedCollection {
<ide> return value === null || value === undefined ? emptyMap() :
<ide> isMap(value) ? value :
<ide> emptyMap().withMutations(map => {
<del> KeyedIterable(value).forEach((v, k) => map.set(k, v));
<add> var iter = KeyedIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach((v, k) => map.set(k, v));
<ide> });
<ide> }
<ide>
<ide><path>src/OrderedMap.js
<ide> import "Iterable"
<ide> import "Map"
<ide> import "List"
<ide> import "TrieUtils"
<add>import "Operations"
<ide> /* global KeyedIterable, IS_ORDERED_SENTINEL, isOrdered,
<del> Map, isMap, emptyMap, emptyList, DELETE, NOT_SET, SIZE */
<add> Map, isMap, emptyMap, emptyList, DELETE, NOT_SET, SIZE,
<add> assertNotInfinite */
<ide> /* exported OrderedMap */
<ide>
<ide>
<ide> class OrderedMap extends Map {
<ide> return value === null || value === undefined ? emptyOrderedMap() :
<ide> isOrderedMap(value) ? value :
<ide> emptyOrderedMap().withMutations(map => {
<del> KeyedIterable(value).forEach((v, k) => map.set(k, v));
<add> var iter = KeyedIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach((v, k) => map.set(k, v));
<ide> });
<ide> }
<ide>
<ide><path>src/OrderedSet.js
<ide> import "Iterable"
<ide> import "Set"
<ide> import "OrderedMap"
<add>import "Operations"
<ide> /* global SetIterable, KeyedIterable, IS_ORDERED_SENTINEL, isOrdered,
<del> Set, isSet, emptyOrderedMap */
<add> Set, isSet, emptyOrderedMap,
<add> assertNotInfinite */
<ide> /* exported OrderedSet */
<ide>
<ide>
<ide> class OrderedSet extends Set {
<ide> return value === null || value === undefined ? emptyOrderedSet() :
<ide> isOrderedSet(value) ? value :
<ide> emptyOrderedSet().withMutations(set => {
<del> SetIterable(value).forEach(v => set.add(v));
<add> var iter = SetIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach(v => set.add(v));
<ide> });
<ide> }
<ide>
<ide><path>src/Set.js
<ide> import "Map"
<ide> import "TrieUtils"
<ide> import "Operations"
<ide> /* global SetIterable, KeyedIterable, SetCollection, MapPrototype,
<del> emptyMap, DELETE, sortFactory, OrderedSet */
<add> emptyMap, DELETE, sortFactory, OrderedSet,
<add> assertNotInfinite */
<ide> /* exported Set, isSet */
<ide>
<ide>
<ide> class Set extends SetCollection {
<ide> return value === null || value === undefined ? emptySet() :
<ide> isSet(value) ? value :
<ide> emptySet().withMutations(set => {
<del> SetIterable(value).forEach(v => set.add(v));
<add> var iter = SetIterable(value);
<add> assertNotInfinite(iter.size);
<add> iter.forEach(v => set.add(v));
<ide> });
<ide> }
<ide>
<ide><path>src/Stack.js
<ide> import "Iterable"
<ide> import "Collection"
<ide> import "Map"
<ide> import "Iterator"
<add>import "Operations"
<ide> /* global wholeSlice, resolveBegin, resolveEnd,
<ide> IndexedIterable,
<ide> IndexedCollection,
<ide> MapPrototype,
<del> Iterator, iteratorValue, iteratorDone */
<add> Iterator, iteratorValue, iteratorDone,
<add> assertNotInfinite */
<ide> /* exported Stack */
<ide>
<ide>
<ide> class Stack extends IndexedCollection {
<ide> if (iter.size === 0) {
<ide> return this;
<ide> }
<add> assertNotInfinite(iter.size);
<ide> var newSize = this.size;
<ide> var head = this._head;
<ide> iter.reverse().forEach(value => { | 9 |
Javascript | Javascript | improve proxy inspection | 4bfc06f6b5aa9278f4ed4b84d462448750c840c4 | <ide><path>lib/internal/util/inspect.js
<ide> function formatProxy(ctx, proxy, recurseTimes) {
<ide> formatValue(ctx, proxy[1], recurseTimes)
<ide> ];
<ide> ctx.indentationLvl -= 2;
<del> const str = reduceToSingleString(ctx, res, '', ['[', ']']);
<del> return `Proxy ${str}`;
<add> return reduceToSingleString(ctx, res, '', ['Proxy [', ']']);
<ide> }
<ide>
<ide> function findTypedConstructor(value) {
<ide><path>test/parallel/test-util-inspect-proxy.js
<ide> assert.strictEqual(handler, details[1]);
<ide>
<ide> assert.strictEqual(
<ide> util.inspect(proxyObj, opts),
<del> 'Proxy [ [ 1, 2, 3 ],\n' +
<add> 'Proxy [\n' +
<add> ' [ 1, 2, 3 ],\n' +
<ide> ' { getPrototypeOf: [Function: getPrototypeOf],\n' +
<ide> ' setPrototypeOf: [Function: setPrototypeOf],\n' +
<ide> ' isExtensible: [Function: isExtensible],\n' +
<ide> const expected1 = 'Proxy [ {}, {} ]';
<ide> const expected2 = 'Proxy [ Proxy [ {}, {} ], {} ]';
<ide> const expected3 = 'Proxy [ Proxy [ Proxy [ {}, {} ], {} ], Proxy [ {}, {} ] ]';
<ide> const expected4 = 'Proxy [ Proxy [ {}, {} ], Proxy [ Proxy [ {}, {} ], {} ] ]';
<del>const expected5 = 'Proxy [ Proxy [ Proxy [ Proxy [Array], {} ],' +
<del> ' Proxy [ {}, {} ] ],\n Proxy [ Proxy [ {}, {} ]' +
<del> ', Proxy [ Proxy [Array], {} ] ] ]';
<del>const expected6 = 'Proxy [ Proxy [ Proxy [ Proxy [Array], Proxy [Array]' +
<del> ' ],\n Proxy [ Proxy [Array], Proxy [Array] ] ],\n' +
<del> ' Proxy [ Proxy [ Proxy [Array], Proxy [Array] ],\n' +
<add>const expected5 = 'Proxy [\n ' +
<add> 'Proxy [ Proxy [ Proxy [Array], {} ], Proxy [ {}, {} ] ],\n' +
<add> ' Proxy [ Proxy [ {}, {} ], Proxy [ Proxy [Array], {} ] ] ]';
<add>const expected6 = 'Proxy [\n' +
<add> ' Proxy [\n' +
<add> ' Proxy [ Proxy [Array], Proxy [Array] ],\n' +
<add> ' Proxy [ Proxy [Array], Proxy [Array] ] ],\n' +
<add> ' Proxy [\n' +
<add> ' Proxy [ Proxy [Array], Proxy [Array] ],\n' +
<ide> ' Proxy [ Proxy [Array], Proxy [Array] ] ] ]';
<ide> assert.strictEqual(
<ide> util.inspect(proxy1, { showProxy: true, depth: null }), | 2 |
Python | Python | remove unused schema | 7adffc5361b921e36a8c60a8072c9126650311c4 | <ide><path>spacy/schemas.py
<ide> class ModelMetaSchema(BaseModel):
<ide> # fmt: on
<ide>
<ide>
<del># JSON training format
<del>
<del>
<del>class TrainingSchema(BaseModel):
<del> # TODO: write
<del>
<del> class Config:
<del> title = "Schema for training data in spaCy's JSON format"
<del> extra = "forbid"
<del>
<del>
<ide> # Config schema
<ide> # We're not setting any defaults here (which is too messy) and are making all
<ide> # fields required, so we can raise validation errors for missing values. To | 1 |
Javascript | Javascript | add http header setting scenarios | f53a6fb48b743b20286dd500a4689614ead39e3b | <ide><path>benchmark/http/_http_simple.js
<ide> var http = require('http');
<ide>
<ide> var port = parseInt(process.env.PORT || 8000);
<ide>
<del>var fixed = 'C'.repeat(20 * 1024),
<del> storedBytes = {},
<del> storedBuffer = {},
<del> storedUnicode = {};
<add>var fixed = 'C'.repeat(20 * 1024);
<add>var storedBytes = Object.create(null);
<add>var storedBuffer = Object.create(null);
<add>var storedUnicode = Object.create(null);
<ide>
<ide> var useDomains = process.env.NODE_USE_DOMAINS;
<ide>
<ide> var server = module.exports = http.createServer(function(req, res) {
<ide> dom.add(res);
<ide> }
<ide>
<del> var commands = req.url.split('/');
<del> var command = commands[1];
<add> // URL format: /<type>/<length>/<chunks>/<responseBehavior>
<add> var params = req.url.split('/');
<add> var command = params[1];
<ide> var body = '';
<del> var arg = commands[2];
<del> var n_chunks = parseInt(commands[3], 10);
<add> var arg = params[2];
<add> var n_chunks = parseInt(params[3], 10);
<add> var resHow = (params.length >= 5 ? params[4] : 'normal');
<ide> var status = 200;
<ide>
<ide> var n, i;
<ide> var server = module.exports = http.createServer(function(req, res) {
<ide> storedBytes[n] = 'C'.repeat(n);
<ide> }
<ide> body = storedBytes[n];
<del>
<ide> } else if (command === 'buffer') {
<ide> n = ~~arg;
<ide> if (n <= 0)
<ide> var server = module.exports = http.createServer(function(req, res) {
<ide> }
<ide> }
<ide> body = storedBuffer[n];
<del>
<ide> } else if (command === 'unicode') {
<ide> n = ~~arg;
<ide> if (n <= 0)
<ide> var server = module.exports = http.createServer(function(req, res) {
<ide> storedUnicode[n] = '\u263A'.repeat(n);
<ide> }
<ide> body = storedUnicode[n];
<del>
<ide> } else if (command === 'quit') {
<ide> res.connection.server.close();
<ide> body = 'quitting';
<del>
<ide> } else if (command === 'fixed') {
<ide> body = fixed;
<del>
<ide> } else if (command === 'echo') {
<del> const headers = {
<del> 'Content-Type': 'text/plain',
<del> 'Transfer-Encoding': 'chunked'
<del> };
<del> res.writeHead(200, headers);
<add> switch (resHow) {
<add> case 'setHeader':
<add> res.statusCode = 200;
<add> res.setHeader('Content-Type', 'text/plain');
<add> res.setHeader('Transfer-Encoding', 'chunked');
<add> break;
<add> case 'setHeaderWH':
<add> res.setHeader('Content-Type', 'text/plain');
<add> res.writeHead(200, { 'Transfer-Encoding': 'chunked' });
<add> break;
<add> default:
<add> res.writeHead(200, {
<add> 'Content-Type': 'text/plain',
<add> 'Transfer-Encoding': 'chunked'
<add> });
<add> }
<ide> req.pipe(res);
<ide> return;
<del>
<ide> } else {
<ide> status = 404;
<ide> body = 'not found\n';
<ide> var server = module.exports = http.createServer(function(req, res) {
<ide> // example: http://localhost:port/bytes/512/4
<ide> // sends a 512 byte body in 4 chunks of 128 bytes
<ide> if (n_chunks > 0) {
<del> const headers = {
<del> 'Content-Type': 'text/plain',
<del> 'Transfer-Encoding': 'chunked'
<del> };
<del> res.writeHead(status, headers);
<add> switch (resHow) {
<add> case 'setHeader':
<add> res.statusCode = status;
<add> res.setHeader('Content-Type', 'text/plain');
<add> res.setHeader('Transfer-Encoding', 'chunked');
<add> break;
<add> case 'setHeaderWH':
<add> res.setHeader('Content-Type', 'text/plain');
<add> res.writeHead(status, { 'Transfer-Encoding': 'chunked' });
<add> break;
<add> default:
<add> res.writeHead(status, {
<add> 'Content-Type': 'text/plain',
<add> 'Transfer-Encoding': 'chunked'
<add> });
<add> }
<ide> // send body in chunks
<ide> var len = body.length;
<ide> var step = Math.floor(len / n_chunks) || 1;
<ide> var server = module.exports = http.createServer(function(req, res) {
<ide> }
<ide> res.end(body.slice((n_chunks - 1) * step));
<ide> } else {
<del> const headers = {
<del> 'Content-Type': 'text/plain',
<del> 'Content-Length': body.length.toString()
<del> };
<del>
<del> res.writeHead(status, headers);
<add> switch (resHow) {
<add> case 'setHeader':
<add> res.statusCode = status;
<add> res.setHeader('Content-Type', 'text/plain');
<add> res.setHeader('Content-Length', body.length.toString());
<add> break;
<add> case 'setHeaderWH':
<add> res.setHeader('Content-Type', 'text/plain');
<add> res.writeHead(status, { 'Content-Length': body.length.toString() });
<add> break;
<add> default:
<add> res.writeHead(status, {
<add> 'Content-Type': 'text/plain',
<add> 'Content-Length': body.length.toString()
<add> });
<add> }
<ide> res.end(body);
<ide> }
<ide> });
<ide><path>benchmark/http/simple.js
<ide> var bench = common.createBenchmark(main, {
<ide> type: ['bytes', 'buffer'],
<ide> length: [4, 1024, 102400],
<ide> chunks: [0, 1, 4], // chunks=0 means 'no chunked encoding'.
<del> c: [50, 500]
<add> c: [50, 500],
<add> res: ['normal', 'setHeader', 'setHeaderWH']
<ide> });
<ide>
<ide> function main(conf) {
<ide> process.env.PORT = PORT;
<ide> var server = require('./_http_simple.js');
<ide> setTimeout(function() {
<del> var path = '/' + conf.type + '/' + conf.length + '/' + conf.chunks;
<add> var path = '/' + conf.type + '/' + conf.length + '/' + conf.chunks + '/' +
<add> conf.res;
<ide>
<ide> bench.http({
<ide> path: path, | 2 |
Javascript | Javascript | eliminate capture of clientrequest in agent | c04d4df08c0ba10d4402b09796233fb4f7b52c6c | <ide><path>lib/_http_agent.js
<ide> Agent.prototype.createSocket = function createSocket(req, options, cb) {
<ide> }
<ide> self.sockets[name].push(s);
<ide> debug('sockets', name, self.sockets[name].length);
<del>
<del> function onFree() {
<del> self.emit('free', s, options);
<del> }
<del> s.on('free', onFree);
<del>
<del> function onClose(err) {
<del> debug('CLIENT socket onClose');
<del> // This is the only place where sockets get removed from the Agent.
<del> // If you want to remove a socket from the pool, just close it.
<del> // All socket errors end in a close event anyway.
<del> self.removeSocket(s, options);
<del> }
<del> s.on('close', onClose);
<del>
<del> function onRemove() {
<del> // We need this function for cases like HTTP 'upgrade'
<del> // (defined by WebSockets) where we need to remove a socket from the
<del> // pool because it'll be locked up indefinitely
<del> debug('CLIENT socket onRemove');
<del> self.removeSocket(s, options);
<del> s.removeListener('close', onClose);
<del> s.removeListener('free', onFree);
<del> s.removeListener('agentRemove', onRemove);
<del> }
<del> s.on('agentRemove', onRemove);
<add> installListeners(self, s, options);
<ide> cb(null, s);
<ide> }
<ide> };
<ide>
<add>function installListeners(agent, s, options) {
<add> function onFree() {
<add> debug('CLIENT socket onFree');
<add> agent.emit('free', s, options);
<add> }
<add> s.on('free', onFree);
<add>
<add> function onClose(err) {
<add> debug('CLIENT socket onClose');
<add> // This is the only place where sockets get removed from the Agent.
<add> // If you want to remove a socket from the pool, just close it.
<add> // All socket errors end in a close event anyway.
<add> agent.removeSocket(s, options);
<add> }
<add> s.on('close', onClose);
<add>
<add> function onRemove() {
<add> // We need this function for cases like HTTP 'upgrade'
<add> // (defined by WebSockets) where we need to remove a socket from the
<add> // pool because it'll be locked up indefinitely
<add> debug('CLIENT socket onRemove');
<add> agent.removeSocket(s, options);
<add> s.removeListener('close', onClose);
<add> s.removeListener('free', onFree);
<add> s.removeListener('agentRemove', onRemove);
<add> }
<add> s.on('agentRemove', onRemove);
<add>}
<add>
<ide> Agent.prototype.removeSocket = function removeSocket(s, options) {
<ide> var name = this.getName(options);
<ide> debug('removeSocket', name, 'writable:', s.writable); | 1 |
Java | Java | add getters to rsocketmessagehandler | 7b1a6eb50a3ed32dd7158a8553c60ebc115cc296 | <ide><path>spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/RSocketMessageHandler.java
<ide> public void setMetadataExtractor(MetadataExtractor extractor) {
<ide> this.metadataExtractor = extractor;
<ide> }
<ide>
<add> /**
<add> * Return the configured {@link #setMetadataExtractor MetadataExtractor}.
<add> * This may be {@code null} before {@link #afterPropertiesSet()}.
<add> */
<add> @Nullable
<add> public MetadataExtractor getMetadataExtractor() {
<add> return this.metadataExtractor;
<add> }
<add>
<ide> /**
<ide> * Configure the default content type to use for data payloads if the
<ide> * {@code SETUP} frame did not specify one.
<ide> public void setDefaultDataMimeType(@Nullable MimeType mimeType) {
<ide> this.defaultDataMimeType = mimeType;
<ide> }
<ide>
<add> /**
<add> * Return the configured
<add> * {@link #setDefaultDataMimeType defaultDataMimeType}, or {@code null}.
<add> */
<add> @Nullable
<add> public MimeType getDefaultDataMimeType() {
<add> return this.defaultDataMimeType;
<add> }
<add>
<ide> /**
<ide> * Configure the default {@code MimeType} for payload data if the
<ide> * {@code SETUP} frame did not specify one.
<ide> public void setDefaultMetadataMimeType(MimeType mimeType) {
<ide> this.defaultMetadataMimeType = mimeType;
<ide> }
<ide>
<add> /**
<add> * Return the configured
<add> * {@link #setDefaultMetadataMimeType defaultMetadataMimeType}.
<add> */
<add> public MimeType getDefaultMetadataMimeType() {
<add> return this.defaultMetadataMimeType;
<add> }
<add>
<ide>
<ide> @Override
<ide> public void afterPropertiesSet() { | 1 |
Ruby | Ruby | add test for per-cask `cleanup` | 911edb0ed77859445c3a48f6abe5b9be5807ebf7 | <ide><path>Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb
<ide> cache_location.rmtree
<ide> end
<ide>
<add> describe "cleanup" do
<add> it "removes cached downloads of given casks" do
<add> cleaned_up_cached_download = 'caffeine'
<add>
<add> cached_downloads = [
<add> cache_location.join("#{cleaned_up_cached_download}--latest.zip"),
<add> cache_location.join("transmission--2.61.dmg"),
<add> ]
<add>
<add> cached_downloads.each(&FileUtils.method(:touch))
<add>
<add> cleanup_size = Hbc::Utils.size_in_bytes(cached_downloads[0])
<add>
<add> expect {
<add> subject.cleanup(cleaned_up_cached_download)
<add> }.to output(<<-EOS.undent).to_stdout
<add> ==> Removing cached downloads for #{cleaned_up_cached_download}
<add> #{cached_downloads[0]}
<add> ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
<add> EOS
<add>
<add> expect(cached_downloads[0].exist?).to eq(false)
<add> expect(cached_downloads[1].exist?).to eq(true)
<add> end
<add> end
<add>
<ide> describe "cleanup!" do
<ide> it "removes cached downloads" do
<ide> cached_download = cache_location.join("SomeDownload.dmg")
<ide>
<ide> expect {
<ide> subject.cleanup!
<del> }.to output(<<-OUTPUT.undent).to_stdout
<add> }.to output(<<-EOS.undent).to_stdout
<ide> ==> Removing cached downloads
<ide> #{cached_download}
<ide> ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
<del> OUTPUT
<add> EOS
<ide>
<ide> expect(cached_download.exist?).to eq(false)
<ide> end
<ide>
<ide> expect {
<ide> subject.cleanup!
<del> }.to output(<<-OUTPUT.undent).to_stdout
<add> }.to output(<<-EOS.undent).to_stdout
<ide> ==> Removing cached downloads
<ide> skipping: #{cached_download} is locked
<ide> ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
<del> OUTPUT
<add> EOS
<ide>
<ide> expect(cached_download.exist?).to eq(true)
<ide> end
<ide>
<ide> expect {
<ide> subject.cleanup!
<del> }.to output(<<-OUTPUT.undent).to_stdout
<add> }.to output(<<-EOS.undent).to_stdout
<ide> ==> Removing cached downloads older than 10 days old
<ide> Nothing to do
<del> OUTPUT
<add> EOS
<ide>
<ide> expect(cached_download.exist?).to eq(true)
<ide> end | 1 |
Python | Python | change dag.tasks from a list to a dict | eca6a5a619bd7f1a995fa1522c5506146ab69882 | <ide><path>airflow/models.py
<ide> def __init__(
<ide> del self.default_args['params']
<ide>
<ide> validate_key(dag_id)
<del> self.tasks = []
<add> self.task_dict = dict()
<ide> self.dag_id = dag_id
<ide> self.start_date = start_date
<ide> self.end_date = end_date
<ide> def previous_schedule(self, dttm):
<ide> elif isinstance(self._schedule_interval, timedelta):
<ide> return dttm - self._schedule_interval
<ide>
<add> @property
<add> def tasks(self):
<add> return list(self.task_dict.values())
<add>
<add> @tasks.setter
<add> def tasks(self, val):
<add> raise AttributeError(
<add> 'DAG.tasks can not be modified. Use dag.add_task() instead.')
<add>
<ide> @property
<ide> def task_ids(self):
<del> return [t.task_id for t in self.tasks]
<add> return list(self.task_dict.keys())
<ide>
<ide> @property
<ide> def active_task_ids(self):
<del> return [t.task_id for t in self.tasks if not t.adhoc]
<add> return list(k for k, v in self.task_dict.items() if not v.adhoc)
<ide>
<ide> @property
<ide> def active_tasks(self):
<ide> def sub_dag(self, task_regex, include_downstream=False,
<ide> also_include += t.get_flat_relatives(upstream=True)
<ide>
<ide> # Compiling the unique list of tasks that made the cut
<del> dag.tasks = list(set(regex_match + also_include))
<add> dag.task_dict = {t.task_id: t for t in regex_match + also_include}
<ide> for t in dag.tasks:
<ide> # Removing upstream/downstream references to tasks that did not
<ide> # made the cut
<ide> def has_task(self, task_id):
<ide> return task_id in (t.task_id for t in self.tasks)
<ide>
<ide> def get_task(self, task_id):
<del> for task in self.tasks:
<del> if task.task_id == task_id:
<del> return task
<add> if task_id in self.task_dict:
<add> return self.task_dict[task_id]
<ide> raise AirflowException("Task {task_id} not found".format(**locals()))
<ide>
<ide> @provide_session
<ide> def add_task(self, task):
<ide> "to the DAG ".format(task.task_id))
<ide> else:
<ide> self.tasks.append(task)
<add> self.task_dict[task.task_id] = task
<ide> task.dag = self
<ide>
<ide> self.task_count = len(self.tasks)
<ide><path>tests/__init__.py
<ide> from __future__ import absolute_import
<add>
<ide> from .configuration import *
<ide> from .core import *
<ide> from .jobs import *
<ide><path>tests/core.py
<ide> def test_schedule_dag_no_previous_runs(self):
<ide> Tests scheduling a dag with no previous runs
<ide> """
<ide> dag = DAG(TEST_DAG_ID + 'test_schedule_dag_no_previous_runs')
<del> dag.tasks = [models.BaseOperator(task_id="faketastic", owner='Also fake',
<del> start_date=datetime(2015, 1, 2, 0, 0))]
<add> dag.add_task(models.BaseOperator(
<add> task_id="faketastic",
<add> owner='Also fake',
<add> start_date=datetime(2015, 1, 2, 0, 0)))
<add>
<ide> dag_run = jobs.SchedulerJob(test_mode=True).schedule_dag(dag)
<ide> assert dag_run is not None
<ide> assert dag_run.dag_id == dag.dag_id
<ide> def test_schedule_dag_fake_scheduled_previous(self):
<ide> dag = DAG(TEST_DAG_ID + 'test_schedule_dag_fake_scheduled_previous',
<ide> schedule_interval=delta,
<ide> start_date=DEFAULT_DATE)
<del> dag.tasks = [models.BaseOperator(task_id="faketastic",
<del> owner='Also fake',
<del> start_date=DEFAULT_DATE)]
<add> dag.add_task(models.BaseOperator(
<add> task_id="faketastic",
<add> owner='Also fake',
<add> start_date=DEFAULT_DATE))
<ide> scheduler = jobs.SchedulerJob(test_mode=True)
<ide> trigger = models.DagRun(
<ide> dag_id=dag.dag_id,
<ide> def test_schedule_dag_once(self):
<ide> """
<ide> dag = DAG(TEST_DAG_ID + 'test_schedule_dag_once')
<ide> dag.schedule_interval = '@once'
<del> dag.tasks = [models.BaseOperator(task_id="faketastic", owner='Also fake',
<del> start_date=datetime(2015, 1, 2, 0, 0))]
<add> dag.add_task(models.BaseOperator(
<add> task_id="faketastic",
<add> owner='Also fake',
<add> start_date=datetime(2015, 1, 2, 0, 0)))
<ide> dag_run = jobs.SchedulerJob(test_mode=True).schedule_dag(dag)
<ide> dag_run2 = jobs.SchedulerJob(test_mode=True).schedule_dag(dag)
<ide>
<ide> def test_schedule_dag_start_end_dates(self):
<ide> task = models.BaseOperator(task_id='faketastic__%s' % i,
<ide> owner='Also fake',
<ide> start_date=date)
<del> dag.tasks.append(task)
<add> dag.task_dict[task.task_id] = task
<ide> dag_runs.append(scheduler.schedule_dag(dag))
<ide>
<ide> additional_dag_run = scheduler.schedule_dag(dag)
<ide> def test_schedule_dag_no_end_date_up_to_today_only(self):
<ide> task = models.BaseOperator(task_id='faketastic__%s' % i,
<ide> owner='Also fake',
<ide> start_date=date)
<del> dag.tasks.append(task)
<add>
<add> dag.task_dict[task.task_id] = task
<ide>
<ide> # Schedule the DagRun
<ide> dag_run = scheduler.schedule_dag(dag)
<ide><path>tests/jobs.py
<ide>
<ide> import datetime
<ide> import logging
<del>import os
<ide> import unittest
<ide>
<ide> from airflow import AirflowException, settings
<ide> from airflow.bin import cli
<ide> from airflow.jobs import BackfillJob, SchedulerJob
<del>from airflow.models import DAG, DagBag, DagRun, Pool, TaskInstance as TI
<del>from airflow.operators import DummyOperator
<add>from airflow.models import DagBag, DagRun, Pool, TaskInstance as TI
<ide> from airflow.utils.state import State
<ide> from airflow.utils.timeout import timeout
<ide> from airflow.utils.db import provide_session
<ide> def setUp(self):
<ide> def evaluate_dagrun(
<ide> self,
<ide> dag_id,
<del> first_task_state,
<del> second_task_state,
<add> expected_task_states, # dict of task_id: state
<ide> dagrun_state,
<ide> run_kwargs=None,
<ide> advance_execution_date=False,
<ide> def evaluate_dagrun(
<ide> pass
<ide>
<ide> # test tasks
<del> task_1, task_2 = dag.tasks
<del> ti = TI(task_1, ex_date)
<del> ti.refresh_from_db()
<del> self.assertEqual(ti.state, first_task_state)
<del> ti = TI(task_2, ex_date)
<del> ti.refresh_from_db()
<del> self.assertEqual(ti.state, second_task_state)
<add> for task_id, expected_state in expected_task_states.items():
<add> task = dag.get_task(task_id)
<add> ti = TI(task, ex_date)
<add> ti.refresh_from_db()
<add> self.assertEqual(ti.state, expected_state)
<ide>
<ide> # load dagrun
<ide> dr = session.query(DagRun).filter(
<ide> def test_dagrun_fail(self):
<ide> """
<ide> self.evaluate_dagrun(
<ide> dag_id='test_dagrun_states_fail',
<del> first_task_state=State.FAILED,
<del> second_task_state=State.UPSTREAM_FAILED,
<add> expected_task_states={
<add> 'test_dagrun_fail': State.FAILED,
<add> 'test_dagrun_succeed': State.UPSTREAM_FAILED,
<add> },
<ide> dagrun_state=State.FAILED)
<ide>
<ide> def test_dagrun_success(self):
<ide> def test_dagrun_success(self):
<ide> """
<ide> self.evaluate_dagrun(
<ide> dag_id='test_dagrun_states_success',
<del> first_task_state=State.FAILED,
<del> second_task_state=State.SUCCESS,
<add> expected_task_states={
<add> 'test_dagrun_fail': State.FAILED,
<add> 'test_dagrun_succeed': State.SUCCESS,
<add> },
<ide> dagrun_state=State.SUCCESS)
<ide>
<ide> def test_dagrun_root_fail(self):
<ide> def test_dagrun_root_fail(self):
<ide> """
<ide> self.evaluate_dagrun(
<ide> dag_id='test_dagrun_states_root_fail',
<del> first_task_state=State.SUCCESS,
<del> second_task_state=State.FAILED,
<add> expected_task_states={
<add> 'test_dagrun_succeed': State.SUCCESS,
<add> 'test_dagrun_fail': State.FAILED,
<add> },
<ide> dagrun_state=State.FAILED)
<ide>
<ide> def test_dagrun_deadlock(self):
<ide> def test_dagrun_deadlock(self):
<ide> """
<ide> self.evaluate_dagrun(
<ide> dag_id='test_dagrun_states_deadlock',
<del> first_task_state=None,
<del> second_task_state=None,
<add> expected_task_states={
<add> 'test_depends_on_past': None,
<add> 'test_depends_on_past_2': None,
<add> },
<ide> dagrun_state=State.FAILED,
<ide> advance_execution_date=True)
<ide>
<ide> def test_dagrun_deadlock_ignore_depends_on_past_advance_ex_date(self):
<ide> """
<ide> self.evaluate_dagrun(
<ide> dag_id='test_dagrun_states_deadlock',
<del> first_task_state=State.SUCCESS,
<del> second_task_state=State.SUCCESS,
<add> expected_task_states={
<add> 'test_depends_on_past': State.SUCCESS,
<add> 'test_depends_on_past_2': State.SUCCESS,
<add> },
<ide> dagrun_state=State.SUCCESS,
<ide> advance_execution_date=True,
<ide> run_kwargs=dict(ignore_first_depends_on_past=True))
<ide> def test_dagrun_deadlock_ignore_depends_on_past(self):
<ide> """
<ide> self.evaluate_dagrun(
<ide> dag_id='test_dagrun_states_deadlock',
<del> first_task_state=State.SUCCESS,
<del> second_task_state=State.SUCCESS,
<add> expected_task_states={
<add> 'test_depends_on_past': State.SUCCESS,
<add> 'test_depends_on_past_2': State.SUCCESS,
<add> },
<ide> dagrun_state=State.SUCCESS,
<ide> run_kwargs=dict(ignore_first_depends_on_past=True))
<ide> | 4 |
Python | Python | move location of flatnonzero | d372798ae6bf88c3a4414027341d2b0322941c68 | <ide><path>numpy/core/numeric.py
<ide> 'load', 'loads', 'isscalar', 'binary_repr', 'base_repr',
<ide> 'ones', 'identity', 'allclose',
<ide> 'seterr', 'geterr', 'setbufsize', 'getbufsize',
<del> 'seterrcall', 'geterrcall',
<add> 'seterrcall', 'geterrcall', 'flatnonzero',
<ide> 'Inf', 'inf', 'infty', 'Infinity',
<ide> 'nan', 'NaN', 'False_', 'True_']
<ide>
<ide> def argwhere(a):
<ide> """
<ide> return transpose(a.nonzero())
<ide>
<add>def flatnonzero(a):
<add> """Return indicies that are not-zero in flattened version of a
<add>
<add> Equivalent to a.ravel().nonzero()[0]
<add> """
<add> return a.ravel().nonzero()[0]
<add>
<ide> _mode_from_name_dict = {'v': 0,
<ide> 's' : 1,
<ide> 'f' : 2}
<ide><path>numpy/lib/function_base.py
<ide> 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',
<ide> 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',
<ide> 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring', 'meshgrid',
<del> 'flatnonzero'
<ide> ]
<ide>
<ide> import types
<ide> def meshgrid(x,y):
<ide> y = y.reshape(numRows,1)
<ide> Y = y.repeat(numCols, axis=1)
<ide> return X, Y
<del>
<del>def flatnonzero(a):
<del> """Return indicies that are not-zero in flattened version of a
<del>
<del> Equivalent to a.ravel().nonzero()[0]
<del> """
<del> return a.ravel().nonzero()[0]
<ide>
<ide><path>numpy/linalg/linalg.py
<ide> from numpy.core import array, asarray, zeros, empty, transpose, \
<ide> intc, single, double, csingle, cdouble, inexact, complexfloating, \
<ide> newaxis, ravel, all, Inf, dot, add, multiply, identity, sqrt, \
<del> maximum, nonzero, diagonal, arange, fastCopyAndTranspose, sum, \
<add> maximum, flatnonzero, diagonal, arange, fastCopyAndTranspose, sum, \
<ide> argsort
<ide> from numpy.lib import triu
<ide> from numpy.linalg import lapack_lite
<ide> def eig(a):
<ide> else:
<ide> w = wr+1j*wi
<ide> v = array(vr, w.dtype)
<del> ind = nonzero(wi != 0.0)[0] # indices of complex e-vals
<add> ind = flatnonzero(wi != 0.0) # indices of complex e-vals
<ide> for i in range(len(ind)/2):
<ide> v[ind[2*i]] = vr[ind[2*i]] + 1j*vr[ind[2*i+1]]
<ide> v[ind[2*i+1]] = vr[ind[2*i]] - 1j*vr[ind[2*i+1]] | 3 |
Go | Go | use github.com/pkg/errors to wrap an error | f775005a17c7ae0d3851cc86f46b7c46aafa27d8 | <ide><path>daemon/logger/awslogs/cloudwatchlogs.go
<ide> package awslogs
<ide>
<ide> import (
<ide> "bytes"
<del> "errors"
<ide> "fmt"
<ide> "os"
<ide> "regexp"
<ide> import (
<ide> "github.com/docker/docker/daemon/logger/loggerutils"
<ide> "github.com/docker/docker/dockerversion"
<ide> "github.com/docker/docker/pkg/templates"
<add> "github.com/pkg/errors"
<ide> )
<ide>
<ide> const (
<ide> func parseMultilineOptions(info logger.Info) (*regexp.Regexp, error) {
<ide> if multilinePatternKey != "" {
<ide> multilinePattern, err := regexp.Compile(multilinePatternKey)
<ide> if err != nil {
<del> return nil, err
<add> return nil, errors.Wrapf(err, "awslogs could not parse multiline pattern key %q", multilinePatternKey)
<ide> }
<ide> return multilinePattern, nil
<ide> } | 1 |
Java | Java | use response encoding when escaping html | a0c210457bda606eba58f367678bdefc69d5cd15 | <ide><path>spring-web/src/main/java/org/springframework/web/util/WebUtils.java
<ide> public abstract class WebUtils {
<ide> */
<ide> public static final String HTML_ESCAPE_CONTEXT_PARAM = "defaultHtmlEscape";
<ide>
<add> /**
<add> * Use of response encoding for HTML escaping parameter at the servlet context level
<add> * (i.e. a context-param in {@code web.xml}): "responseEncodedHtmlEscape".
<add> */
<add> public static final String RESPONSE_ENCODED_HTML_ESCAPE_CONTEXT_PARAM = "responseEncodedHtmlEscape";
<add>
<ide> /**
<ide> * Web app root key parameter at the servlet context level
<ide> * (i.e. a context-param in {@code web.xml}): "webAppRootKey".
<ide> public static void removeWebAppRootSystemProperty(ServletContext servletContext)
<ide> * (if any). Falls back to {@code false} in case of no explicit default given.
<ide> * @param servletContext the servlet context of the web application
<ide> * @return whether default HTML escaping is enabled (default is false)
<add> * @deprecated as of Spring 4.1, in favor of {@link #getDefaultHtmlEscape}
<ide> */
<add> @Deprecated
<ide> public static boolean isDefaultHtmlEscape(ServletContext servletContext) {
<ide> if (servletContext == null) {
<ide> return false;
<ide> public static Boolean getDefaultHtmlEscape(ServletContext servletContext) {
<ide> return (StringUtils.hasText(param)? Boolean.valueOf(param) : null);
<ide> }
<ide>
<add> /**
<add> * Return whether response encoding should be used when HTML escaping characters,
<add> * thus only escaping XML markup significant characters with UTF-* encodings.
<add> * This option is enabled for the web application with a ServletContext param,
<add> * i.e. the value of the "responseEncodedHtmlEscape" context-param in {@code web.xml}
<add> * (if any).
<add> * <p>This method differentiates between no param specified at all and
<add> * an actual boolean value specified, allowing to have a context-specific
<add> * default in case of no setting at the global level.
<add> * @param servletContext the servlet context of the web application
<add> * @return whether response encoding is used for HTML escaping (null = no explicit default)
<add> */
<add> public static Boolean getResponseEncodedHtmlEscape(ServletContext servletContext) {
<add> if (servletContext == null) {
<add> return null;
<add> }
<add> String param = servletContext.getInitParameter(RESPONSE_ENCODED_HTML_ESCAPE_CONTEXT_PARAM);
<add> return (StringUtils.hasText(param)? Boolean.valueOf(param) : null);
<add> }
<add>
<ide> /**
<ide> * Return the temporary directory for the current web application,
<ide> * as provided by the servlet container.
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java
<ide> /*
<del> * Copyright 2002-2013 the original author or authors.
<add> * Copyright 2002-2014 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> public class RequestContext {
<ide>
<ide> private Boolean defaultHtmlEscape;
<ide>
<add> private Boolean responseEncodedHtmlEscape;
<add>
<ide> private UrlPathHelper urlPathHelper;
<ide>
<ide> private RequestDataValueProcessor requestDataValueProcessor;
<ide> else if (localeResolver != null) {
<ide> // context-param in web.xml, if any.
<ide> this.defaultHtmlEscape = WebUtils.getDefaultHtmlEscape(this.webApplicationContext.getServletContext());
<ide>
<add> this.responseEncodedHtmlEscape = WebUtils.getResponseEncodedHtmlEscape(this.webApplicationContext.getServletContext());
<add>
<ide> this.urlPathHelper = new UrlPathHelper();
<ide>
<ide> if (this.webApplicationContext.containsBean(REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME)) {
<ide> public Boolean getDefaultHtmlEscape() {
<ide> return this.defaultHtmlEscape;
<ide> }
<ide>
<add> /**
<add> * Is HTML escaping using the response encoding by default?
<add> * If enabled, only XML markup significant characters will be escaped with UTF-* encodings.
<add> * <p>Falls back to {@code false} in case of no explicit default given.
<add> * @since 4.1.2
<add> */
<add> public boolean isResponseEncodedHtmlEscape() {
<add> return (this.responseEncodedHtmlEscape != null && this.responseEncodedHtmlEscape.booleanValue());
<add> }
<add>
<add> /**
<add> * Return the default setting about use of response encoding for HTML escape setting,
<add> * differentiating between no default specified and an explicit value.
<add> * @return whether default use of response encoding HTML escaping is enabled (null = no explicit default)
<add> * @since 4.1.2
<add> */
<add> public Boolean getResponseEncodedHtmlEscape() {
<add> return this.responseEncodedHtmlEscape;
<add> }
<add>
<add>
<ide> /**
<ide> * Set the UrlPathHelper to use for context path and request URI decoding.
<ide> * Can be used to pass a shared UrlPathHelper instance in.
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EscapeBodyTag.java
<ide> /*
<del> * Copyright 2002-2013 the original author or authors.
<add> * Copyright 2002-2014 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> import javax.servlet.jsp.tagext.BodyContent;
<ide> import javax.servlet.jsp.tagext.BodyTag;
<ide>
<del>import org.springframework.web.util.HtmlUtils;
<ide> import org.springframework.web.util.JavaScriptUtils;
<ide>
<ide> /**
<ide> public int doAfterBody() throws JspException {
<ide> try {
<ide> String content = readBodyContent();
<ide> // HTML and/or JavaScript escape, if demanded
<del> content = isHtmlEscape() ? HtmlUtils.htmlEscape(content) : content;
<add> content = htmlEscape(content);
<ide> content = this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(content) : content;
<ide> writeBodyContent(content);
<ide> }
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EvalTag.java
<ide> /*
<del> * Copyright 2002-2013 the original author or authors.
<add> * Copyright 2002-2014 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> import org.springframework.expression.spel.support.StandardEvaluationContext;
<ide> import org.springframework.expression.spel.support.StandardTypeConverter;
<ide> import org.springframework.util.ObjectUtils;
<del>import org.springframework.web.util.HtmlUtils;
<ide> import org.springframework.web.util.JavaScriptUtils;
<ide> import org.springframework.web.util.TagUtils;
<ide>
<ide> public int doEndTag() throws JspException {
<ide> try {
<ide> String result = this.expression.getValue(evaluationContext, String.class);
<ide> result = ObjectUtils.getDisplayString(result);
<del> result = (isHtmlEscape() ? HtmlUtils.htmlEscape(result) : result);
<add> result = htmlEscape(result);
<ide> result = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(result) : result);
<ide> this.pageContext.getOut().print(result);
<ide> }
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapingAwareTag.java
<ide> /*
<del> * Copyright 2002-2013 the original author or authors.
<add> * Copyright 2002-2014 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide>
<ide> import javax.servlet.jsp.JspException;
<ide>
<add>import org.springframework.web.util.HtmlUtils;
<add>
<ide> /**
<ide> * Superclass for tags that output content that might get HTML-escaped.
<ide> *
<ide> * @see #setHtmlEscape
<ide> * @see HtmlEscapeTag
<ide> * @see org.springframework.web.servlet.support.RequestContext#isDefaultHtmlEscape
<del> * @see org.springframework.web.util.WebUtils#isDefaultHtmlEscape
<add> * @see org.springframework.web.util.WebUtils#getDefaultHtmlEscape
<add> * @see org.springframework.web.util.WebUtils#getResponseEncodedHtmlEscape
<ide> */
<ide> @SuppressWarnings("serial")
<ide> public abstract class HtmlEscapingAwareTag extends RequestContextAwareTag {
<ide> protected boolean isDefaultHtmlEscape() {
<ide> return getRequestContext().isDefaultHtmlEscape();
<ide> }
<ide>
<add> /**
<add> * Return the applicable default for the use of response encoding with HTML escape for this tag.
<add> * <p>The default implementation checks the RequestContext's setting,
<add> * falling back to {@code false} in case of no explicit default given.
<add> * @see #getRequestContext()
<add> * @since 4.1.2
<add> */
<add> protected boolean isResponseEncodedHtmlEscape() {
<add> return getRequestContext().isResponseEncodedHtmlEscape();
<add> }
<add>
<add> /**
<add> * HTML encodes the given string, only if the htmlEscape setting is enabled.
<add> * The response encoding will be taken into account if the responseEncodedHtmlEscape setting is enabled.
<add> * @param content
<add> * @return
<add> * @see #isHtmlEscape()
<add> * @see #isResponseEncodedHtmlEscape()
<add> * @since 4.1.2
<add> */
<add> protected String htmlEscape(String content) {
<add> String out = content;
<add> if(isHtmlEscape()) {
<add> if(isResponseEncodedHtmlEscape()) {
<add> out = HtmlUtils.htmlEscape(content, this.pageContext.getResponse().getCharacterEncoding());
<add> }
<add> else {
<add> out = HtmlUtils.htmlEscape(content);
<add> }
<add> }
<add> return out;
<add> }
<add>
<ide> }
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java
<ide> /*
<del> * Copyright 2002-2013 the original author or authors.
<add> * Copyright 2002-2014 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> import org.springframework.context.NoSuchMessageException;
<ide> import org.springframework.util.ObjectUtils;
<ide> import org.springframework.util.StringUtils;
<del>import org.springframework.web.util.HtmlUtils;
<ide> import org.springframework.web.util.JavaScriptUtils;
<ide> import org.springframework.web.util.TagUtils;
<ide>
<ide> public int doEndTag() throws JspException {
<ide> String msg = resolveMessage();
<ide>
<ide> // HTML and/or JavaScript escape, if demanded.
<del> msg = isHtmlEscape() ? HtmlUtils.htmlEscape(msg) : msg;
<add> msg = htmlEscape(msg);
<ide> msg = this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(msg) : msg;
<ide>
<ide> // Expose as variable, if demanded, else write to the page.
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/tags/TransformTag.java
<ide> protected final int doStartTagInternal() throws JspException {
<ide> // Else, just do a toString.
<ide> result = this.value.toString();
<ide> }
<del> result = isHtmlEscape() ? HtmlUtils.htmlEscape(result) : result;
<add> result = htmlEscape(result);
<ide> if (this.var != null) {
<ide> pageContext.setAttribute(this.var, result, TagUtils.getScope(this.scope));
<ide> }
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java
<ide> private String createUrl() throws JspException {
<ide> }
<ide>
<ide> // HTML and/or JavaScript escape, if demanded.
<del> urlStr = isHtmlEscape() ? HtmlUtils.htmlEscape(urlStr) : urlStr;
<add> urlStr = htmlEscape(urlStr);
<ide> urlStr = this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(urlStr) : urlStr;
<ide>
<ide> return urlStr;
<ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagTests.java
<ide> /*
<del> * Copyright 2002-2013 the original author or authors.
<add> * Copyright 2002-2014 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> import org.springframework.web.context.ConfigurableWebApplicationContext;
<ide> import org.springframework.web.servlet.support.RequestContext;
<ide> import org.springframework.web.servlet.support.RequestContextUtils;
<add>import org.springframework.web.util.WebUtils;
<ide>
<ide> /**
<ide> * Tests for {@link MessageTag}.
<ide> protected void writeMessage(String msg) {
<ide> }
<ide> };
<ide> tag.setPageContext(pc);
<del> tag.setText("test & text");
<add> tag.setText("test & text é");
<ide> tag.setHtmlEscape(true);
<ide> assertTrue("Correct doStartTag return value", tag.doStartTag() == Tag.EVAL_BODY_INCLUDE);
<ide> assertEquals("Correct doEndTag return value", Tag.EVAL_PAGE, tag.doEndTag());
<del> assertEquals("Correct message", "test & text", message.toString());
<add> assertEquals("Correct message", "test & text é", message.toString());
<add> }
<add>
<add> @SuppressWarnings("serial")
<add> public void testMessageTagWithTextEncodingEscaped() throws JspException {
<add> PageContext pc = createPageContext();
<add> pc.getServletContext().setInitParameter(WebUtils.RESPONSE_ENCODED_HTML_ESCAPE_CONTEXT_PARAM, "true");
<add> pc.getResponse().setCharacterEncoding("UTF-8");
<add> final StringBuffer message = new StringBuffer();
<add> MessageTag tag = new MessageTag() {
<add> @Override
<add> protected void writeMessage(String msg) {
<add> message.append(msg);
<add> }
<add> };
<add> tag.setPageContext(pc);
<add> tag.setText("test <&> é");
<add> tag.setHtmlEscape(true);
<add> assertTrue("Correct doStartTag return value", tag.doStartTag() == Tag.EVAL_BODY_INCLUDE);
<add> assertEquals("Correct doEndTag return value", Tag.EVAL_PAGE, tag.doEndTag());
<add> assertEquals("Correct message", "test <&> é", message.toString());
<ide> }
<ide>
<ide> @SuppressWarnings("serial") | 9 |
Javascript | Javascript | fix non-bound function | fddb3b0737234cdf871291c5fa51cb9e5c3a5d2e | <ide><path>packager/src/lib/GlobalTransformCache.js
<ide> class OptionsHasher {
<ide> }
<ide>
<ide> relativizeFilePaths(filePaths: Array<string>): Array<string> {
<del> return filePaths.map(this.relativizeFilePath);
<add> return filePaths.map(this.relativizeFilePath.bind(this));
<ide> }
<add>
<ide> relativizeFilePath(filePath: string): string {
<ide> return path.relative(this._rootPath, filePath);
<ide> } | 1 |
Python | Python | use serializer instead of modelserializer | c3b841ae449c66102be7305416eca8acb22c8c42 | <ide><path>rest_framework/fields.py
<ide> def from_native(self, value):
<ide> if not self.allow_none:
<ide> return ''
<ide> else:
<del> # return None explicitly because smart_text(None) == 'None'
<del> # see #1834 for details
<add> # Return None explicitly because smart_text(None) == 'None'. See #1834 for details
<ide> return None
<ide>
<ide> return smart_text(value)
<ide><path>tests/test_fields.py
<ide> class ChoiceFieldModel(models.Model):
<ide> choice = models.CharField(choices=SAMPLE_CHOICES, blank=True, max_length=255)
<ide>
<ide>
<del>class NullableCharFieldModel(models.Model):
<del> char = models.CharField(null=True, blank=True, max_length=4)
<del>
<del>
<ide> class ChoiceFieldModelSerializer(serializers.ModelSerializer):
<ide> class Meta:
<ide> model = ChoiceFieldModel
<ide> class ModelCharField(TestCase):
<ide> Tests for CharField
<ide> """
<ide> def test_none_serializing(self):
<del> class CharFieldSerializer(serializers.ModelSerializer):
<del> class Meta:
<del> model = NullableCharFieldModel
<add> class CharFieldSerializer(serializers.Serializer):
<add> char = serializers.CharField(allow_none=True, required=False)
<ide> serializer = CharFieldSerializer(data={'char': None})
<ide> self.assertTrue(serializer.fields['char'].allow_none)
<ide> self.assertTrue(serializer.is_valid())
<del> self.assertIsNone(serializer.object.char)
<add> self.assertIsNone(serializer.object['char'])
<ide>
<ide>
<ide> class SerializerMethodFieldTest(TestCase): | 2 |
PHP | PHP | use secret config var consistently | dcd7382c7c71ec86ba772ec83ee471c40e60131c | <ide><path>src/Auth/DigestAuthenticate.php
<ide> class DigestAuthenticate extends BasicAuthenticate
<ide> * Besides the keys specified in BaseAuthenticate::$_defaultConfig,
<ide> * DigestAuthenticate uses the following extra keys:
<ide> *
<del> * - `secret` The secret to use for nonce validation. Defaults to Security.salt.
<add> * - `secret` The secret to use for nonce validation. Defaults to Security::getSalt().
<ide> * - `realm` The realm authentication is for, Defaults to the servername.
<ide> * - `qop` Defaults to 'auth', no other values are supported at this time.
<ide> * - `opaque` A string that must be returned unchanged by clients.
<ide> public function loginHeaders(ServerRequest $request)
<ide> protected function generateNonce()
<ide> {
<ide> $expiryTime = microtime(true) + $this->getConfig('nonceLifetime');
<del> $signatureValue = hash_hmac('sha256', $expiryTime . ':' . $this->getConfig('secret'), Security::getSalt());
<add> $secret = $this->getConfig('secret');
<add> $signatureValue = hash_hmac('sha256', $expiryTime . ':' . $secret, $secret);
<ide> $nonceValue = $expiryTime . ':' . $signatureValue;
<ide>
<ide> return base64_encode($nonceValue);
<ide> protected function validNonce($nonce)
<ide> if ($expires < microtime(true)) {
<ide> return false;
<ide> }
<del> $check = hash_hmac('sha256', $expires . ':' . $this->getConfig('secret'), $this->getConfig('secret'));
<add> $secret = $this->getConfig('secret');
<add> $check = hash_hmac('sha256', $expires . ':' . $secret, $secret);
<ide>
<ide> return hash_equals($check, $checksum);
<ide> } | 1 |
Text | Text | fix gitpod dead link | 5138c302bb98b4ea0a34fb03bf067c8219058ffd | <ide><path>README.md
<ide> try {
<ide>
<ide> You can use Gitpod, an online IDE(which is free for Open Source) for contributing or running the examples online.
<ide>
<del>[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js)
<add>[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js)
<ide>
<ide>
<ide> ## Resources | 1 |
Python | Python | fix redefinition of ret type from str to tuple | a9ebe31cdf1f839587403e2a53ede12a3ec6b0a6 | <ide><path>glances/logger.py
<ide>
<ide> """Custom logger class."""
<ide>
<del>import logging
<ide> import os
<ide> import tempfile
<ide> import json
<del>from logging.config import dictConfig
<add>
<add>import logging
<add>import logging.config
<add>
<add>LOG_FILENAME = os.path.join(tempfile.gettempdir(), 'glances.log')
<ide>
<ide> # Define the logging configuration
<ide> LOGGING_CFG = {
<ide> "file": {
<ide> "level": "DEBUG",
<ide> "class": "logging.handlers.RotatingFileHandler",
<del> "formatter": "standard",
<del> 'filename': os.path.join(tempfile.gettempdir(), 'glances.log')
<add> "formatter": "standard"
<ide> },
<ide> "console": {
<ide> "level": "CRITICAL",
<ide>
<ide> def tempfile_name():
<ide> """Return the tempfile name (full path)."""
<del> ret = os.path.join(tempfile.gettempdir(), 'glances.log')
<del> if os.access(ret, os.F_OK) and not os.access(ret, os.W_OK):
<del> print("WARNING: Couldn't write to log file {} (Permission denied)".format(ret))
<del> ret = tempfile.mkstemp(prefix='glances', suffix='.log', text=True)
<del> print("Create a new log file: {}".format(ret[1]))
<add> if os.access(LOG_FILENAME, os.F_OK) and not os.access(LOG_FILENAME, os.W_OK):
<add> print("WARNING: Couldn't write to '{}' (Permission denied)".format(LOG_FILENAME))
<add> ret = tempfile.mkstemp(prefix='glances-', suffix='.log', text=True)
<add> print("Create log file at '{}'".format(ret[1]))
<ide> return ret[1]
<ide>
<del> return ret
<add> return LOG_FILENAME
<ide>
<ide>
<ide> def glances_logger(env_key='LOG_CFG'):
<ide> def glances_logger(env_key='LOG_CFG'):
<ide> # Overwrite the default logger file
<ide> LOGGING_CFG['handlers']['file']['filename'] = tempfile_name()
<ide>
<del> # By default, use the LOGGING_CFG lgger configuration
<add> # By default, use the LOGGING_CFG logger configuration
<ide> config = LOGGING_CFG
<ide>
<ide> # Check if a specific configuration is available
<ide> def glances_logger(env_key='LOG_CFG'):
<ide> config = json.load(f)
<ide>
<ide> # Load the configuration
<del> dictConfig(config)
<add> logging.config.dictConfig(config)
<ide>
<ide> return _logger
<ide>
<add>
<ide> logger = glances_logger() | 1 |
Javascript | Javascript | use prettier api | 40fbed572112a4ac90566fc822e33eb8cb4986c3 | <ide><path>scripts/prettier/index.js
<ide>
<ide> const chalk = require('chalk');
<ide> const glob = require('glob');
<del>const path = require('path');
<ide> const execFileSync = require('child_process').execFileSync;
<add>const prettier = require('prettier');
<add>const fs = require('fs');
<ide>
<ide> const mode = process.argv[2] || 'check';
<ide> const shouldWrite = mode === 'write' || mode === 'write-changed';
<ide> const onlyChanged = mode === 'check-changed' || mode === 'write-changed';
<ide>
<del>const isWindows = process.platform === 'win32';
<del>const prettier = isWindows ? 'prettier.cmd' : 'prettier';
<del>const prettierCmd = path.resolve(
<del> __dirname,
<del> '../../node_modules/.bin/' + prettier
<del>);
<ide> const defaultOptions = {
<del> 'bracket-spacing': 'false',
<del> 'single-quote': 'true',
<del> 'jsx-bracket-same-line': 'true',
<del> 'trailing-comma': 'all',
<del> 'print-width': 80,
<add> bracketSpacing: false,
<add> singleQuote: true,
<add> jsxBracketSameLine: true,
<add> trailingComma: 'all',
<add> printWidth: 80,
<ide> };
<ide> const config = {
<ide> default: {
<ide> const config = {
<ide> 'scripts/bench/benchmarks/**',
<ide> ],
<ide> options: {
<del> 'trailing-comma': 'es5',
<add> trailingComma: 'es5',
<ide> },
<ide> },
<ide> };
<ide> var changedFiles = new Set(
<ide> ]).match(/[^\0]+/g)
<ide> );
<ide>
<add>let didWarn = false;
<ide> Object.keys(config).forEach(key => {
<ide> const patterns = config[key].patterns;
<ide> const options = config[key].options;
<ide> Object.keys(config).forEach(key => {
<ide> return;
<ide> }
<ide>
<del> const args = Object.keys(defaultOptions).map(
<del> k => `--${k}=${(options && options[k]) || defaultOptions[k]}`
<del> );
<del> args.push(`--${shouldWrite ? 'write' : 'l'}`);
<del>
<del> try {
<del> exec(prettierCmd, [...args, ...files]).trim();
<del> } catch (e) {
<del> if (!shouldWrite) {
<del> console.log(
<del> '\n' +
<del> chalk.red(
<del> ` This project uses prettier to format all JavaScript code.\n`
<del> ) +
<del> chalk.dim(` Please run `) +
<del> chalk.reset('yarn prettier-all') +
<del> chalk.dim(` and add changes to files listed below to your commit:`) +
<del> `\n\n` +
<del> e.stdout
<del> );
<del> process.exit(1);
<add> const args = Object.assign({}, defaultOptions, options);
<add> files.forEach(file => {
<add> const input = fs.readFileSync(file, 'utf8');
<add> if (shouldWrite) {
<add> const output = prettier.format(input, args);
<add> if (output !== input) {
<add> fs.writeFileSync(file, output, 'utf8');
<add> }
<add> } else {
<add> if (!prettier.check(input, args)) {
<add> if (!didWarn) {
<add> console.log(
<add> '\n' +
<add> chalk.red(
<add> ` This project uses prettier to format all JavaScript code.\n`
<add> ) +
<add> chalk.dim(` Please run `) +
<add> chalk.reset('yarn prettier-all') +
<add> chalk.dim(
<add> ` and add changes to files listed below to your commit:`
<add> ) +
<add> `\n\n`
<add> );
<add> didWarn = true;
<add> }
<add> console.log(file);
<add> }
<ide> }
<del> throw e;
<del> }
<add> });
<ide> });
<add>
<add>if (didWarn) {
<add> process.exit(1);
<add>} | 1 |
Ruby | Ruby | remove unused codes | 06c72c43bac5608a9b0623506782144f80e1b150 | <ide><path>activerecord/lib/active_record/associations/alias_tracker.rb
<ide> def aliased_name_for(table_name, aliased_name = nil)
<ide> end
<ide> end
<ide>
<del> def pluralize(table_name, base)
<del> base.pluralize_table_names ? table_name.to_s.pluralize : table_name.to_s
<del> end
<del>
<ide> private
<ide>
<ide> def initialize_count_for(name) | 1 |
Python | Python | fix handling of old entity ruler files | 570ab1f481fabbbc520d965e14494637680a22b9 | <ide><path>spacy/pipeline/entityruler.py
<ide> def from_disk(self, path, **kwargs):
<ide> DOCS: https://spacy.io/api/entityruler#from_disk
<ide> """
<ide> path = ensure_path(path)
<del> if path.is_file():
<del> patterns = srsly.read_jsonl(path)
<add> depr_patterns_path = path.with_suffix(".jsonl")
<add> if depr_patterns_path.is_file():
<add> patterns = srsly.read_jsonl(depr_patterns_path)
<ide> self.add_patterns(patterns)
<ide> else:
<ide> cfg = {}
<ide><path>spacy/tests/regression/test_issue3526.py
<ide> def test_entity_ruler_from_disk_old_format_safe(patterns, en_vocab):
<ide> nlp = Language(vocab=en_vocab)
<ide> ruler = EntityRuler(nlp, patterns=patterns, overwrite_ents=True)
<ide> with make_tempdir() as tmpdir:
<del> out_file = tmpdir / "entity_ruler.jsonl"
<del> srsly.write_jsonl(out_file, ruler.patterns)
<del> new_ruler = EntityRuler(nlp)
<del> new_ruler = new_ruler.from_disk(out_file)
<add> out_file = tmpdir / "entity_ruler"
<add> srsly.write_jsonl(out_file.with_suffix(".jsonl"), ruler.patterns)
<add> new_ruler = EntityRuler(nlp).from_disk(out_file)
<ide> for pattern in ruler.patterns:
<ide> assert pattern in new_ruler.patterns
<ide> assert len(new_ruler) == len(ruler) | 2 |
Javascript | Javascript | fix path issues in windows | 4f9bd50aced23e48c709b99c7dd51b01ff8a50bf | <ide><path>src/ripgrep-directory-searcher.js
<ide> module.exports = class RipgrepDirectorySearcher {
<ide> const output = []
<ide>
<ide> for (let pattern of globs) {
<add> // we need to replace path separators by slashes since globs should
<add> // always use always slashes as path separators.
<add> pattern = pattern.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
<add>
<ide> if (pattern.length === 0) {
<ide> continue
<ide> } | 1 |
Text | Text | fix some translation error | c6a59c0ae63834b90f854f32f0b3ebdf2acbe3e9 | <ide><path>docs/docs/01-why-react.zh-CN.md
<ide> React 是一个 Facebook 和 Instagram 用来创建用户界面的 JavaScript
<ide>
<ide> ## 构建可组合的组件
<ide>
<del>React is all about building reusable components. In fact, with React the *only* thing you do is build components. Since they're so encapsulated, components make code reuse, testing, and separation of concerns easy.
<del>
<del>React 是所有关于创建可以复用的组件。事实上,通过 React 你*唯一*要做的事情就是构建组件。得益于其良好的封装性,组件使代码复用、测试和关注分离(separation of concerns)更加简单。
<add>React 都是关于构建可复用的组件。事实上,通过 React 你*唯一*要做的事情就是构建组件。得益于其良好的封装性,组件使代码复用、测试和关注分离(separation of concerns)更加简单。
<ide>
<ide> ## 给它5分钟的时间
<ide> | 1 |
Mixed | Java | use elevation to implement shadows on android | b65f1f223488b52963f80a67bb41956103263d27 | <ide><path>Libraries/Components/View/ViewStylePropTypes.js
<ide> var ViewStylePropTypes = {
<ide> ),
<ide> shadowOpacity: ReactPropTypes.number,
<ide> shadowRadius: ReactPropTypes.number,
<add> /**
<add> * (Android-only) Sets the elevation of a view, using Android's underlying
<add> * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
<add> * This adds a drop shadow to the item and affects z-order for overlapping views.
<add> * Only supported on Android 5.0+, has no effect on earlier versions.
<add> * @platform android
<add> */
<add> elevation: ReactPropTypes.number,
<ide> };
<ide>
<ide> module.exports = ViewStylePropTypes;
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
<ide> import android.graphics.Color;
<ide> import android.graphics.ColorFilter;
<ide> import android.graphics.DashPathEffect;
<add>import android.graphics.Outline;
<ide> import android.graphics.Paint;
<ide> import android.graphics.Path;
<ide> import android.graphics.PathEffect;
<ide> import android.graphics.Rect;
<ide> import android.graphics.RectF;
<ide> import android.graphics.drawable.Drawable;
<add>import android.os.Build;
<ide>
<ide> import com.facebook.react.common.annotations.VisibleForTesting;
<ide> import com.facebook.csslayout.CSSConstants;
<ide> public int getOpacity() {
<ide> return ColorUtil.getOpacityFromColor(ColorUtil.multiplyColorAlpha(mColor, mAlpha));
<ide> }
<ide>
<add> /* Android's elevation implementation requires this to be implemented to know where to draw the shadow. */
<add> @Override
<add> public void getOutline(Outline outline) {
<add> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
<add> super.getOutline(outline);
<add> return;
<add> }
<add> if(!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) {
<add> float extraRadiusFromBorderWidth = (mBorderWidth != null)
<add> ? mBorderWidth.get(Spacing.ALL) / 2f
<add> : 0;
<add> outline.setRoundRect(getBounds(), mBorderRadius + extraRadiusFromBorderWidth);
<add> } else {
<add> super.getOutline(outline);
<add> }
<add> }
<add>
<ide> public void setBorderWidth(int position, float width) {
<ide> if (mBorderWidth == null) {
<ide> mBorderWidth = new Spacing();
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java
<ide> public void setBorderStyle(ReactViewGroup view, @Nullable String borderStyle) {
<ide> view.setBorderStyle(borderStyle);
<ide> }
<ide>
<add> @ReactProp(name = "elevation")
<add> public void setElevation(ReactViewGroup view, float elevation) {
<add> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
<add> view.setElevation(PixelUtil.toPixelFromDIP(elevation));
<add> }
<add> // Do nothing on API < 21
<add> }
<add>
<ide> @ReactProp(name = "pointerEvents")
<ide> public void setPointerEvents(ReactViewGroup view, @Nullable String pointerEventsStr) {
<ide> if (pointerEventsStr != null) { | 3 |
PHP | PHP | add void return type to setup and teardown methods | 8fc3a75b413267a30e41464d358c1d0714a6a186 | <ide><path>src/Illuminate/Foundation/Testing/TestCase.php
<ide> abstract public function createApplication();
<ide> *
<ide> * @return void
<ide> */
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> if (! $this->app) {
<ide> $this->refreshApplication();
<ide> protected function setUpTraits()
<ide> *
<ide> * @return void
<ide> */
<del> protected function tearDown()
<add> protected function tearDown(): void
<ide> {
<ide> if ($this->app) {
<ide> foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
<ide><path>tests/Auth/AuthDatabaseTokenRepositoryTest.php
<ide>
<ide> class AuthDatabaseTokenRepositoryTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> Carbon::setTestNow(Carbon::now());
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide><path>tests/Auth/AuthDatabaseUserProviderTest.php
<ide>
<ide> class AuthDatabaseUserProviderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Auth/AuthEloquentUserProviderTest.php
<ide>
<ide> class AuthEloquentUserProviderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Auth/AuthGuardTest.php
<ide>
<ide> class AuthGuardTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Auth/AuthPasswordBrokerTest.php
<ide>
<ide> class AuthPasswordBrokerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Auth/AuthTokenGuardTest.php
<ide>
<ide> class AuthTokenGuardTest extends TestCase
<ide> {
<del> protected function tearDown()
<add> protected function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Auth/AuthenticateMiddlewareTest.php
<ide> class AuthenticateMiddlewareTest extends TestCase
<ide> {
<ide> protected $auth;
<ide>
<del> public function tearDown()
<del> {
<del> m::close();
<del> }
<del>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $container = Container::setInstance(new Container);
<ide>
<ide> public function setUp()
<ide> });
<ide> }
<ide>
<add> public function tearDown(): void
<add> {
<add> m::close();
<add> }
<add>
<ide> /**
<ide> * @expectedException \Illuminate\Auth\AuthenticationException
<ide> * @expectedExceptionMessage Unauthenticated.
<ide><path>tests/Auth/AuthorizeMiddlewareTest.php
<ide> class AuthorizeMiddlewareTest extends TestCase
<ide> protected $user;
<ide> protected $router;
<ide>
<del> public function tearDown()
<del> {
<del> m::close();
<del> }
<del>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> public function setUp()
<ide> });
<ide> }
<ide>
<add> public function tearDown(): void
<add> {
<add> m::close();
<add> }
<add>
<ide> /**
<ide> * @expectedException \Illuminate\Auth\Access\AuthorizationException
<ide> * @expectedExceptionMessage This action is unauthorized.
<ide><path>tests/Broadcasting/BroadcastEventTest.php
<ide>
<ide> class BroadcastEventTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Broadcasting/BroadcasterTest.php
<ide> class BroadcasterTest extends TestCase
<ide> */
<ide> public $broadcaster;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> $this->broadcaster = new FakeBroadcaster;
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Broadcasting/PusherBroadcasterTest.php
<ide> class PusherBroadcasterTest extends TestCase
<ide>
<ide> public $pusher;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Broadcasting/RedisBroadcasterTest.php
<ide> class RedisBroadcasterTest extends TestCase
<ide> */
<ide> public $broadcaster;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> $this->broadcaster = m::mock(RedisBroadcaster::class)->makePartial();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Broadcasting/UsePusherChannelsNamesTest.php
<ide> class UsePusherChannelConventionsTest extends TestCase
<ide> */
<ide> public $broadcaster;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> $this->broadcaster = new FakeBroadcasterUsingPusherChannelsNames();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Bus/BusDispatcherTest.php
<ide>
<ide> class BusDispatcherTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheDatabaseStoreTest.php
<ide>
<ide> class CacheDatabaseStoreTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheEventsTest.php
<ide>
<ide> class CacheEventsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheFileStoreTest.php
<ide>
<ide> class CacheFileStoreTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> Carbon::setTestNow(Carbon::now());
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide><path>tests/Cache/CacheManagerTest.php
<ide>
<ide> class CacheManagerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheMemcachedConnectorTest.php
<ide>
<ide> class CacheMemcachedConnectorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheRateLimiterTest.php
<ide>
<ide> class CacheRateLimiterTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheRedisStoreTest.php
<ide>
<ide> class CacheRedisStoreTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheRepositoryTest.php
<ide>
<ide> class CacheRepositoryTest extends TestCase
<ide> {
<del> protected function tearDown()
<add> protected function tearDown(): void
<ide> {
<ide> m::close();
<ide> Carbon::setTestNow();
<ide><path>tests/Cache/CacheTableCommandTest.php
<ide>
<ide> class CacheTableCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/CacheTaggedCacheTest.php
<ide>
<ide> class CacheTaggedCacheTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/ClearCommandTest.php
<ide> class ClearCommandTest extends TestCase
<ide> /**
<ide> * {@inheritdoc}
<ide> */
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> protected function setUp()
<ide> $this->command->setLaravel($app);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cache/RedisCacheIntegrationTest.php
<ide> class RedisCacheIntegrationTest extends TestCase
<ide> {
<ide> use InteractsWithRedis;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> $this->setUpRedis();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide> m::close();
<ide><path>tests/Config/RepositoryTest.php
<ide> class RepositoryTest extends TestCase
<ide> */
<ide> protected $config;
<ide>
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> $this->repository = new Repository($this->config = [
<ide> 'foo' => 'bar',
<ide><path>tests/Console/ConsoleApplicationTest.php
<ide>
<ide> class ConsoleApplicationTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Console/ConsoleEventSchedulerTest.php
<ide> class ConsoleEventSchedulerTest extends TestCase
<ide> */
<ide> private $schedule;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> public function setUp()
<ide> $container->instance(Schedule::class, $this->schedule = new Schedule(m::mock(EventMutex::class)));
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Console/ConsoleScheduledEventTest.php
<ide> class ConsoleScheduledEventTest extends TestCase
<ide> */
<ide> protected $defaultTimezone;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->defaultTimezone = date_default_timezone_get();
<ide> date_default_timezone_set('UTC');
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> date_default_timezone_set($this->defaultTimezone);
<ide> Carbon::setTestNow(null);
<ide><path>tests/Console/Scheduling/CacheEventMutexTest.php
<ide> class CacheEventMutexTest extends TestCase
<ide> */
<ide> protected $cacheRepository;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Console/Scheduling/CacheSchedulingMutexTest.php
<ide> class CacheSchedulingMutexTest extends TestCase
<ide> */
<ide> protected $cacheRepository;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Console/Scheduling/EventTest.php
<ide>
<ide> class EventTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Console/Scheduling/FrequencyTest.php
<ide> class FrequencyTest extends TestCase
<ide> */
<ide> protected $event;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->event = new Event(
<ide> m::mock(EventMutex::class),
<ide><path>tests/Cookie/CookieTest.php
<ide>
<ide> class CookieTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Cookie/Middleware/EncryptCookiesTest.php
<ide> class EncryptCookiesTest extends TestCase
<ide> protected $setCookiePath = 'cookie/set';
<ide> protected $queueCookiePath = 'cookie/queue';
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Database/DatabaseConnectionFactoryTest.php
<ide> class DatabaseConnectionFactoryTest extends TestCase
<ide> {
<ide> protected $db;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->db = new DB;
<ide>
<ide> public function setUp()
<ide> $this->db->setAsGlobal();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseConnectionTest.php
<ide>
<ide> class DatabaseConnectionTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseConnectorTest.php
<ide>
<ide> class DatabaseConnectorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentBelongsToManyChunkByIdTest.php
<ide>
<ide> class DatabaseEloquentBelongsToManyChunkByIdTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function testBelongsToChunkById()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('users');
<ide> $this->schema()->drop('articles');
<ide><path>tests/Database/DatabaseEloquentBelongsToManySyncReturnValueTypeTest.php
<ide>
<ide> class DatabaseEloquentBelongsToManySyncReturnValueTypeTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('users');
<ide> $this->schema()->drop('articles');
<ide><path>tests/Database/DatabaseEloquentBelongsToManyWithDefaultAttributesTest.php
<ide>
<ide> class DatabaseEloquentBelongsToManyWithDefaultAttributesTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentBelongsToTest.php
<ide> class DatabaseEloquentBelongsToTest extends TestCase
<ide>
<ide> protected $related;
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentBuilderTest.php
<ide>
<ide> class DatabaseEloquentBuilderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentCastsDatabaseStringTest.php
<ide>
<ide> class DatabaseEloquentCastsDatabaseStringTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('casting_table');
<ide> }
<ide><path>tests/Database/DatabaseEloquentCollectionQueueableTest.php
<ide>
<ide> class DatabaseEloquentCollectionQueueableTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Mockery::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentCollectionTest.php
<ide>
<ide> class DatabaseEloquentCollectionTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentGlobalScopesTest.php
<ide>
<ide> class DatabaseEloquentGlobalScopesTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> public function setUp()
<ide> ])->bootEloquent();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide>
<ide><path>tests/Database/DatabaseEloquentHasManyTest.php
<ide>
<ide> class DatabaseEloquentHasManyTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentHasManyThroughIntegrationTest.php
<ide>
<ide> class DatabaseEloquentHasManyThroughIntegrationTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('users');
<ide> $this->schema()->drop('posts');
<ide><path>tests/Database/DatabaseEloquentHasOneTest.php
<ide> class DatabaseEloquentHasOneTest extends TestCase
<ide>
<ide> protected $parent;
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentHasOneThroughIntegrationTest.php
<ide>
<ide> class DatabaseEloquentHasOneThroughIntegrationTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('users');
<ide> $this->schema()->drop('contracts');
<ide><path>tests/Database/DatabaseEloquentIntegrationTest.php
<ide> class DatabaseEloquentIntegrationTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> protected function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> foreach (['default', 'second_connection'] as $connection) {
<ide> $this->schema($connection)->drop('users');
<ide><path>tests/Database/DatabaseEloquentIntegrationWithTablePrefixTest.php
<ide> class DatabaseEloquentIntegrationWithTablePrefixTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> protected function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> foreach (['default'] as $connection) {
<ide> $this->schema($connection)->drop('users');
<ide><path>tests/Database/DatabaseEloquentIrregularPluralTest.php
<ide>
<ide> class DatabaseEloquentIrregularPluralTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> });
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('irregular_plural_tokens');
<ide> $this->schema()->drop('irregular_plural_humans');
<ide><path>tests/Database/DatabaseEloquentModelTest.php
<ide> class DatabaseEloquentModelTest extends TestCase
<ide> {
<ide> use InteractsWithTime;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> Carbon::setTestNow(Carbon::now());
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide><path>tests/Database/DatabaseEloquentMorphTest.php
<ide>
<ide> class DatabaseEloquentMorphTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Relation::morphMap([], false);
<ide>
<ide><path>tests/Database/DatabaseEloquentMorphToManyTest.php
<ide>
<ide> class DatabaseEloquentMorphToManyTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentMorphToTest.php
<ide> class DatabaseEloquentMorphToTest extends TestCase
<ide>
<ide> protected $related;
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentPivotTest.php
<ide>
<ide> class DatabaseEloquentPivotTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentPolymorphicIntegrationTest.php
<ide>
<ide> class DatabaseEloquentPolymorphicIntegrationTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('users');
<ide> $this->schema()->drop('posts');
<ide><path>tests/Database/DatabaseEloquentPolymorphicRelationsIntegrationTest.php
<ide> class DatabaseEloquentPolymorphicRelationsIntegrationTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> protected function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> foreach (['default'] as $connection) {
<ide> $this->schema($connection)->drop('posts');
<ide><path>tests/Database/DatabaseEloquentRelationTest.php
<ide>
<ide> class DatabaseEloquentRelationTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php
<ide>
<ide> class DatabaseEloquentSoftDeletesIntegrationTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> Carbon::setTestNow(Carbon::now());
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Carbon::setTestNow(null);
<ide>
<ide><path>tests/Database/DatabaseEloquentTimestampsTest.php
<ide>
<ide> class DatabaseEloquentTimestampsTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> public function createSchema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('users');
<ide> $this->schema()->drop('users_created_at');
<ide><path>tests/Database/DatabaseMigrationCreatorTest.php
<ide>
<ide> class DatabaseMigrationCreatorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationInstallCommandTest.php
<ide>
<ide> class DatabaseMigrationInstallCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationMakeCommandTest.php
<ide>
<ide> class DatabaseMigrationMakeCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationMigrateCommandTest.php
<ide>
<ide> class DatabaseMigrationMigrateCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationRefreshCommandTest.php
<ide>
<ide> class DatabaseMigrationRefreshCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationRepositoryTest.php
<ide>
<ide> class DatabaseMigrationRepositoryTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationResetCommandTest.php
<ide>
<ide> class DatabaseMigrationResetCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigrationRollbackCommandTest.php
<ide>
<ide> class DatabaseMigrationRollbackCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseMigratorIntegrationTest.php
<ide> class DatabaseMigratorIntegrationTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->db = $db = new DB;
<ide>
<ide> public function setUp()
<ide> }
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Facade::clearResolvedInstances();
<ide> Facade::setFacadeApplication(null);
<ide><path>tests/Database/DatabaseMySqlSchemaGrammarTest.php
<ide>
<ide> class DatabaseMySqlSchemaGrammarTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabasePostgresSchemaGrammarTest.php
<ide>
<ide> class DatabasePostgresSchemaGrammarTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseProcessorTest.php
<ide>
<ide> class DatabaseProcessorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseQueryBuilderTest.php
<ide>
<ide> class DatabaseQueryBuilderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSQLiteSchemaGrammarTest.php
<ide>
<ide> class DatabaseSQLiteSchemaGrammarTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSchemaBlueprintIntegrationTest.php
<ide> class DatabaseSchemaBlueprintIntegrationTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->db = $db = new DB;
<ide>
<ide> public function setUp()
<ide> Facade::setFacadeApplication($container);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Facade::clearResolvedInstances();
<ide> Facade::setFacadeApplication(null);
<ide><path>tests/Database/DatabaseSchemaBlueprintTest.php
<ide>
<ide> class DatabaseSchemaBlueprintTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSchemaBuilderIntegrationTest.php
<ide> class DatabaseSchemaBuilderIntegrationTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->db = $db = new DB;
<ide>
<ide> public function setUp()
<ide> Facade::setFacadeApplication($container);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Facade::clearResolvedInstances();
<ide> Facade::setFacadeApplication(null);
<ide><path>tests/Database/DatabaseSchemaBuilderTest.php
<ide>
<ide> class DatabaseSchemaBuilderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSeederTest.php
<ide> public function run(Mock $someDependency)
<ide>
<ide> class DatabaseSeederTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSoftDeletingScopeTest.php
<ide>
<ide> class DatabaseSoftDeletingScopeTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSoftDeletingTraitTest.php
<ide>
<ide> class DatabaseSoftDeletingTraitTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/DatabaseSqlServerSchemaGrammarTest.php
<ide>
<ide> class DatabaseSqlServerSchemaGrammarTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Database/SeedCommandTest.php
<ide> public function testHandle()
<ide> $container->shouldHaveReceived('call')->with([$command, 'handle']);
<ide> }
<ide>
<del> protected function tearDown()
<add> protected function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Events/EventsDispatcherTest.php
<ide>
<ide> class EventsDispatcherTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Filesystem/FilesystemAdapterTest.php
<ide> class FilesystemAdapterTest extends TestCase
<ide> private $tempDir;
<ide> private $filesystem;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->tempDir = __DIR__.'/tmp';
<ide> $this->filesystem = new Filesystem(new Local($this->tempDir));
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $filesystem = new Filesystem(new Local(dirname($this->tempDir)));
<ide> $filesystem->deleteDir(basename($this->tempDir));
<ide><path>tests/Filesystem/FilesystemTest.php
<ide> class FilesystemTest extends TestCase
<ide> {
<ide> private $tempDir;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->tempDir = __DIR__.'/tmp';
<ide> mkdir($this->tempDir);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide>
<ide><path>tests/Foundation/Bootstrap/LoadEnvironmentVariablesTest.php
<ide>
<ide> class LoadEnvironmentVariablesTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationApplicationTest.php
<ide>
<ide> class FoundationApplicationTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationAuthenticationTest.php
<ide> protected function mockGuard()
<ide> return $guard;
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationComposerTest.php
<ide>
<ide> class FoundationComposerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationEnvironmentDetectorTest.php
<ide>
<ide> class FoundationEnvironmentDetectorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationExceptionsHandlerTest.php
<ide> class FoundationExceptionsHandlerTest extends TestCase
<ide>
<ide> protected $request;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->config = m::mock(Config::class);
<ide>
<ide> public function setUp()
<ide> $this->handler = new Handler($this->container);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationFormRequestTest.php
<ide> class FoundationFormRequestTest extends TestCase
<ide> {
<ide> protected $mocks = [];
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide>
<ide><path>tests/Foundation/FoundationHelpersTest.php
<ide>
<ide> class FoundationHelpersTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationInteractsWithDatabaseTest.php
<ide> class FoundationInteractsWithDatabaseTest extends TestCase
<ide>
<ide> protected $connection;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->connection = m::mock(Connection::class);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/FoundationProviderRepositoryTest.php
<ide>
<ide> class FoundationProviderRepositoryTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Foundation/Http/Middleware/CheckForMaintenanceModeTest.php
<ide> class CheckForMaintenanceModeTest extends TestCase
<ide> */
<ide> protected $files;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> if (is_null($this->files)) {
<ide> $this->files = new Filesystem;
<ide> public function setUp()
<ide> $this->files->makeDirectory($this->storagePath.'/framework', 0755, true);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->files->deleteDirectory($this->storagePath);
<ide>
<ide><path>tests/Http/HttpRedirectResponseTest.php
<ide>
<ide> class HttpRedirectResponseTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Http/HttpRequestTest.php
<ide>
<ide> class HttpRequestTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Http/HttpResponseTest.php
<ide>
<ide> class HttpResponseTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Integration/Auth/AuthenticationTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> $app['config']->set('hashing', ['driver' => 'bcrypt']);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Cache/DynamoDbStoreTest.php
<ide> */
<ide> class DynamoDbStoreTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Cache/MemcachedIntegrationTest.php
<ide> */
<ide> abstract class MemcachedIntegrationTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Cache/RedisCacheLockTest.php
<ide> class RedisCacheLockTest extends TestCase
<ide> {
<ide> use InteractsWithRedis;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> $this->setUpRedis();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide><path>tests/Integration/Console/ConsoleApplicationTest.php
<ide>
<ide> class ConsoleApplicationTest extends TestCase
<ide> {
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentBelongsToManyTest.php
<ide> */
<ide> class EloquentBelongsToManyTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentBelongsToTest.php
<ide> */
<ide> class EloquentBelongsToTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentCollectionFreshTest.php
<ide> */
<ide> class EloquentCollectionFreshTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentCollectionLoadCountTest.php
<ide> */
<ide> class EloquentCollectionLoadCountTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentCollectionLoadMissingTest.php
<ide> */
<ide> class EloquentCollectionLoadMissingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentCustomPivotCastTest.php
<ide> */
<ide> class EloquentCustomPivotCastTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentDeleteTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentFactoryBuilderTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> });
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentHasManyThroughTest.php
<ide> */
<ide> class EloquentHasManyThroughTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentLazyEagerLoadingTest.php
<ide> */
<ide> class EloquentLazyEagerLoadingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelConnectionsTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelCustomEventsTest.php
<ide> */
<ide> class EloquentModelCustomEventsTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelDateCastingTest.php
<ide> */
<ide> class EloquentModelDateCastingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelDecimalCastingTest.php
<ide> */
<ide> class EloquentModelDecimalCastingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelJsonCastingTest.php
<ide> */
<ide> class EloquentModelJsonCastingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelLoadCountTest.php
<ide> */
<ide> class EloquentModelLoadCountTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelLoadMissingTest.php
<ide> */
<ide> class EloquentModelLoadMissingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelRefreshTest.php
<ide> */
<ide> class EloquentModelRefreshTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentModelTest.php
<ide> */
<ide> class EloquentModelTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentMorphManyTest.php
<ide> */
<ide> class EloquentMorphManyTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentMorphToGlobalScopesTest.php
<ide> */
<ide> class EloquentMorphToGlobalScopesTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentMorphToLazyEagerLoadingTest.php
<ide> */
<ide> class EloquentMorphToLazyEagerLoadingTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentMorphToSelectTest.php
<ide> */
<ide> class EloquentMorphToSelectTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentMorphToTouchesTest.php
<ide> */
<ide> class EloquentMorphToTouchesTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentPaginateTest.php
<ide> */
<ide> class EloquentPaginateTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentPivotSerializationTest.php
<ide> */
<ide> class EloquentPivotSerializationTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentPushTest.php
<ide> */
<ide> class EloquentPushTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentTouchParentWithGlobalScopeTest.php
<ide> */
<ide> class EloquentTouchParentWithGlobalScopeTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentUpdateTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentWhereHasTest.php
<ide> */
<ide> class EloquentWhereHasTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentWhereTest.php
<ide> */
<ide> class EloquentWhereTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/EloquentWithCountTest.php
<ide> */
<ide> class EloquentWithCountTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/MigrateWithRealpathTest.php
<ide>
<ide> class MigrateWithRealpathTest extends DatabaseTestCase
<ide> {
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Database/QueryBuilderTest.php
<ide> */
<ide> class QueryBuilderTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Events/EventFakeTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> *
<ide> * @return void
<ide> */
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> protected function setUp()
<ide> *
<ide> * @return void
<ide> */
<del> protected function tearDown()
<add> protected function tearDown(): void
<ide> {
<ide> Schema::dropIfExists('posts');
<ide>
<ide><path>tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Http/Middleware/VerifyCsrfTokenExceptTest.php
<ide> class VerifyCsrfTokenExceptTest extends TestCase
<ide> private $stub;
<ide> private $request;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Http/ThrottleRequestsTest.php
<ide> */
<ide> class ThrottleRequestsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide> Carbon::setTestNow(null);
<ide><path>tests/Integration/Http/ThrottleRequestsWithRedisTest.php
<ide> class ThrottleRequestsWithRedisTest extends TestCase
<ide> {
<ide> use InteractsWithRedis;
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide> Carbon::setTestNow(null);
<ide><path>tests/Integration/Mail/SendingMailWithLocaleTest.php
<ide> */
<ide> class SendingMailWithLocaleTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> }
<ide><path>tests/Integration/Notifications/SendingMailNotificationsTest.php
<ide> class SendingMailNotificationsTest extends TestCase
<ide> public $mailer;
<ide> public $markdown;
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide> protected function getEnvironmentSetUp($app)
<ide> });
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Queue/CallQueuedHandlerTest.php
<ide> */
<ide> class CallQueuedHandlerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide>
<ide><path>tests/Integration/Queue/JobChainingTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> JobChainingTestFirstJob::$ran = false;
<ide> JobChainingTestSecondJob::$ran = false;
<ide><path>tests/Integration/Queue/ModelSerializationTest.php
<ide> protected function getEnvironmentSetUp($app)
<ide> ]);
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Integration/Validation/ValidatorTest.php
<ide>
<ide> class ValidatorTest extends DatabaseTestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Log/LogLoggerTest.php
<ide>
<ide> class LogLoggerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Mail/MailMailerTest.php
<ide>
<ide> class MailMailerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Mail/MailMarkdownTest.php
<ide>
<ide> class MailMarkdownTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Mail/MailMessageTest.php
<ide> class MailMessageTest extends TestCase
<ide> */
<ide> protected $message;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> $this->swift = m::mock(Swift_Mime_Message::class);
<ide> $this->message = new Message($this->swift);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Mail/MailableQueuedTest.php
<ide>
<ide> class MailableQueuedTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Notifications/NotificationBroadcastChannelTest.php
<ide>
<ide> class NotificationBroadcastChannelTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Notifications/NotificationChannelManagerTest.php
<ide>
<ide> class NotificationChannelManagerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Notifications/NotificationDatabaseChannelTest.php
<ide>
<ide> class NotificationDatabaseChannelTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Notifications/NotificationRoutesNotificationsTest.php
<ide>
<ide> class NotificationRoutesNotificationsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Notifications/NotificationSendQueuedNotificationTest.php
<ide>
<ide> class NotificationSendQueuedNotificationTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Pagination/LengthAwarePaginatorTest.php
<ide> class LengthAwarePaginatorTest extends TestCase
<ide> */
<ide> private $options;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->options = ['onEachSide' => 5];
<ide> $this->p = new LengthAwarePaginator($array = ['item1', 'item2', 'item3', 'item4'], 4, 2, 2, $this->options);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> unset($this->p);
<ide> }
<ide><path>tests/Queue/QueueBeanstalkdJobTest.php
<ide>
<ide> class QueueBeanstalkdJobTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueBeanstalkdQueueTest.php
<ide>
<ide> class QueueBeanstalkdQueueTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueDatabaseQueueIntegrationTest.php
<ide> class QueueDatabaseQueueIntegrationTest extends TestCase
<ide> */
<ide> protected $container;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> protected function schema()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema()->drop('jobs');
<ide> }
<ide><path>tests/Queue/QueueDatabaseQueueUnitTest.php
<ide>
<ide> class QueueDatabaseQueueUnitTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueListenerTest.php
<ide>
<ide> class QueueListenerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueManagerTest.php
<ide>
<ide> class QueueManagerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueRedisJobTest.php
<ide>
<ide> class QueueRedisJobTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueRedisQueueTest.php
<ide>
<ide> class QueueRedisQueueTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueSqsJobTest.php
<ide>
<ide> class QueueSqsJobTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->key = 'AMAZONSQSKEY';
<ide> $this->secret = 'AmAz0n+SqSsEcReT+aLpHaNuM3R1CsTr1nG';
<ide> public function setUp()
<ide> ];
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueSqsQueueTest.php
<ide>
<ide> class QueueSqsQueueTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> // Use Mockery to mock the SqsClient
<ide> $this->sqs = m::mock(SqsClient::class);
<ide><path>tests/Queue/QueueSyncQueueTest.php
<ide>
<ide> class QueueSyncQueueTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Queue/QueueWorkerTest.php
<ide> class QueueWorkerTest extends TestCase
<ide> public $events;
<ide> public $exceptionHandler;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->events = m::spy(Dispatcher::class);
<ide> $this->exceptionHandler = m::spy(ExceptionHandler::class);
<ide> public function setUp()
<ide> $container->instance(ExceptionHandler::class, $this->exceptionHandler);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Container::setInstance();
<ide> }
<ide><path>tests/Queue/RedisQueueIntegrationTest.php
<ide> class RedisQueueIntegrationTest extends TestCase
<ide> */
<ide> private $queue;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> Carbon::setTestNow(Carbon::now());
<ide> parent::setUp();
<ide> $this->setUpRedis();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Carbon::setTestNow(null);
<ide> parent::tearDown();
<ide><path>tests/Redis/ConcurrentLimiterTest.php
<ide> class ConcurrentLimiterTest extends TestCase
<ide> {
<ide> use InteractsWithRedis;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Redis/DurationLimiterTest.php
<ide> class DurationLimiterTest extends TestCase
<ide> {
<ide> use InteractsWithRedis;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Redis/RedisConnectionTest.php
<ide> class RedisConnectionTest extends TestCase
<ide> {
<ide> use InteractsWithRedis;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> $this->setUpRedis();
<ide> public function setUp()
<ide> }
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide> $this->tearDownRedis();
<ide><path>tests/Routing/RouteCollectionTest.php
<ide> class RouteCollectionTest extends TestCase
<ide> */
<ide> protected $routeCollection;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide><path>tests/Routing/RouteRegistrarTest.php
<ide> class RouteRegistrarTest extends TestCase
<ide> */
<ide> protected $router;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> $this->router = new Router(m::mock(Dispatcher::class), Container::getInstance());
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Routing/RoutingRedirectorTest.php
<ide> class RoutingRedirectorTest extends TestCase
<ide> protected $session;
<ide> protected $redirect;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->headers = m::mock(HeaderBag::class);
<ide>
<ide> public function setUp()
<ide> $this->redirect->setSession($this->session);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Session/EncryptedSessionStoreTest.php
<ide>
<ide> class EncryptedSessionStoreTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Session/SessionStoreTest.php
<ide>
<ide> class SessionStoreTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Session/SessionTableCommandTest.php
<ide>
<ide> class SessionTableCommandTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Support/DateFacadeTest.php
<ide>
<ide> class DateFacadeTest extends TestCase
<ide> {
<del> protected function tearDown()
<add> protected function tearDown(): void
<ide> {
<ide> parent::tearDown();
<ide> DateFactory::use(Carbon::class);
<ide><path>tests/Support/SupportCapsuleManagerTraitTest.php
<ide> class SupportCapsuleManagerTraitTest extends TestCase
<ide> {
<ide> use CapsuleManagerTrait;
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Support/SupportCarbonTest.php
<ide> class SupportCarbonTest extends TestCase
<ide> */
<ide> protected $now;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> Carbon::setTestNow($this->now = Carbon::create(2017, 6, 27, 13, 14, 15, 'UTC'));
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Carbon::setTestNow();
<ide> Carbon::serializeUsing(null);
<ide><path>tests/Support/SupportFacadeTest.php
<ide>
<ide> class SupportFacadeTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> Facade::clearResolvedInstances();
<ide> FacadeStub::setFacadeApplication(null);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Support/SupportFacadesEventTest.php
<ide> class SupportFacadesEventTest extends TestCase
<ide> {
<ide> private $events;
<ide>
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide>
<ide> protected function setUp()
<ide> Facade::setFacadeApplication($container);
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Event::clearResolvedInstances();
<ide>
<ide><path>tests/Support/SupportHelpersTest.php
<ide>
<ide> class SupportHelpersTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Support/SupportMacroableTest.php
<ide> class SupportMacroableTest extends TestCase
<ide> {
<ide> private $macroable;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->macroable = $this->createObjectForTrait();
<ide> }
<ide><path>tests/Support/SupportMessageBagTest.php
<ide>
<ide> class SupportMessageBagTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Support/SupportServiceProviderTest.php
<ide>
<ide> class SupportServiceProviderTest extends TestCase
<ide> {
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> ServiceProvider::$publishes = [];
<ide> ServiceProvider::$publishGroups = [];
<ide> public function setUp()
<ide> $two->boot();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Support/SupportTestingEventFakeTest.php
<ide>
<ide> class SupportTestingEventFakeTest extends TestCase
<ide> {
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> $this->fake = new EventFake(m::mock(Dispatcher::class));
<ide><path>tests/Support/SupportTestingMailFakeTest.php
<ide> class SupportTestingMailFakeTest extends TestCase
<ide> */
<ide> private $mailable;
<ide>
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> $this->fake = new MailFake;
<ide><path>tests/Support/SupportTestingNotificationFakeTest.php
<ide> class SupportTestingNotificationFakeTest extends TestCase
<ide> */
<ide> private $user;
<ide>
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> $this->fake = new NotificationFake;
<ide><path>tests/Support/SupportTestingQueueFakeTest.php
<ide> class SupportTestingQueueFakeTest extends TestCase
<ide> */
<ide> private $job;
<ide>
<del> protected function setUp()
<add> protected function setUp(): void
<ide> {
<ide> parent::setUp();
<ide> $this->fake = new QueueFake(new Application);
<ide><path>tests/Translation/TranslationFileLoaderTest.php
<ide>
<ide> class TranslationFileLoaderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Translation/TranslationTranslatorTest.php
<ide>
<ide> class TranslationTranslatorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Validation/ValidationDatabasePresenceVerifierTest.php
<ide>
<ide> class ValidationDatabasePresenceVerifierTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Validation/ValidationExistsRuleTest.php
<ide> class ValidationExistsRuleTest extends TestCase
<ide> *
<ide> * @return void
<ide> */
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $db = new DB;
<ide>
<ide> protected function getConnectionResolver()
<ide> *
<ide> * @return void
<ide> */
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> $this->schema('default')->drop('users');
<ide> }
<ide><path>tests/Validation/ValidationFactoryTest.php
<ide>
<ide> class ValidationFactoryTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/Validation/ValidationValidatorTest.php
<ide>
<ide> class ValidationValidatorTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> Carbon::setTestNow();
<ide> m::close();
<ide><path>tests/View/Blade/AbstractBladeTestCase.php
<ide> abstract class AbstractBladeTestCase extends TestCase
<ide> {
<ide> protected $compiler;
<ide>
<del> public function setUp()
<add> public function setUp(): void
<ide> {
<ide> $this->compiler = new BladeCompiler(m::mock(Filesystem::class), __DIR__);
<ide> parent::setUp();
<ide> }
<ide>
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide>
<ide><path>tests/View/Blade/BladeElseAuthStatementsTest.php
<ide>
<ide> class BladeElseAuthStatementsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/Blade/BladeElseGuestStatementsTest.php
<ide>
<ide> class BladeElseGuestStatementsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/Blade/BladeIfAuthStatementsTest.php
<ide>
<ide> class BladeIfAuthStatementsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/Blade/BladeIfGuestStatementsTest.php
<ide>
<ide> class BladeIfGuestStatementsTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/ViewBladeCompilerTest.php
<ide>
<ide> class ViewBladeCompilerTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/ViewCompilerEngineTest.php
<ide>
<ide> class ViewCompilerEngineTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/ViewFactoryTest.php
<ide>
<ide> class ViewFactoryTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/ViewFileViewFinderTest.php
<ide>
<ide> class ViewFileViewFinderTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/ViewPhpEngineTest.php
<ide>
<ide> class ViewPhpEngineTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> }
<ide><path>tests/View/ViewTest.php
<ide>
<ide> class ViewTest extends TestCase
<ide> {
<del> public function tearDown()
<add> public function tearDown(): void
<ide> {
<ide> m::close();
<ide> } | 220 |
Ruby | Ruby | adjust link command for updated error handling | 72d83adaf379d69f3b353a55acff7dc9e30a5656 | <ide><path>Library/Homebrew/cmd/link.rb
<ide> def link
<ide> end
<ide>
<ide> keg.lock do
<del> print "Linking #{keg}... " do
<del> puts if ARGV.verbose?
<del> puts "#{keg.link(mode)} symlinks created"
<add> print "Linking #{keg}... "
<add> puts if ARGV.verbose?
<add>
<add> begin
<add> n = keg.link(mode)
<add> rescue Keg::LinkError
<add> puts
<add> raise
<add> else
<add> puts "#{n} symlinks created"
<ide> end
<ide> end
<ide> end
<ide> def keg_only?(name)
<ide> rescue FormulaUnavailableError
<ide> false
<ide> end
<del>
<del> # Allows us to ensure a puts happens before the block exits so that if say,
<del> # an exception is thrown, its output starts on a new line.
<del> def print str, &block
<del> Kernel.print str
<del>
<del> STDERR.extend Module.new {
<del> def puts(*args)
<del> unless $did_puts
<del> STDOUT.puts
<del> $did_puts = true
<del> end
<del> super
<del> end
<del> }
<del>
<del> puts_capture = Class.new do
<del> def self.puts(*args)
<del> $did_puts = true
<del> Kernel.puts(*args)
<del> end
<del> end
<del>
<del> puts_capture.instance_eval(&block)
<del>
<del> ensure
<del> puts unless $did_puts
<del> end
<del>
<ide> end | 1 |
Javascript | Javascript | remove unused field | 1074c75f32be8932bb0974a044be2717830d3954 | <ide><path>web/viewer.js
<ide> var Cache = function cacheCache(size) {
<ide>
<ide> var RenderingQueue = (function RenderingQueueClosure() {
<ide> function RenderingQueue() {
<del> this.busy = false;
<ide> this.items = [];
<ide> }
<ide> | 1 |
Mixed | Ruby | improve help for rake tasks | 718814a4f2e0430f53d9d45d317da0d2657b98e4 | <ide><path>railties/CHANGELOG.md
<add>* Show Rake task description if command is run with -h.
<add>
<add> Adding `-h` (or `--help`) to a Rails command that's a Rake task, now returns
<add> the task description instead of the general Rake help.
<add>
<add> *Petrik de Heus*
<add>
<ide> * Fix `config_for` error when there's only a shared root array.
<ide>
<ide> *Loïc Delmaire*
<ide><path>railties/lib/rails/command.rb
<ide> def invoke(full_namespace, args = [], **config)
<ide> if command && command.all_commands[command_name]
<ide> command.perform(command_name, args, config)
<ide> else
<add> args = ["--describe", full_namespace] if HELP_MAPPINGS.include?(args[0])
<ide> find_by_namespace("rake").perform(full_namespace, args, config)
<ide> end
<ide> ensure
<ide><path>railties/test/application/rake_test.rb
<ide> def test_gems_tasks_are_loaded_first_than_application_ones
<ide> assert_match(/^Rails version/, rails("invoke_about"))
<ide> end
<ide>
<add> test "help arguments describe rake tasks" do
<add> task_description = <<~DESC
<add> rails db:migrate
<add> Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog).
<add> DESC
<add>
<add> assert_match task_description, rails("db:migrate", "-h")
<add> end
<add>
<ide> test "task backtrace is silenced" do
<ide> add_to_config <<-RUBY
<ide> rake_tasks do | 3 |
Mixed | Python | add callback to copy vocab/tokenizer from model | bdb485cc80ca6822471eac0a29ac2782d9b55450 | <ide><path>spacy/errors.py
<ide> class Errors:
<ide> E202 = ("Unsupported alignment mode '{mode}'. Supported modes: {modes}.")
<ide>
<ide> # New errors added in v3.x
<add> E872 = ("Unable to copy tokenizer from base model due to different "
<add> 'tokenizer settings: current tokenizer config "{curr_config}" '
<add> 'vs. base model "{base_config}"')
<ide> E873 = ("Unable to merge a span from doc.spans with key '{key}' and text "
<ide> "'{text}'. This is likely a bug in spaCy, so feel free to open an "
<ide> "issue: https://github.com/explosion/spaCy/issues")
<ide><path>spacy/training/__init__.py
<ide> from .gold_io import docs_to_json, read_json_file # noqa: F401
<ide> from .batchers import minibatch_by_padded_size, minibatch_by_words # noqa: F401
<ide> from .loggers import console_logger, wandb_logger # noqa: F401
<add>from .callbacks import create_copy_from_base_model # noqa: F401
<ide><path>spacy/training/callbacks.py
<add>from typing import Optional
<add>from ..errors import Errors
<add>from ..language import Language
<add>from ..util import load_model, registry, logger
<add>
<add>
<add>@registry.callbacks("spacy.copy_from_base_model.v1")
<add>def create_copy_from_base_model(
<add> tokenizer: Optional[str] = None,
<add> vocab: Optional[str] = None,
<add>) -> Language:
<add> def copy_from_base_model(nlp):
<add> if tokenizer:
<add> logger.info(f"Copying tokenizer from: {tokenizer}")
<add> base_nlp = load_model(tokenizer)
<add> if nlp.config["nlp"]["tokenizer"] == base_nlp.config["nlp"]["tokenizer"]:
<add> nlp.tokenizer.from_bytes(base_nlp.tokenizer.to_bytes(exclude=["vocab"]))
<add> else:
<add> raise ValueError(
<add> Errors.E872.format(
<add> curr_config=nlp.config["nlp"]["tokenizer"],
<add> base_config=base_nlp.config["nlp"]["tokenizer"],
<add> )
<add> )
<add> if vocab:
<add> logger.info(f"Copying vocab from: {vocab}")
<add> # only reload if the vocab is from a different model
<add> if tokenizer != vocab:
<add> base_nlp = load_model(vocab)
<add> nlp.vocab.from_bytes(base_nlp.vocab.to_bytes())
<add>
<add> return copy_from_base_model
<ide><path>website/docs/api/top-level.md
<ide> menu:
<ide> - ['Readers', 'readers']
<ide> - ['Batchers', 'batchers']
<ide> - ['Augmenters', 'augmenters']
<add> - ['Callbacks', 'callbacks']
<ide> - ['Training & Alignment', 'gold']
<ide> - ['Utility Functions', 'util']
<ide> ---
<ide> useful for making the model less sensitive to capitalization.
<ide> | `level` | The percentage of texts that will be augmented. ~~float~~ |
<ide> | **CREATES** | A function that takes the current `nlp` object and an [`Example`](/api/example) and yields augmented `Example` objects. ~~Callable[[Language, Example], Iterator[Example]]~~ |
<ide>
<add>## Callbacks {#callbacks source="spacy/training/callbacks.py" new="3"}
<add>
<add>The config supports [callbacks](/usage/training#custom-code-nlp-callbacks) at
<add>several points in the lifecycle that can be used modify the `nlp` object.
<add>
<add>### spacy.copy_from_base_model.v1 {#copy_from_base_model tag="registered function"}
<add>
<add>> #### Example config
<add>>
<add>> ```ini
<add>> [initialize.before_init]
<add>> @callbacks = "spacy.copy_from_base_model.v1"
<add>> tokenizer = "en_core_sci_md"
<add>> vocab = "en_core_sci_md"
<add>> ```
<add>
<add>Copy the tokenizer and/or vocab from the specified models. It's similar to the
<add>v2 [base model](https://v2.spacy.io/api/cli#train) option and useful in
<add>combination with
<add>[sourced components](/usage/processing-pipelines#sourced-components) when
<add>fine-tuning an existing pipeline. The vocab includes the lookups and the vectors
<add>from the specified model. Intended for use in `[initialize.before_init]`.
<add>
<add>| Name | Description |
<add>| ----------- | ----------------------------------------------------------------------------------------------------------------------- |
<add>| `tokenizer` | The pipeline to copy the tokenizer from. Defaults to `None`. ~~Optional[str]~~ |
<add>| `vocab` | The pipeline to copy the vocab from. The vocab includes the lookups and vectors. Defaults to `None`. ~~Optional[str]~~ |
<add>| **CREATES** | A function that takes the current `nlp` object and modifies its `tokenizer` and `vocab`. ~~Callable[[Language], None]~~ |
<add>
<ide> ## Training data and alignment {#gold source="spacy/training"}
<ide>
<ide> ### training.offsets_to_biluo_tags {#offsets_to_biluo_tags tag="function"} | 4 |
Ruby | Ruby | fix appcast spec | f0ece0432d8c938d245dbca22fd2b08dc12cf7ff | <ide><path>Library/Homebrew/test/cask/audit_spec.rb
<ide> def tmp_cask(name, text)
<ide> end
<ide> end
<ide>
<del> describe "hosting with appcast checks" do
<del> let(:message) { /please add an appcast/ }
<add> describe "hosting with livecheck checks" do
<add> let(:message) { /please add a livecheck/ }
<ide>
<del> context "when the download does not use hosting with an appcast" do
<add> context "when the download does not use hosting with a livecheck" do
<ide> let(:cask_token) { "basic-cask" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<del> context "when the download is hosted on SourceForge and has an appcast" do
<add> context "when the download is hosted on SourceForge and has a livecheck" do
<ide> let(:cask_token) { "sourceforge-with-appcast" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<del> context "when the download is hosted on SourceForge and does not have an appcast" do
<add> context "when the download is hosted on SourceForge and does not have a livecheck" do
<ide> let(:cask_token) { "sourceforge-correct-url-format" }
<ide>
<ide> it { is_expected.to fail_with(message) }
<ide> end
<ide>
<del> context "when the download is hosted on DevMate and has an appcast" do
<add> context "when the download is hosted on DevMate and has a livecheck" do
<ide> let(:cask_token) { "devmate-with-appcast" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<del> context "when the download is hosted on DevMate and does not have an appcast" do
<add> context "when the download is hosted on DevMate and does not have a livecheck" do
<ide> let(:cask_token) { "devmate-without-appcast" }
<ide>
<ide> it { is_expected.to fail_with(message) }
<ide> end
<ide>
<del> context "when the download is hosted on HockeyApp and has an appcast" do
<add> context "when the download is hosted on HockeyApp and has a livecheck" do
<ide> let(:cask_token) { "hockeyapp-with-appcast" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<del> context "when the download is hosted on HockeyApp and does not have an appcast" do
<add> context "when the download is hosted on HockeyApp and does not have a livecheck" do
<ide> let(:cask_token) { "hockeyapp-without-appcast" }
<ide>
<ide> it { is_expected.to fail_with(message) } | 1 |
Python | Python | fix composable permissions | 74574217a4de871ea47cded715caa5e9876d3a6a | <ide><path>rest_framework/permissions.py
<ide> SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')
<ide>
<ide>
<del>class OperandHolder:
<add>class OperationHolderMixin:
<add> def __and__(self, other):
<add> return OperandHolder(AND, self, other)
<add>
<add> def __or__(self, other):
<add> return OperandHolder(OR, self, other)
<add>
<add> def __rand__(self, other):
<add> return OperandHolder(AND, other, self)
<add>
<add> def __ror__(self, other):
<add> return OperandHolder(OR, other, self)
<add>
<add>
<add>class OperandHolder(OperationHolderMixin):
<ide> def __init__(self, operator_class, op1_class, op2_class):
<ide> self.operator_class = operator_class
<ide> self.op1_class = op1_class
<ide> def has_object_permission(self, request, view, obj):
<ide> )
<ide>
<ide>
<del>class BasePermissionMetaclass(type):
<del> def __and__(cls, other):
<del> return OperandHolder(AND, cls, other)
<del>
<del> def __or__(cls, other):
<del> return OperandHolder(OR, cls, other)
<del>
<del> def __rand__(cls, other):
<del> return OperandHolder(AND, other, cls)
<del>
<del> def __ror__(cls, other):
<del> return OperandHolder(OR, other, cls)
<add>class BasePermissionMetaclass(OperationHolderMixin, type):
<add> pass
<ide>
<ide>
<ide> @six.add_metaclass(BasePermissionMetaclass)
<ide><path>tests/test_permissions.py
<ide> def test_several_levels(self):
<ide> permissions.IsAuthenticated
<ide> )
<ide> assert composed_perm().has_permission(request, None) is True
<add>
<add> def test_several_levels_and_precedence(self):
<add> request = factory.get('/1', format='json')
<add> request.user = self.user
<add> composed_perm = (
<add> permissions.IsAuthenticated &
<add> permissions.IsAuthenticated |
<add> permissions.IsAuthenticated &
<add> permissions.IsAuthenticated
<add> )
<add> assert composed_perm().has_permission(request, None) is True | 2 |
Ruby | Ruby | use specs when checking http content problems | 180d8ca2b2aa860e84764469dabfef6c0109fd01 | <ide><path>Library/Homebrew/resource_auditor.rb
<ide> def audit_urls
<ide> # pull request.
<ide> next if url.match?(%r{^https://dl.bintray.com/homebrew/mirror/})
<ide>
<del> if http_content_problem = curl_check_http_content(url)
<add> if http_content_problem = curl_check_http_content(url, specs: specs)
<ide> problem http_content_problem
<ide> end
<ide> elsif strategy <= GitDownloadStrategy
<ide><path>Library/Homebrew/utils/curl.rb
<ide> def url_protected_by_incapsula?(details)
<ide> details[:headers].match?(/^Set-Cookie: incap_ses_/i)
<ide> end
<ide>
<del> def curl_check_http_content(url, user_agents: [:default], check_content: false, strict: false)
<add> def curl_check_http_content(url, specs: {}, user_agents: [:default], check_content: false, strict: false)
<ide> return unless url.start_with? "http"
<ide>
<ide> secure_url = url.sub(/\Ahttp:/, "https:")
<ide> def curl_check_http_content(url, user_agents: [:default], check_content: false,
<ide> if url != secure_url
<ide> user_agents.each do |user_agent|
<ide> secure_details =
<del> curl_http_content_headers_and_checksum(secure_url, hash_needed: true, user_agent: user_agent)
<add> curl_http_content_headers_and_checksum(secure_url, specs: specs, hash_needed: true,
<add> user_agent: user_agent)
<ide>
<ide> next unless http_status_ok?(secure_details[:status])
<ide>
<ide> def curl_check_http_content(url, user_agents: [:default], check_content: false,
<ide>
<ide> details = nil
<ide> user_agents.each do |user_agent|
<del> details = curl_http_content_headers_and_checksum(url, hash_needed: hash_needed, user_agent: user_agent)
<add> details =
<add> curl_http_content_headers_and_checksum(url, specs: specs, hash_needed: hash_needed, user_agent: user_agent)
<ide> break if http_status_ok?(details[:status])
<ide> end
<ide>
<ide> def curl_check_http_content(url, user_agents: [:default], check_content: false,
<ide> "The URL #{url} may be able to use HTTPS rather than HTTP. Please verify it in a browser."
<ide> end
<ide>
<del> def curl_http_content_headers_and_checksum(url, hash_needed: false, user_agent: :default)
<add> def curl_http_content_headers_and_checksum(url, specs: {}, hash_needed: false, user_agent: :default)
<ide> file = Tempfile.new.tap(&:close)
<ide>
<add> specs = specs.flat_map { |option, argument| ["--#{option.to_s.tr("_", "-")}", argument] }
<ide> max_time = hash_needed ? "600" : "25"
<ide> output, _, status = curl_output(
<del> "--dump-header", "-", "--output", file.path, "--location",
<add> *specs, "--dump-header", "-", "--output", file.path, "--location",
<ide> "--connect-timeout", "15", "--max-time", max_time, "--retry-max-time", max_time, url,
<ide> user_agent: user_agent
<ide> ) | 2 |
Javascript | Javascript | avoid redboxes when highlighting | c64f25ac85d32186c0400b8aa27785280cdf2799 | <ide><path>Libraries/Inspector/DevtoolsOverlay.js
<ide> export default function DevtoolsOverlay({
<ide> clearTimeout(hideTimeoutId);
<ide> // Shape of `node` is different in Fabric.
<ide> const component = node.canonical ?? node;
<add> if (!component) {
<add> return;
<add> }
<ide>
<ide> component.measure((x, y, width, height, left, top) => {
<ide> setInspected({ | 1 |
Java | Java | log correct class name for introspection failure | d4ee75ddf041835e229d5a7857206030e8c5be65 | <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassUtils.java
<ide> public static boolean isLiteConfigurationCandidate(AnnotationMetadata metadata)
<ide> }
<ide> catch (Throwable ex) {
<ide> if (logger.isDebugEnabled()) {
<del> logger.debug("Failed to introspect @Bean methods on class [" + metadata.getClass() + "]: " + ex);
<add> logger.debug("Failed to introspect @Bean methods on class [" + metadata.getClassName() + "]: " + ex);
<ide> }
<ide> return false;
<ide> } | 1 |
Javascript | Javascript | stop quotes reloading | 6ce9482b22d6cfd234169fe6706e388e20322e38 | <ide><path>client/src/components/welcome/index.js
<ide> import { randomQuote } from '../../utils/get-words';
<ide>
<ide> import './welcome.css';
<ide>
<add>// created outside the function, so that the quotes don't change unless the
<add>// page is reloaded.
<add>
<add>const { quote, author } = randomQuote();
<add>
<ide> function Welcome({ name }) {
<del> const { quote, author } = randomQuote();
<ide> return (
<ide> <Fragment>
<ide> <Row> | 1 |
Text | Text | update docs to new method of accessing addons | 7fa8c79d403af36871f098cd50cb954aa764ab15 | <ide><path>npm-react/README.md
<ide> To use React in production mode, set the environment variable `NODE_ENV` to `pro
<ide> ```js
<ide> var React = require('react');
<ide>
<del>// You can also access ReactWithAddons.
<del>var React = require('react/addons');
<add>// Addons can be accessed individually from the "addons" directory.
<add>var createFragment = require('react/addons/createFragment');
<add>var immutabilityHelpers = require('react/addons/updates');
<add>var CSSTransitionGroup = require('react/addons/CSSTransitionGroup');
<ide> ```
<ide>
<add>For a complete list of addons vist the [addons documention page](https://facebook.github.io/react/docs/addons.html)
<add> | 1 |
PHP | PHP | add more paths | 262dec16f8ee095d12ef10f94e85e442c04e5db2 | <ide><path>bootstrap/paths.php
<ide> */
<ide>
<ide> 'commands' => __DIR__.'/../app/src/Console',
<add> 'config' => __DIR__.'/../app/config',
<ide> 'controllers' => __DIR__.'/../app/src/Http/Controllers',
<add> 'database' => __DIR__.'/../app/database',
<ide> 'filters' => __DIR__.'/../app/src/Http/Filters',
<add> 'lang' => __DIR__.'/../app/lang',
<ide> 'requests' => __DIR__.'/../app/src/Http/Requests',
<ide> 'src' => __DIR__.'/../app/src',
<ide> | 1 |
Javascript | Javascript | use pointer events for hover | 7e8992705a2e5b1721dcb2ffe788342fa6a2f2d0 | <ide><path>Libraries/Inspector/DevtoolsOverlay.js
<ide> import type {PressEvent} from '../Types/CoreEventTypes';
<ide> import type {HostRef} from './getInspectorDataForViewAtPoint';
<ide>
<ide> import View from '../Components/View/View';
<add>import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
<ide> import StyleSheet from '../StyleSheet/StyleSheet';
<ide> import Dimensions from '../Utilities/Dimensions';
<ide> import ElementBox from './ElementBox';
<ide> export default function DevtoolsOverlay({
<ide> };
<ide> }, []);
<ide>
<del> const findViewForTouchEvent = useCallback(
<del> (e: PressEvent) => {
<add> const findViewForLocation = useCallback(
<add> (x: number, y: number) => {
<ide> const agent = devToolsAgentRef.current;
<ide> if (agent == null) {
<ide> return;
<ide> }
<del> const {locationX, locationY} = e.nativeEvent.touches[0];
<del> getInspectorDataForViewAtPoint(
<del> inspectedView,
<del> locationX,
<del> locationY,
<del> viewData => {
<del> const {touchedViewTag, closestInstance, frame} = viewData;
<del> if (closestInstance != null || touchedViewTag != null) {
<del> if (closestInstance != null) {
<del> // Fabric
<del> agent.selectNode(closestInstance);
<del> } else {
<del> agent.selectNode(findNodeHandle(touchedViewTag));
<del> }
<del> setInspected({
<del> frame,
<del> });
<del> return true;
<add> getInspectorDataForViewAtPoint(inspectedView, x, y, viewData => {
<add> const {touchedViewTag, closestInstance, frame} = viewData;
<add> if (closestInstance != null || touchedViewTag != null) {
<add> if (closestInstance != null) {
<add> // Fabric
<add> agent.selectNode(closestInstance);
<add> } else {
<add> agent.selectNode(findNodeHandle(touchedViewTag));
<ide> }
<del> return false;
<del> },
<del> );
<add> setInspected({
<add> frame,
<add> });
<add> return true;
<add> }
<add> return false;
<add> });
<ide> },
<ide> [inspectedView],
<ide> );
<ide>
<del> const onResponderRelease = useCallback(() => {
<add> const stopInspecting = useCallback(() => {
<ide> const agent = devToolsAgentRef.current;
<ide> if (agent == null) {
<ide> return;
<ide> export default function DevtoolsOverlay({
<ide> setInspected(null);
<ide> }, []);
<ide>
<add> const onPointerMove = useCallback(
<add> e => {
<add> findViewForLocation(e.nativeEvent.x, e.nativeEvent.y);
<add> },
<add> [findViewForLocation],
<add> );
<add>
<add> const onResponderMove = useCallback(
<add> e => {
<add> findViewForLocation(
<add> e.nativeEvent.touches[0].locationX,
<add> e.nativeEvent.touches[0].locationY,
<add> );
<add> },
<add> [findViewForLocation],
<add> );
<add>
<ide> const shouldSetResponser = useCallback(
<ide> (e: PressEvent): boolean => {
<del> findViewForTouchEvent(e);
<add> onResponderMove(e);
<ide> return true;
<ide> },
<del> [findViewForTouchEvent],
<add> [onResponderMove],
<ide> );
<ide>
<ide> let highlight = inspected ? <ElementBox frame={inspected.frame} /> : null;
<ide> if (isInspecting) {
<add> const events = ReactNativeFeatureFlags.shouldEmitW3CPointerEvents
<add> ? {
<add> onPointerMove,
<add> onPointerDown: onPointerMove,
<add> onPointerUp: stopInspecting,
<add> }
<add> : {
<add> onStartShouldSetResponder: shouldSetResponser,
<add> onResponderMove: onResponderMove,
<add> onResponderRelease: stopInspecting,
<add> };
<ide> return (
<ide> <View
<del> onStartShouldSetResponder={shouldSetResponser}
<del> onResponderMove={findViewForTouchEvent}
<del> onResponderRelease={onResponderRelease}
<ide> nativeID="devToolsInspectorOverlay"
<del> style={[styles.inspector, {height: Dimensions.get('window').height}]}>
<add> style={[styles.inspector, {height: Dimensions.get('window').height}]}
<add> {...events}>
<ide> {highlight}
<ide> </View>
<ide> ); | 1 |
Javascript | Javascript | simplify expression in duration#as | 935c1fb0454561b377626982312a20f03d53ac4f | <ide><path>src/lib/duration/as.js
<ide> export function as (units) {
<ide> // handle milliseconds separately because of floating point math errors (issue #1867)
<ide> days = this._days + Math.round(yearsToDays(this._months / 12));
<ide> switch (units) {
<del> case 'week' : return days / 7 + milliseconds / 6048e5;
<del> case 'day' : return days + milliseconds / 864e5;
<del> case 'hour' : return days * 24 + milliseconds / 36e5;
<del> case 'minute' : return days * 24 * 60 + milliseconds / 6e4;
<del> case 'second' : return days * 24 * 60 * 60 + milliseconds / 1000;
<add> case 'week' : return days / 7 + milliseconds / 6048e5;
<add> case 'day' : return days + milliseconds / 864e5;
<add> case 'hour' : return days * 24 + milliseconds / 36e5;
<add> case 'minute' : return days * 1440 + milliseconds / 6e4;
<add> case 'second' : return days * 86400 + milliseconds / 1000;
<ide> // Math.floor prevents floating point math errors here
<del> case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + milliseconds;
<add> case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
<ide> default: throw new Error('Unknown unit ' + units);
<ide> }
<ide> } | 1 |
Ruby | Ruby | fix pool_from_any_process to use most recent spec | e15a23fa355ed29d70c2ec573cd7b2418f7ac8db | <ide><path>activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
<ide> def owner_to_pool
<ide> end
<ide>
<ide> def pool_from_any_process_for(spec_name)
<del> owner_to_pool = @owner_to_pool.values.find { |v| v[spec_name] }
<add> owner_to_pool = @owner_to_pool.values.reverse.find { |v| v[spec_name] }
<ide> owner_to_pool && owner_to_pool[spec_name]
<ide> end
<ide> end
<ide><path>activerecord/test/cases/connection_adapters/connection_handler_test.rb
<ide> def test_retrieve_connection_pool_copies_schema_cache_from_ancestor_pool
<ide> rd.close
<ide> end
<ide>
<add> def test_pool_from_any_process_for_uses_most_recent_spec
<add> skip unless current_adapter?(:SQLite3Adapter)
<add>
<add> file = Tempfile.new "lol.sqlite3"
<add>
<add> rd, wr = IO.pipe
<add> rd.binmode
<add> wr.binmode
<add>
<add> pid = fork do
<add> ActiveRecord::Base.configurations["arunit"]["database"] = file.path
<add> ActiveRecord::Base.establish_connection(:arunit)
<add>
<add> pid2 = fork do
<add> wr.write ActiveRecord::Base.connection_config[:database]
<add> wr.close
<add> end
<add>
<add> Process.waitpid pid2
<add> end
<add>
<add> Process.waitpid pid
<add>
<add> wr.close
<add>
<add> assert_equal file.path, rd.read
<add>
<add> rd.close
<add> ensure
<add> if file
<add> file.close
<add> file.unlink
<add> end
<add> end
<add>
<ide> def test_a_class_using_custom_pool_and_switching_back_to_primary
<ide> klass2 = Class.new(Base) { def self.name; "klass2"; end }
<ide> | 2 |
Text | Text | track changes that need noting in 2.4 announcement | a90796c0f0d9db1a7d9bfaca8fbdfed22435c628 | <ide><path>docs/topics/2.4-accouncement.md
<ide> * Writable nested serializers.
<ide> * List/detail routes.
<ide> * 1.3 Support dropped, install six for <=1.4.?.
<del>* Note title ordering changed
<ide>\ No newline at end of file
<add>* `allow_none` for char fields | 1 |
PHP | PHP | implement new mechanism for extending blade | 534689d354261155afd2d0321c16afcac063537f | <ide><path>src/Illuminate/View/Compilers/BladeCompiler.php
<ide> class BladeCompiler extends Compiler implements CompilerInterface {
<ide> */
<ide> protected $extensions = array();
<ide>
<add> /**
<add> * All custom statement handlers.
<add> *
<add> * @var array
<add> */
<add> protected $statements = [];
<add>
<ide> /**
<ide> * The file currently being compiled.
<ide> *
<ide> protected function compileStatements($value)
<ide> {
<ide> $callback = function($match)
<ide> {
<add> // Blade tags are usually compiled by equally-named
<add> // methods. Users can also register their custom
<add> // handler callbacks to resolve custom tags.
<ide> if (method_exists($this, $method = 'compile'.ucfirst($match[1])))
<ide> {
<ide> $match[0] = $this->$method(array_get($match, 3));
<ide> }
<add> else if (isset($this->statements[$match[1]]))
<add> {
<add> $match[0] = call_user_func($this->statements[$match[1]], array_get($match, 3));
<add> }
<ide>
<ide> return isset($match[3]) ? $match[0] : $match[0].$match[2];
<ide> };
<ide> public function extend(callable $compiler)
<ide> $this->extensions[] = $compiler;
<ide> }
<ide>
<add> /**
<add> * Register a handler for custom statements.
<add> *
<add> * @param string $name
<add> * @param callable $handler
<add> * @return void
<add> */
<add> public function addStatement($name, callable $handler)
<add> {
<add> $this->statements[$name] = $handler;
<add> }
<add>
<ide> /**
<ide> * Sets the raw tags used for the compiler.
<ide> * | 1 |
Python | Python | remove whitespace and comment changes | 2b51d5594b727e7a14b6e1c3c94e325898fb5213 | <ide><path>rest_framework/pagination.py
<ide> class CursorPagination(BasePagination):
<ide> http://cramer.io/2011/03/08/building-cursors-for-the-disqus-api/
<ide> """
<ide> cursor_query_param = 'cursor'
<del>
<del> # The default page size.
<del> # Defaults to `None`, meaning pagination is disabled.
<ide> page_size = api_settings.PAGE_SIZE
<del>
<ide> invalid_cursor_message = _('Invalid cursor')
<ide> ordering = '-created'
<ide> template = 'rest_framework/pagination/previous_and_next.html' | 1 |
Ruby | Ruby | fix trap handling | 56a72fe2b1e35acb0df4179ecc79c7873a6f5d49 | <ide><path>Library/Homebrew/debrew/irb.rb
<ide>
<ide> # @private
<ide> module IRB
<del> def self.parse_opts(argv: nil); end
<del>
<ide> def self.start_within(binding)
<ide> unless @setup_done
<ide> setup(nil, argv: [])
<ide> def self.start_within(binding)
<ide> @CONF[:IRB_RC]&.call(irb.context)
<ide> @CONF[:MAIN_CONTEXT] = irb.context
<ide>
<del> trap("SIGINT") do
<add> prev_trap = trap("SIGINT") do
<ide> irb.signal_handle
<ide> end
<ide>
<ide> def self.start_within(binding)
<ide> irb.eval_input
<ide> end
<ide> ensure
<add> trap("SIGINT", prev_trap)
<ide> irb_at_exit
<ide> end
<ide> end | 1 |
Javascript | Javascript | remove foreach closures to reduce gc | 71f5abf7ae2e7fdf9a10eb16275446c357f442c7 | <ide><path>lib/Parser.js
<ide> class Parser extends Tapable {
<ide> if(classy.superClass)
<ide> this.walkExpression(classy.superClass);
<ide> if(classy.body && classy.body.type === "ClassBody") {
<del> classy.body.body.forEach(methodDefinition => {
<add> for(const methodDefinition of classy.body.body)
<ide> if(methodDefinition.type === "MethodDefinition")
<ide> this.walkMethodDefinition(methodDefinition);
<del> });
<ide> }
<ide> }
<ide>
<ide> class Parser extends Tapable {
<ide> }
<ide>
<ide> walkFunctionDeclaration(statement) {
<del> statement.params.forEach(param => {
<add> for(const param of statement.params)
<ide> this.walkPattern(param);
<del> });
<ide> this.inScope(statement.params, () => {
<ide> if(statement.body.type === "BlockStatement") {
<ide> this.prewalkStatement(statement.body);
<ide> class Parser extends Tapable {
<ide> prewalkImportDeclaration(statement) {
<ide> const source = statement.source.value;
<ide> this.hooks.import.call(statement, source);
<del> statement.specifiers.forEach(specifier => {
<add> for(const specifier of statement.specifiers) {
<ide> const name = specifier.local.name;
<ide> this.scope.renames.set(name, null);
<ide> this.scope.definitions.add(name);
<ide> class Parser extends Tapable {
<ide> this.hooks.importSpecifier.call(statement, source, null, name);
<ide> break;
<ide> }
<del> });
<add> }
<ide> }
<ide>
<ide> prewalkExportNamedDeclaration(statement) {
<ide> class Parser extends Tapable {
<ide> }
<ide>
<ide> prewalkVariableDeclarators(declarators) {
<del> declarators.forEach(declarator => {
<add> for(const declarator of declarators) {
<ide> switch(declarator.type) {
<ide> case "VariableDeclarator":
<ide> {
<ide> class Parser extends Tapable {
<ide> break;
<ide> }
<ide> }
<del> });
<add> }
<ide> }
<ide>
<ide> walkVariableDeclarators(declarators) {
<del> declarators.forEach(declarator => {
<add> for(const declarator of declarators) {
<ide> switch(declarator.type) {
<ide> case "VariableDeclarator":
<ide> {
<ide> class Parser extends Tapable {
<ide> break;
<ide> }
<ide> }
<del> });
<add> }
<ide> }
<ide>
<ide> walkPattern(pattern) {
<ide> class Parser extends Tapable {
<ide> }
<ide>
<ide> walkFunctionExpression(expression) {
<del> expression.params.forEach(param => {
<add> for(const param of expression.params)
<ide> this.walkPattern(param);
<del> });
<ide> this.inScope(expression.params, () => {
<ide> if(expression.body.type === "BlockStatement") {
<ide> this.prewalkStatement(expression.body);
<ide> class Parser extends Tapable {
<ide> }
<ide>
<ide> walkArrowFunctionExpression(expression) {
<del> expression.params.forEach(param => {
<add> for(const param of expression.params)
<ide> this.walkPattern(param);
<del> });
<ide> this.inScope(expression.params, () => {
<ide> if(expression.body.type === "BlockStatement") {
<ide> this.prewalkStatement(expression.body);
<ide> class Parser extends Tapable {
<ide>
<ide> const arr = [];
<ide> if(expression.elements)
<del> expression.elements.forEach(expr => {
<add> for(const expr of expression.elements)
<ide> arr.push(this.parseString(expr));
<del> });
<ide> return arr;
<ide> }
<ide>
<ide> class Parser extends Tapable {
<ide>
<ide> const arr = [];
<ide> if(expression.elements)
<del> expression.elements.forEach(expr => {
<add> for(const expr of expression.elements)
<ide> arr.push(this.parseCalculatedString(expr));
<del> });
<ide> return arr;
<ide> }
<ide>
<ide> class Parser extends Tapable {
<ide> Parser.ECMA_VERSION = ECMA_VERSION;
<ide>
<ide> module.exports = Parser;
<del>Parser.StackedSetMap = StackedSetMap; | 1 |
Text | Text | realign a wrong indentation. | 8f7f79a1bfcc6c7c19e7256b0909acb058600709 | <ide><path>guide/english/go/functions/index.md
<ide> func duplicate(s string) (first, second string) {
<ide> }
<ide>
<ide> func main() {
<del> fmt.Println(split("Hello world!")) // ("Hello world!", "Hello world!")
<add> fmt.Println(split("Hello world!")) // ("Hello world!", "Hello world!")
<ide> }
<ide> ```
<ide> | 1 |
PHP | PHP | add ability to load template files | 2575b944623d267687767e7eb01162cf27bfc486 | <ide><path>Cake/Test/TestApp/Config/test_templates.php
<add><?php
<add>/**
<add> * Template strings for testing.
<add> */
<add>$config = [
<add> 'link' => '<a href="{{url}}">{{text}}</a>',
<add>];
<ide><path>Cake/Test/TestApp/Plugin/TestPlugin/Config/test_templates.php
<add><?php
<add>$config = [
<add> 'italic' => '<em>{{text}}</em>',
<add>];
<ide><path>Cake/Test/TestCase/View/StringTemplateTest.php
<ide>
<ide> namespace Cake\Test\View;
<ide>
<add>use Cake\Core\Plugin;
<ide> use Cake\TestSuite\TestCase;
<ide> use Cake\View\StringTemplate;
<ide>
<ide> public function testFormat() {
<ide> $this->assertEquals('<a href="/">example</a>', $result);
<ide> }
<ide>
<add>/**
<add> * Test loading templates files in the app.
<add> *
<add> * @return void
<add> */
<add> public function testLoad() {
<add> $this->assertEquals([], $this->template->get());
<add> $this->assertNull($this->template->load('test_templates'));
<add> $this->assertEquals('<a href="{{url}}">{{text}}</a>', $this->template->get('link'));
<add> }
<add>
<add>/**
<add> * Test loading templates files from a plugin
<add> *
<add> * @return void
<add> */
<add> public function testLoadPlugin() {
<add> Plugin::load('TestPlugin');
<add> $this->assertNull($this->template->load('TestPlugin.test_templates'));
<add> $this->assertEquals('<em>{{text}}</em>', $this->template->get('italic'));
<add> }
<add>
<add>/**
<add> * Test that loading non-existing templates causes errors.
<add> *
<add> * @expectedException Cake\Error\Exception
<add> * @expectedExceptionMessage Could not load configuration file
<add> */
<add> public function testLoadErrorNoFile() {
<add> $this->template->load('no_such_file');
<add> }
<add>
<ide> }
<ide><path>Cake/View/StringTemplate.php
<ide> <?php
<ide> namespace Cake\View;
<ide>
<add>use Cake\Core\Plugin;
<add>use Cake\Configure\Engine\PhpConfig;
<add>use Cake\Error;
<add>
<ide> /**
<ide> * Provides a interface for registering and inserting
<ide> * content into simple logic-less string templates.
<ide> class StringTemplate {
<ide> */
<ide> protected $_templates = [];
<ide>
<add>/**
<add> * Load a config file containing templates.
<add> *
<add> * Template files should define a `$config` variable containing
<add> * all the templates to load. Loaded templates will be merged with existing
<add> * templates.
<add> *
<add> * @param string $file The file to load
<add> * @return void
<add> */
<add> public function load($file) {
<add> list($plugin, $file) = pluginSplit($file);
<add> $path = APP . 'Config/';
<add> if ($plugin !== null) {
<add> $path = Plugin::path($plugin) . 'Config/';
<add> }
<add> $loader = new PhpConfig($path);
<add> $templates = $loader->read($file);
<add> $this->add($templates);
<add> }
<add>
<ide> /**
<ide> * Add one or more template strings.
<ide> * | 4 |
Python | Python | add more tests for the kubernetes executor | bb43e06c75dd6cafc094813347f7a7b13cb9374e | <ide><path>tests/executors/test_kubernetes_executor.py
<ide> from kubernetes.client.rest import ApiException
<ide> from urllib3 import HTTPResponse
<ide>
<add>from airflow import AirflowException
<ide> from airflow.utils import timezone
<ide> from tests.test_utils.config import conf_vars
<ide>
<ide> def test_process_status_catchall(self):
<ide>
<ide> self._run()
<ide> self.watcher.watcher_queue.put.assert_not_called()
<add>
<add> @mock.patch.object(KubernetesJobWatcher, 'process_error')
<add> def test_process_error_event_for_410(self, mock_process_error):
<add> message = "too old resource version: 27272 (43334)"
<add> self.pod.status.phase = 'Pending'
<add> self.pod.metadata.resource_version = '0'
<add> mock_process_error.return_value = '0'
<add> raw_object = {"code": 410, "message": message}
<add> self.events.append({"type": "ERROR", "object": self.pod, "raw_object": raw_object})
<add> self._run()
<add> mock_process_error.assert_called_once_with(self.events[0])
<add>
<add> def test_process_error_event_for_raise_if_not_410(self):
<add> message = "Failure message"
<add> self.pod.status.phase = 'Pending'
<add> raw_object = {"code": 422, "message": message, "reason": "Test"}
<add> self.events.append({"type": "ERROR", "object": self.pod, "raw_object": raw_object})
<add> with self.assertRaises(AirflowException) as e:
<add> self._run()
<add> assert str(e.exception) == 'Kubernetes failure for {} with code {} and message: {}'.format(
<add> raw_object['reason'],
<add> raw_object['code'],
<add> raw_object['message'],
<add> ) | 1 |
Javascript | Javascript | fix code styling for consistency | 239f120583ddc5c30ee96ccb38f6ba7e74f5f9d8 | <ide><path>packages/container/lib/main.js
<ide> define("container",
<ide> register: function(type, name, factory, options) {
<ide> var fullName;
<ide>
<del> if (type.indexOf(':') !== -1){
<add> if (type.indexOf(':') !== -1) {
<ide> options = factory;
<ide> factory = name;
<ide> fullName = type;
<ide><path>packages/container/tests/container_test.js
<ide> test("A registered factory returns true for `has` if an item is registered", fun
<ide> equal(container.has('controller:posts'), false, "The `has` method returned false for unregistered factories");
<ide> });
<ide>
<del>test("A Registered factory can be unregistered, and all cached instances are removed", function(){
<add>test("A Registered factory can be unregistered, and all cached instances are removed", function() {
<ide> var container = new Container();
<ide> var PostController = factory();
<ide>
<ide> test("A failed lookup returns undefined", function() {
<ide> equal(container.lookup("doesnot:exist"), undefined);
<ide> });
<ide>
<del>test("Injecting a failed lookup raises an error", function(){
<add>test("Injecting a failed lookup raises an error", function() {
<ide> var container = new Container();
<del> var Foo = { create: function(){ }};
<add> var Foo = { create: function() { }};
<ide>
<ide> container.register('model:foo', Foo);
<ide>
<ide> container.injection('model:foo', 'store', 'store:main');
<ide>
<del> throws(function(){
<add> throws(function() {
<ide> container.lookup('model:foo');
<ide> });
<ide> });
<ide><path>packages/ember-application/lib/ext/controller.js
<ide> Ember.ControllerMixin.reopen({
<ide> this._super.apply(this, arguments);
<ide>
<ide> // Structure asserts to still do verification but not string concat in production
<del> if(!verifyDependencies(this)) {
<add> if (!verifyDependencies(this)) {
<ide> Ember.assert("Missing dependencies", false);
<ide> }
<ide> },
<ide><path>packages/ember-application/lib/system/application.js
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide>
<ide> this.scheduleInitialize();
<ide>
<del> if ( Ember.LOG_VERSION ) {
<add> if (Ember.LOG_VERSION) {
<ide> Ember.LOG_VERSION = false; // we only need to see this once per Application#init
<ide> Ember.debug('-------------------------------');
<ide> Ember.debug('Ember.VERSION : ' + Ember.VERSION);
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide> if (!this.$ || this.$.isReady) {
<ide> Ember.run.schedule('actions', self, '_initialize');
<ide> } else {
<del> this.$().ready(function(){
<add> this.$().ready(function() {
<ide> Ember.run(self, '_initialize');
<ide> });
<ide> }
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide> @param property {String}
<ide> @param injectionName {String}
<ide> **/
<del> inject: function(){
<add> inject: function() {
<ide> var container = this.__container__;
<ide> container.injection.apply(container, arguments);
<ide> },
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide>
<ide> @method initialize
<ide> **/
<del> initialize: function(){
<add> initialize: function() {
<ide> Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');
<ide> },
<ide> /**
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide>
<ide> var App;
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> App = Ember.Application.create();
<ide> });
<ide>
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide> }
<ide> });
<ide>
<del> test("first test", function(){
<add> test("first test", function() {
<ide> // App is freshly reset
<ide> });
<ide>
<del> test("first test", function(){
<add> test("first test", function() {
<ide> // App is again freshly reset
<ide> });
<ide> ```
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide>
<ide> var App;
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> App = Ember.Application.create();
<ide> });
<ide>
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide> }
<ide> });
<ide>
<del> test("first test", function(){
<add> test("first test", function() {
<ide> ok(true, 'something before app is initialized');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> App.advanceReadiness();
<ide> });
<ide> ok(true, 'something after app is initialized');
<ide> var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
<ide>
<ide> this.buildContainer();
<ide>
<del> Ember.run.schedule('actions', this, function(){
<add> Ember.run.schedule('actions', this, function() {
<ide> this._initialize();
<ide> });
<ide> }
<ide><path>packages/ember-application/lib/system/resolver.js
<ide> Ember.DefaultResolver = Ember.Object.extend({
<ide> @protected
<ide> @method resolveModel
<ide> */
<del> resolveModel: function(parsedName){
<add> resolveModel: function(parsedName) {
<ide> var className = classify(parsedName.name),
<ide> factory = get(parsedName.root, className);
<ide>
<ide><path>packages/ember-application/tests/system/dependency_injection/custom_resolver_test.js
<ide> var application;
<ide>
<ide> module("Ember.Application Depedency Injection – customResolver",{
<del> setup: function(){
<del> function fallbackTemplate(){ return "<h1>Fallback</h1>"; }
<add> setup: function() {
<add> function fallbackTemplate() { return "<h1>Fallback</h1>"; }
<ide>
<ide> var resolver = Ember.DefaultResolver.extend({
<ide> resolveTemplate: function(parsedName) {
<ide><path>packages/ember-application/tests/system/dependency_injection/default_resolver_test.js
<ide> var locator, application, lookup, originalLookup;
<ide>
<ide> module("Ember.Application Depedency Injection", {
<del> setup: function(){
<add> setup: function() {
<ide> originalLookup = Ember.lookup;
<ide> application = Ember.run(Ember.Application, 'create');
<ide>
<ide> locator = application.__container__;
<ide> },
<ide>
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.lookup = originalLookup;
<ide> Ember.run(application, 'destroy');
<ide> }
<ide> test("the default resolver resolves models on the namespace", function() {
<ide> equal(locator.lookupFactory('model:post'), application.Post, "looks up Post model on application");
<ide> });
<ide>
<del>test("the default resolver throws an error if the fullName to resolve is invalid", function(){
<del> raises(function(){ locator.resolve(''); }, TypeError, /Invalid fullName/ );
<del> raises(function(){ locator.resolve(':'); }, TypeError, /Invalid fullName/ );
<del> raises(function(){ locator.resolve('model'); }, TypeError, /Invalid fullName/ );
<del> raises(function(){ locator.resolve('model:'); }, TypeError, /Invalid fullName/ );
<del> raises(function(){ locator.resolve(':type'); }, TypeError, /Invalid fullName/ );
<add>test("the default resolver throws an error if the fullName to resolve is invalid", function() {
<add> raises(function() { locator.resolve(''); }, TypeError, /Invalid fullName/ );
<add> raises(function() { locator.resolve(':'); }, TypeError, /Invalid fullName/ );
<add> raises(function() { locator.resolve('model'); }, TypeError, /Invalid fullName/ );
<add> raises(function() { locator.resolve('model:'); }, TypeError, /Invalid fullName/ );
<add> raises(function() { locator.resolve(':type'); }, TypeError, /Invalid fullName/ );
<ide> });
<ide><path>packages/ember-application/tests/system/dependency_injection_test.js
<ide> var locator, originalLookup = Ember.lookup, lookup,
<ide> forEach = Ember.ArrayPolyfills.forEach;
<ide>
<ide> module("Ember.Application Depedency Injection", {
<del> setup: function(){
<add> setup: function() {
<ide> application = Ember.run(Ember.Application, 'create');
<ide>
<ide> application.Person = Ember.Object.extend({});
<ide> test('Ember.Container.defaultContainer is the same as the Apps container, but em
<ide> }
<ide> });
<ide>
<del>test('registered entities can be looked up later', function(){
<add>test('registered entities can be looked up later', function() {
<ide> equal(locator.resolve('model:person'), application.Person);
<ide> equal(locator.resolve('model:user'), application.User);
<ide> equal(locator.resolve('fruit:favorite'), application.Orange);
<ide><path>packages/ember-application/tests/system/logging_test.js
<ide> var App, logs, originalLogger;
<ide>
<ide> module("Ember.Application – logging of generated classes", {
<del> setup: function(){
<add> setup: function() {
<ide> logs = {};
<ide>
<ide> originalLogger = Ember.Logger.info;
<ide>
<del> Ember.Logger.info = function(){
<add> Ember.Logger.info = function() {
<ide> var fullName = arguments[1].fullName;
<ide>
<ide> logs[fullName] = logs[fullName] || 0;
<ide> logs[fullName]++;
<ide> };
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> App = Ember.Application.create({
<ide> LOG_ACTIVE_GENERATION: true
<ide> });
<ide> module("Ember.Application – logging of generated classes", {
<ide> });
<ide> },
<ide>
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.Logger.info = originalLogger;
<ide>
<ide> Ember.run(App, 'destroy');
<ide> module("Ember.Application – logging of generated classes", {
<ide> function visit(path) {
<ide> stop();
<ide>
<del> var promise = Ember.run(function(){
<del> return new Ember.RSVP.Promise(function(resolve, reject){
<add> var promise = Ember.run(function() {
<add> return new Ember.RSVP.Promise(function(resolve, reject) {
<ide> var router = App.__container__.lookup('router:main');
<ide>
<del> resolve(router.handleURL(path).then(function(value){
<add> resolve(router.handleURL(path).then(function(value) {
<ide> start();
<ide> ok(true, 'visited: `' + path + '`');
<ide> return value;
<ide> function visit(path) {
<ide> });
<ide>
<ide> return {
<del> then: function(resolve, reject){
<add> then: function(resolve, reject) {
<ide> Ember.run(promise, 'then', resolve, reject);
<ide> }
<ide> };
<ide> function visit(path) {
<ide> test("log class generation if logging enabled", function() {
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(Ember.keys(logs).length, 6, 'expected logs');
<ide> });
<ide> });
<ide> test("do NOT log class generation if logging disabled", function() {
<ide>
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(Ember.keys(logs).length, 0, 'expected no logs');
<ide> });
<ide> });
<ide>
<ide> test("actively generated classes get logged", function() {
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(logs['controller:application'], 1, 'expected: ApplicationController was generated');
<ide> equal(logs['controller:posts'], 1, 'expected: PostsController was generated');
<ide>
<ide> test("predefined classes do not get logged", function() {
<ide>
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> ok(!logs['controller:application'], 'did not expect: ApplicationController was generated');
<ide> ok(!logs['controller:posts'], 'did not expect: PostsController was generated');
<ide>
<ide> test("predefined classes do not get logged", function() {
<ide> });
<ide>
<ide> module("Ember.Application – logging of view lookups", {
<del> setup: function(){
<add> setup: function() {
<ide> logs = {};
<ide>
<ide> originalLogger = Ember.Logger.info;
<ide>
<del> Ember.Logger.info = function(){
<add> Ember.Logger.info = function() {
<ide> var fullName = arguments[1].fullName;
<ide>
<ide> logs[fullName] = logs[fullName] || 0;
<ide> logs[fullName]++;
<ide> };
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> App = Ember.Application.create({
<ide> LOG_VIEW_LOOKUPS: true
<ide> });
<ide> module("Ember.Application – logging of view lookups", {
<ide> });
<ide> },
<ide>
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.Logger.info = originalLogger;
<ide>
<ide> Ember.run(App, 'destroy');
<ide> module("Ember.Application – logging of view lookups", {
<ide> });
<ide>
<ide> test("log when template and view are missing when flag is active", function() {
<del> App.register('template:application', function(){ return ''; });
<add> App.register('template:application', function() { return ''; });
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(logs['template:application'], undefined, 'expected: Should not log template:application since it exists.');
<ide> equal(logs['template:index'], 1, 'expected: Could not find "index" template or view.');
<ide> equal(logs['template:posts'], 1, 'expected: Could not find "posts" template or view.');
<ide> test("do not log when template and view are missing when flag is not true", func
<ide>
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(Ember.keys(logs).length, 0, 'expected no logs');
<ide> });
<ide> });
<ide>
<ide> test("log which view is used with a template", function() {
<del> App.register('template:application', function(){ return 'Template with default view'; });
<del> App.register('template:foo', function(){ return 'Template with custom view'; });
<add> App.register('template:application', function() { return 'Template with default view'; });
<add> App.register('template:foo', function() { return 'Template with custom view'; });
<ide> App.register('view:posts', Ember.View.extend({templateName: 'foo'}));
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(logs['view:application'], 1, 'expected: Should log use of default view');
<ide> equal(logs['view:index'], undefined, 'expected: Should not log when index is not present.');
<ide> equal(logs['view:posts'], 1, 'expected: Rendering posts with PostsView.');
<ide> test("do not log which views are used with templates when flag is not true", fun
<ide>
<ide> Ember.run(App, 'advanceReadiness');
<ide>
<del> visit('/posts').then(function(){
<add> visit('/posts').then(function() {
<ide> equal(Ember.keys(logs).length, 0, 'expected no logs');
<ide> });
<ide> });
<ide><path>packages/ember-application/tests/system/readiness_test.js
<ide> test("Ember.Application's ready event is called right away if jQuery is already
<ide>
<ide> Ember.run(function() {
<ide> application = Application.create({ router: false });
<del> application.then(function(){
<add> application.then(function() {
<ide> wasResolved++;
<ide> });
<ide>
<ide> test("Ember.Application's ready event is called after the document becomes ready
<ide> var wasResolved = 0;
<ide> Ember.run(function() {
<ide> application = Application.create({ router: false });
<del> application.then(function(){
<add> application.then(function() {
<ide> wasResolved++;
<ide> });
<ide> equal(wasResolved, 0);
<ide> test("Ember.Application's ready event can be deferred by other components", func
<ide>
<ide> Ember.run(function() {
<ide> application = Application.create({ router: false });
<del> application.then(function(){
<add> application.then(function() {
<ide> wasResolved++;
<ide> });
<ide> application.deferReadiness();
<ide> test("Ember.Application's ready event can be deferred by other components", func
<ide> Ember.run(function() {
<ide> application = Application.create({ router: false });
<ide> application.deferReadiness();
<del> application.then(function(){
<add> application.then(function() {
<ide> wasResolved++;
<ide> });
<ide> equal(wasResolved, 0);
<ide><path>packages/ember-application/tests/system/reset_test.js
<ide> test("Brings it's own run-loop if not provided", function() {
<ide>
<ide> application.reset();
<ide>
<del> Ember.run(application,'then', function(){
<add> Ember.run(application,'then', function() {
<ide> ok(true, 'app booted');
<ide> });
<ide> });
<ide> test("does not bring it's own run loop if one is already provided", function() {
<ide>
<ide> application = Ember.run(Application, 'create');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide>
<del> application.ready = function(){
<add> application.ready = function() {
<ide> didBecomeReady = true;
<ide> };
<ide>
<ide> test("When an application is reset, the eventDispatcher is destroyed and recreat
<ide> var originalDispatcher = Ember.EventDispatcher;
<ide>
<ide> stubEventDispatcher = {
<del> setup: function(){
<add> setup: function() {
<ide> eventDispatcherWasSetup++;
<ide> },
<del> destroy: function(){
<add> destroy: function() {
<ide> eventDispatcherWasDestroyed++;
<ide> }
<ide> };
<ide> test("When an application with advance/deferReadiness is reset, the app does cor
<ide>
<ide> Ember.run(function() {
<ide> application = Application.create({
<del> ready: function(){
<add> ready: function() {
<ide> readyCallCount++;
<ide> }
<ide> });
<ide> test("When an application with advance/deferReadiness is reset, the app does cor
<ide> equal(readyCallCount, 0, 'ready has not yet been called');
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> application.advanceReadiness();
<ide> });
<ide>
<ide> test("With ember-data like initializer and constant", function() {
<ide>
<ide> var DS = {
<ide> Store: Ember.Object.extend({
<del> init: function(){
<add> init: function() {
<ide> if (!get(DS, 'defaultStore')) {
<ide> set(DS, 'defaultStore', this);
<ide> }
<ide> test("With ember-data like initializer and constant", function() {
<ide>
<ide> Application.initializer({
<ide> name: "store",
<del> initialize: function(container, application){
<add> initialize: function(container, application) {
<ide> application.register('store:main', application.Store);
<ide>
<ide> container.lookup('store:main');
<ide><path>packages/ember-handlebars-compiler/lib/main.js
<ide> var objectCreate = Object.create || function(parent) {
<ide> };
<ide>
<ide> var Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);
<del>if(!Handlebars && typeof require === 'function') {
<add>if (!Handlebars && typeof require === 'function') {
<ide> Handlebars = require('handlebars');
<ide> }
<ide>
<ide> Ember.Handlebars.Compiler.prototype.mustache = function(mustache) {
<ide> // Update the mustache node to include a hash value indicating whether the original node
<ide> // was escaped. This will allow us to properly escape values when the underlying value
<ide> // changes and we need to re-render the value.
<del> if(!mustache.escaped) {
<add> if (!mustache.escaped) {
<ide> mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);
<ide> mustache.hash.pairs.push(["unescaped", new Handlebars.AST.StringNode("true")]);
<ide> }
<ide><path>packages/ember-handlebars/lib/controls/select.js
<ide> Ember.Select = Ember.View.extend(
<ide> content = get(this, 'content'),
<ide> selection = get(this, 'selection');
<ide>
<del> if (!content){ return; }
<add> if (!content) { return; }
<ide> if (options) {
<del> var selectedIndexes = options.map(function(){
<add> var selectedIndexes = options.map(function() {
<ide> return this.index - offset;
<ide> }).toArray();
<ide> var newSelection = content.objectsAt(selectedIndexes);
<ide><path>packages/ember-handlebars/lib/ext.js
<ide> Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
<ide> var error, view = "";
<ide>
<ide> error = "%@ Handlebars error: Could not find property '%@' on object %@.";
<del> if (options.data){
<add> if (options.data) {
<ide> view = options.data.view;
<ide> }
<ide> throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));
<ide> Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
<ide> Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {
<ide> var count = options.hash.count;
<ide> var a = [];
<del> while(a.length < count){
<add> while(a.length < count) {
<ide> a.push(value);
<ide> }
<ide> return a.join('');
<ide> function evaluateUnboundHelper(context, fn, normalizedProperties, options) {
<ide> @for Ember.Handlebars
<ide> @param {String} template spec
<ide> */
<del>Ember.Handlebars.template = function(spec){
<add>Ember.Handlebars.template = function(spec) {
<ide> var t = Handlebars.template(spec);
<ide> t.isTop = true;
<ide> return t;
<ide><path>packages/ember-handlebars/lib/helpers/binding.js
<ide> var forEach = Ember.ArrayPolyfills.forEach;
<ide>
<ide> var EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;
<ide>
<del>function exists(value){
<add>function exists(value) {
<ide> return !Ember.isNone(value);
<ide> }
<ide>
<ide> EmberHandlebars.registerHelper('unless', function(context, options) {
<ide>
<ide> ```javascript
<ide> AView = Ember.View.extend({
<del> someProperty: function(){
<add> someProperty: function() {
<ide> return "aValue";
<ide> }.property()
<ide> })
<ide><path>packages/ember-handlebars/lib/helpers/collection.js
<ide> Ember.Handlebars.registerHelper('collection', function(path, options) {
<ide> if (hash.hasOwnProperty(prop)) {
<ide> match = prop.match(/^item(.)(.*)$/);
<ide>
<del> if(match && prop !== 'itemController') {
<add> if (match && prop !== 'itemController') {
<ide> // Convert itemShouldFoo -> shouldFoo
<ide> itemHash[match[1].toLowerCase() + match[2]] = hash[prop];
<ide> // Delete from hash as this will end up getting passed to the
<ide> Ember.Handlebars.registerHelper('collection', function(path, options) {
<ide> }
<ide> if (emptyViewClass) { hash.emptyView = emptyViewClass; }
<ide>
<del> if(!hash.keyword){
<add> if (!hash.keyword) {
<ide> itemHash._context = Ember.computed.alias('content');
<ide> }
<ide>
<ide><path>packages/ember-handlebars/lib/helpers/each.js
<ide> GroupedEach.prototype = {
<ide>
<ide> ```javascript
<ide> App.DeveloperController = Ember.ObjectController.extend({
<del> isAvailableForHire: function(){
<add> isAvailableForHire: function() {
<ide> return !this.get('content.isEmployed') && this.get('content.isSeekingWork');
<ide> }.property('isEmployed', 'isSeekingWork')
<ide> })
<ide><path>packages/ember-handlebars/lib/helpers/unbound.js
<ide> var handlebarsGet = Ember.Handlebars.get;
<ide> Ember.Handlebars.registerHelper('unbound', function(property, fn) {
<ide> var options = arguments[arguments.length - 1], helper, context, out;
<ide>
<del> if(arguments.length > 2) {
<add> if (arguments.length > 2) {
<ide> // Unbound helper call.
<ide> options.data.isUnbound = true;
<ide> helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;
<ide><path>packages/ember-handlebars/tests/controls/select_test.js
<ide> test("multiple selections can be set when multiple=true", function() {
<ide> Ember.run(function() { select.set('selection', Ember.A([tom, brennain])); });
<ide>
<ide> deepEqual(
<del> select.$(':selected').map(function(){ return trim(Ember.$(this).text());}).toArray(),
<add> select.$(':selected').map(function() { return trim(Ember.$(this).text());}).toArray(),
<ide> ['Tom', 'Brennain'],
<ide> "After changing it, selection should be correct");
<ide> });
<ide> test("multiple selections can be set by changing in place the selection array wh
<ide> });
<ide>
<ide> deepEqual(
<del> select.$(':selected').map(function(){ return trim(Ember.$(this).text());}).toArray(),
<add> select.$(':selected').map(function() { return trim(Ember.$(this).text());}).toArray(),
<ide> ['David', 'Brennain'],
<ide> "After updating the selection array in-place, selection should be correct");
<ide> });
<ide> test("works from a template with bindings", function() {
<ide> equal(select.$().text(), "Pick a person:Yehuda KatzTom DalePeter WagenetErik Bryn", "Option values were rendered");
<ide> equal(select.get('selection'), null, "Nothing has been selected");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> application.selectedPersonController.set('person', erik);
<ide> });
<ide>
<ide> equal(select.get('selection'), erik, "Selection was updated through binding");
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> application.peopleController.pushObject(Person.create({id: 5, firstName: "James", lastName: "Rosen"}));
<ide> });
<ide>
<ide><path>packages/ember-handlebars/tests/handlebars_test.js
<ide> test("edge case: child conditional should not render children if parent conditio
<ide> test("Template views return throw if their template cannot be found", function() {
<ide> view = Ember.View.create({
<ide> templateName: 'cantBeFound',
<del> container: { lookup: function(){ }}
<add> container: { lookup: function() { }}
<ide> });
<ide>
<ide> expectAssertion(function() {
<ide> test("views make a view keyword available that allows template to reference view
<ide> equal(view.$('h1').text(), "Brodele del Heeeyyyyyy", "renders properties from parent context");
<ide> });
<ide>
<del>test("a view helper's bindings are to the parent context", function(){
<add>test("a view helper's bindings are to the parent context", function() {
<ide> var Subview = Ember.View.extend({
<ide> classNameBindings: ['color'],
<ide> controller: Ember.Object.create({
<ide> test("should not update boundIf if truthiness does not change", function() {
<ide> equal(view.$('#first').text(), "bam", "renders block when condition is true");
<ide> });
<ide>
<del>test("boundIf should support parent access", function(){
<add>test("boundIf should support parent access", function() {
<ide> view = Ember.View.create({
<ide> template: Ember.Handlebars.compile(
<ide> '<h1 id="first">{{#with view.content}}{{#with thankYou}}'+
<ide> test("should be able to bindAttr to var in {{#each var in list}} block", functio
<ide> ok(/three\.gif$/.test(images[1].src));
<ide> });
<ide>
<del>test("should be able to output a property without binding", function(){
<add>test("should be able to output a property without binding", function() {
<ide> var context = {
<ide> content: Ember.Object.create({
<ide> anUnboundString: "No spans here, son."
<ide> module("Ember.View - handlebars integration", {
<ide> }
<ide> });
<ide>
<del>test("should be able to log a property", function(){
<add>test("should be able to log a property", function() {
<ide> var context = {
<ide> value: 'one',
<ide> valueTwo: 'two',
<ide> test("should be able to log `this`", function() {
<ide> var MyApp;
<ide>
<ide> module("Templates redrawing and bindings", {
<del> setup: function(){
<add> setup: function() {
<ide> Ember.lookup = lookup = { Ember: Ember };
<ide> MyApp = lookup.MyApp = Ember.Object.create({});
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.run(function() {
<ide> if (view) view.destroy();
<ide> });
<ide> Ember.lookup = originalLookup;
<ide> }
<ide> });
<ide>
<del>test("should be able to update when bound property updates", function(){
<add>test("should be able to update when bound property updates", function() {
<ide> MyApp.set('controller', Ember.Object.create({name: 'first'}));
<ide>
<ide> var View = Ember.View.extend({
<ide> template: Ember.Handlebars.compile('<i>{{view.value.name}}, {{view.computed}}</i>'),
<ide> valueBinding: 'MyApp.controller',
<del> computed: Ember.computed(function(){
<add> computed: Ember.computed(function() {
<ide> return this.get('value.name') + ' - computed';
<ide> }).property('value')
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view = View.create();
<ide> });
<ide>
<ide> appendView();
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> MyApp.set('controller', Ember.Object.create({
<ide> name: 'second'
<ide> }));
<ide> test("should be able to update when bound property updates", function(){
<ide> equal(view.$('i').text(), 'second, second - computed', "view rerenders when bound properties change");
<ide> });
<ide>
<del>test("properties within an if statement should not fail on re-render", function(){
<add>test("properties within an if statement should not fail on re-render", function() {
<ide> view = Ember.View.create({
<ide> template: Ember.Handlebars.compile('{{#if view.value}}{{view.value}}{{/if}}'),
<ide> value: null
<ide> test("properties within an if statement should not fail on re-render", function(
<ide>
<ide> equal(view.$().text(), '');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.set('value', 'test');
<ide> });
<ide>
<ide> equal(view.$().text(), 'test');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.set('value', null);
<ide> });
<ide>
<ide> equal(view.$().text(), '');
<ide> });
<ide>
<del>test("views within an if statement should be sane on re-render", function(){
<add>test("views within an if statement should be sane on re-render", function() {
<ide> view = Ember.View.create({
<ide> template: Ember.Handlebars.compile('{{#if view.display}}{{view Ember.TextField}}{{/if}}'),
<ide> display: false
<ide> test("views within an if statement should be sane on re-render", function(){
<ide>
<ide> equal(view.$('input').length, 0);
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> // Setting twice will trigger the observer twice, this is intentional
<ide> view.set('display', true);
<ide> view.set('display', 'yes');
<ide> test("views within an if statement should be sane on re-render", function(){
<ide> ok(Ember.View.views[textfield.attr('id')]);
<ide> });
<ide>
<del>test("the {{this}} helper should not fail on removal", function(){
<add>test("the {{this}} helper should not fail on removal", function() {
<ide> view = Ember.View.create({
<ide> template: Ember.Handlebars.compile('{{#if view.show}}{{#each view.list}}{{this}}{{/each}}{{/if}}'),
<ide> show: true,
<ide> test("the {{this}} helper should not fail on removal", function(){
<ide>
<ide> equal(view.$().text(), 'abc', "should start property - precond");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.set('show', false);
<ide> });
<ide>
<ide><path>packages/ember-handlebars/tests/helpers/bound_helper_test.js
<ide> var registerRepeatHelper = function() {
<ide> Ember.Handlebars.helper('repeat', function(value, options) {
<ide> var count = options.hash.count;
<ide> var a = [];
<del> while(a.length < count){
<add> while(a.length < count) {
<ide> a.push(value);
<ide> }
<ide> return a.join('');
<ide> module("Handlebars bound helpers", {
<ide> window.TemplateTests = Ember.Namespace.create();
<ide> },
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> }
<ide><path>packages/ember-handlebars/tests/helpers/custom_view_helper_test.js
<ide> module("Handlebars custom view helpers", {
<ide> window.TemplateTests = Ember.Namespace.create();
<ide> },
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> }
<ide><path>packages/ember-handlebars/tests/helpers/each_test.js
<ide> module("the #each helper", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> view = null;
<ide> });
<ide><path>packages/ember-handlebars/tests/helpers/if_unless_test.js
<ide> var view;
<ide>
<ide> module("Handlebars {{#if}} and {{#unless}} helpers", {
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> }
<ide><path>packages/ember-handlebars/tests/helpers/loc_test.js
<ide> var appendView = function(view) {
<ide> };
<ide>
<ide> var destroyView = function(view) {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> };
<ide><path>packages/ember-handlebars/tests/helpers/partial_test.js
<ide> var MyApp;
<ide> var originalLookup = Ember.lookup, lookup, TemplateTests, view, container;
<ide>
<ide> module("Support for {{partial}} helper", {
<del> setup: function(){
<add> setup: function() {
<ide> Ember.lookup = lookup = { Ember: Ember };
<ide> MyApp = lookup.MyApp = Ember.Object.create({});
<ide> container = new Ember.Container();
<ide> container.optionsForType('template', { instantiate: false });
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> test("should render other slash-separated templates registered with the containe
<ide> equal(Ember.$.trim(view.$().text()), "This sub-template is pretty great.");
<ide> });
<ide>
<del>test("should use the current view's context", function(){
<add>test("should use the current view's context", function() {
<ide> container.register('template:_person_name', Ember.Handlebars.compile("{{firstName}} {{lastName}}"));
<ide>
<ide> view = Ember.View.create({
<ide><path>packages/ember-handlebars/tests/helpers/template_test.js
<ide> var MyApp;
<ide> var originalLookup = Ember.lookup, lookup, TemplateTests, view, container;
<ide>
<ide> module("Support for {{template}} helper", {
<del> setup: function(){
<add> setup: function() {
<ide> Ember.lookup = lookup = { Ember: Ember };
<ide> MyApp = lookup.MyApp = Ember.Object.create({});
<ide> container = new Ember.Container();
<ide> container.optionsForType('template', { instantiate: false });
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> test("should render other templates via the container", function() {
<ide> equal(Ember.$.trim(view.$().text()), "This sub-template is pretty great.");
<ide> });
<ide>
<del>test("should use the current view's context", function(){
<add>test("should use the current view's context", function() {
<ide> container.register('template:person_name', Ember.Handlebars.compile("{{firstName}} {{lastName}}"));
<ide>
<ide> view = Ember.View.create({
<ide><path>packages/ember-handlebars/tests/helpers/unbound_test.js
<ide> module("Handlebars {{#unbound}} helper -- classic single-property usage", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> Ember.lookup = originalLookup;
<ide> module("Handlebars {{#unbound boundHelper arg1 arg2... argN}} form: render unbou
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> Ember.lookup = originalLookup;
<ide> test("should be able to render an unbound helper invocation", function() {
<ide> Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {
<ide> var count = options.hash.count;
<ide> var a = [];
<del> while(a.length < count){
<add> while(a.length < count) {
<ide> a.push(value);
<ide> }
<ide> return a.join('');
<ide><path>packages/ember-handlebars/tests/helpers/view_test.js
<ide> var view, originalLookup;
<ide>
<ide> var container = {
<del> lookupFactory: function(){ }
<add> lookupFactory: function() { }
<ide> };
<ide>
<del>function viewClass(options){
<add>function viewClass(options) {
<ide> options.container = options.container || container;
<ide> return Ember.View.extend(options);
<ide> }
<ide> module("Handlebars {{#view}} helper", {
<ide> });
<ide>
<ide>
<del>test("View lookup - App.FuView", function(){
<add>test("View lookup - App.FuView", function() {
<ide> Ember.lookup = {
<ide> App: {
<ide> FuView: viewClass({
<ide> test("View lookup - App.FuView", function(){
<ide> equal(Ember.$('#fu').text(), 'bro');
<ide> });
<ide>
<del>test("View lookup - 'App.FuView'", function(){
<add>test("View lookup - 'App.FuView'", function() {
<ide> Ember.lookup = {
<ide> App: {
<ide> FuView: viewClass({
<ide> test("View lookup - 'App.FuView'", function(){
<ide> equal(Ember.$('#fu').text(), 'bro');
<ide> });
<ide>
<del>test("View lookup - 'fu'", function(){
<add>test("View lookup - 'fu'", function() {
<ide> var FuView = viewClass({
<ide> elementId: "fu",
<ide> template: Ember.Handlebars.compile("bro")
<ide><path>packages/ember-handlebars/tests/helpers/with_test.js
<ide> module("Handlebars {{#with}} helper", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> Ember.lookup = originalLookup;
<ide> module("Handlebars {{#with}} globals helper", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> Ember.lookup = originalLookup;
<ide><path>packages/ember-handlebars/tests/helpers/yield_test.js
<ide> module("Support for {{yield}} helper (#307)", {
<ide> container.optionsForType('template', { instantiate: false });
<ide> },
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> }}
<ide><path>packages/ember-handlebars/tests/views/collection_view_test.js
<ide> module("ember-handlebars/tests/views/collection_view_test", {
<ide> lookup.TemplateTests = TemplateTests = Ember.Namespace.create();
<ide> },
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (view) {
<ide> view.destroy();
<ide> }
<ide> test("empty views should be removed when content is added to the collection (reg
<ide> equal(view.$('tr').length, 1, 'has one row');
<ide> equal(view.$('tr:nth-child(1) td').text(), 'Go Away, Placeholder Row!', 'The content is the updated data.');
<ide>
<del> Ember.run(function(){ App.destroy(); });
<add> Ember.run(function() { App.destroy(); });
<ide> });
<ide>
<ide> test("should be able to specify which class should be used for the empty view", function() {
<ide> test("should give its item views the property specified by itemPropertyBinding",
<ide>
<ide> equal(view.$('ul li').length, 3, "adds 3 itemView");
<ide>
<del> view.$('ul li').each(function(i, li){
<add> view.$('ul li').each(function(i, li) {
<ide> equal(Ember.$(li).text(), "baz", "creates the li with the property = baz");
<ide> });
<ide>
<ide> test("should allow view objects to be swapped out without throwing an error (#78
<ide> });
<ide> });
<ide>
<del>test("context should be content", function(){
<add>test("context should be content", function() {
<ide> var App, view;
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> lookup.App = App = Ember.Application.create();
<ide> });
<ide>
<ide> test("context should be content", function(){
<ide> template: Ember.Handlebars.compile('{{collection contentBinding="App.items" itemViewClass="App.AnItemView"}}')
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view = App.AView.create();
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.appendTo('#qunit-fixture');
<ide> });
<ide>
<ide> equal(view.$().text(), "Greetings DaveGreetings MaryGreetings Sara");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> App.destroy();
<ide> });
<ide><path>packages/ember-handlebars/tests/views/metamorph_view_test.js
<ide> module("Metamorph views", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> if (childView && !childView.isDestroyed) {
<ide> childView.destroy();
<ide> module("Metamorph views correctly handle DOM", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> if (!metamorphView.isDestroyed) {
<ide> metamorphView.destroy();
<ide> test("a metamorph view can be rerendered", function() {
<ide> // Redefining without setup/teardown
<ide> module("Metamorph views correctly handle DOM");
<ide>
<del>test("a metamorph view calls its childrens' willInsertElement and didInsertElement", function(){
<add>test("a metamorph view calls its childrens' willInsertElement and didInsertElement", function() {
<ide> var parentView;
<ide> var willInsertElementCalled = false;
<ide> var didInsertElementCalled = false;
<ide> test("a metamorph view calls its childrens' willInsertElement and didInsertEleme
<ide> ViewWithCallback: Ember.View.extend({
<ide> template: Ember.Handlebars.compile('<div id="do-i-exist"></div>'),
<ide>
<del> willInsertElement: function(){
<add> willInsertElement: function() {
<ide> willInsertElementCalled = true;
<ide> },
<del> didInsertElement: function(){
<add> didInsertElement: function() {
<ide> didInsertElementCalled = true;
<ide> didInsertElementSawElement = (this.$('div').length === 1);
<ide> }
<ide> test("a metamorph view calls its childrens' willInsertElement and didInsertEleme
<ide> ok(didInsertElementCalled, "didInsertElement called");
<ide> ok(didInsertElementSawElement, "didInsertElement saw element");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> parentView.destroy();
<ide> });
<ide>
<ide> test("replacing a Metamorph should invalidate childView elements", function() {
<ide> elementOnDidChange = this.get('element');
<ide> }, 'element'),
<ide>
<del> didInsertElement: function(){
<add> didInsertElement: function() {
<ide> elementOnDidInsert = this.get('element');
<ide> }
<ide> }),
<ide>
<ide> template: Ember.Handlebars.compile("{{#if view.show}}{{view view.CustomView}}{{/if}}")
<ide> });
<ide>
<del> Ember.run(function(){ view.append(); });
<add> Ember.run(function() { view.append(); });
<ide>
<del> Ember.run(function(){ view.set('show', true); });
<add> Ember.run(function() { view.set('show', true); });
<ide>
<ide> ok(elementOnDidChange, "should have an element on change");
<ide> ok(elementOnDidInsert, "should have an element on insert");
<ide>
<del> Ember.run(function(){ view.destroy(); });
<add> Ember.run(function() { view.destroy(); });
<ide> });
<ide>
<ide> test("trigger rerender of parent and SimpleHandlebarsView", function () {
<ide> test("trigger rerender of parent and SimpleHandlebarsView", function () {
<ide> template: Ember.Handlebars.compile("{{#if view.show}}{{#if view.foo}}{{view.foo}}{{/if}}{{/if}}")
<ide> });
<ide>
<del> Ember.run(function(){ view.append(); });
<add> Ember.run(function() { view.append(); });
<ide>
<ide> equal(view.$().text(), 'bar');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.set('foo', 'baz'); // schedule render of simple bound
<ide> view.set('show', false); // destroy tree
<ide> });
<ide> test("re-rendering and then changing the property does not raise an exception",
<ide> template: Ember.Handlebars.compile("{{#view view.metamorphView}}truth{{/view}}")
<ide> });
<ide>
<del> Ember.run(function(){ view.appendTo('#qunit-fixture'); });
<add> Ember.run(function() { view.appendTo('#qunit-fixture'); });
<ide>
<ide> equal(view.$().text(), 'truth');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.get('_childViews')[0].rerender();
<ide> view.get('_childViews')[0].rerender();
<ide> });
<ide><path>packages/ember-metal/lib/computed.js
<ide> Ember.computed = function(func) {
<ide> func = a_slice.call(arguments, -1)[0];
<ide> }
<ide>
<del> if ( typeof func !== "function" ) {
<add> if (typeof func !== "function") {
<ide> throw new Error("Computed Property declared without a property function");
<ide> }
<ide>
<ide> registerComputedWithProperties('map', function(properties) {
<ide> alias to the original value for property.
<ide> */
<ide> Ember.computed.alias = function(dependentKey) {
<del> return Ember.computed(dependentKey, function(key, value){
<add> return Ember.computed(dependentKey, function(key, value) {
<ide> if (arguments.length > 1) {
<ide> set(this, dependentKey, value);
<ide> return value;
<ide><path>packages/ember-metal/lib/core.js
<ide> function assertPolyfill(test, message) {
<ide> // attempt to preserve the stack
<ide> throw new Error("assertion failed: " + message);
<ide> } catch(error) {
<del> setTimeout(function(){
<add> setTimeout(function() {
<ide> throw error;
<ide> }, 0);
<ide> }
<ide> Ember.merge = function(original, updates) {
<ide> Ember.isNone(undefined); // true
<ide> Ember.isNone(''); // false
<ide> Ember.isNone([]); // false
<del> Ember.isNone(function(){}); // false
<add> Ember.isNone(function() {}); // false
<ide> ```
<ide>
<ide> @method isNone
<ide><path>packages/ember-metal/lib/instrumentation.js
<ide> Ember.Instrumentation.instrument = function(name, payload, callback, binding) {
<ide>
<ide> var beforeValues = [], listener, i, l;
<ide>
<del> function tryable(){
<add> function tryable() {
<ide> for (i=0, l=listeners.length; i<l; i++) {
<ide> listener = listeners[i];
<ide> beforeValues[i] = listener.before(name, time(), payload);
<ide> Ember.Instrumentation.instrument = function(name, payload, callback, binding) {
<ide> return callback.call(binding);
<ide> }
<ide>
<del> function catchable(e){
<add> function catchable(e) {
<ide> payload = payload || {};
<ide> payload.exception = e;
<ide> }
<ide><path>packages/ember-metal/lib/mixin.js
<ide> Alias.prototype = new Ember.Descriptor();
<ide> App.PaintSample = Ember.Object.extend({
<ide> color: 'red',
<ide> colour: Ember.alias('color'),
<del> name: function(){
<add> name: function() {
<ide> return "Zed";
<ide> },
<ide> moniker: Ember.alias("name")
<ide> Ember.alias = Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.a
<ide>
<ide> ```javascript
<ide> App.Person = Ember.Object.extend({
<del> name: function(){
<add> name: function() {
<ide> return 'Tomhuda Katzdale';
<ide> },
<ide> moniker: Ember.aliasMethod('name')
<ide> Ember.immediateObserver = function() {
<ide> }.observesBefore('content.value'),
<ide> valueDidChange: function(obj, keyName, value) {
<ide> // only run if updating a value already in the DOM
<del> if(this.get('state') === 'inDOM') {
<add> if (this.get('state') === 'inDOM') {
<ide> var color = value > this.changingFrom ? 'green' : 'red';
<ide> // logic
<ide> }
<ide><path>packages/ember-metal/lib/platform.js
<ide> var canRedefineProperties, canDefinePropertyOnDOM;
<ide> // Catch IE8 where Object.defineProperty exists but only works on DOM elements
<ide> if (defineProperty) {
<ide> try {
<del> defineProperty({}, 'a',{get:function(){}});
<add> defineProperty({}, 'a',{get:function() {}});
<ide> } catch (e) {
<ide> defineProperty = null;
<ide> }
<ide> if (defineProperty) {
<ide>
<ide> // This is for Safari 5.0, which supports Object.defineProperty, but not
<ide> // on DOM nodes.
<del> canDefinePropertyOnDOM = (function(){
<add> canDefinePropertyOnDOM = (function() {
<ide> try {
<ide> defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});
<ide> return true;
<ide> if (defineProperty) {
<ide> if (!canRedefineProperties) {
<ide> defineProperty = null;
<ide> } else if (!canDefinePropertyOnDOM) {
<del> defineProperty = function(obj, keyName, desc){
<add> defineProperty = function(obj, keyName, desc) {
<ide> var isNode;
<ide>
<ide> if (typeof Node === "object") {
<ide><path>packages/ember-metal/lib/property_events.js
<ide> var endPropertyChanges = Ember.endPropertyChanges = function() {
<ide> @param {Function} callback
<ide> @param [binding]
<ide> */
<del>Ember.changeProperties = function(cb, binding){
<add>Ember.changeProperties = function(cb, binding) {
<ide> beginPropertyChanges();
<ide> tryFinally(cb, endPropertyChanges, binding);
<ide> };
<ide> var notifyObservers = function(obj, keyName) {
<ide> } else {
<ide> sendEvent(obj, eventName, [obj, keyName]);
<ide> }
<del>};
<ide>\ No newline at end of file
<add>};
<ide><path>packages/ember-metal/lib/run_loop.js
<ide> var Backburner = requireModule('backburner').Backburner,
<ide> call.
<ide>
<ide> ```javascript
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> // code to be execute within a RunLoop
<ide> });
<ide> ```
<ide> Ember.run = function(target, method) {
<ide> If invoked when not within a run loop:
<ide>
<ide> ```javascript
<del> Ember.run.join(function(){
<add> Ember.run.join(function() {
<ide> // creates a new run-loop
<ide> });
<ide> ```
<ide>
<ide> Alternatively, if called within an existing run loop:
<ide>
<ide> ```javascript
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> // creates a new run-loop
<del> Ember.run.join(function(){
<add> Ember.run.join(function() {
<ide> // joins with the existing run-loop, and queues for invocation on
<ide> // the existing run-loops action queue.
<ide> });
<ide> Ember.run.end = function() {
<ide> the `Ember.run.queues` property.
<ide>
<ide> ```javascript
<del> Ember.run.schedule('sync', this, function(){
<add> Ember.run.schedule('sync', this, function() {
<ide> // this will be executed in the first RunLoop queue, when bindings are synced
<ide> console.log("scheduled on sync queue");
<ide> });
<ide>
<del> Ember.run.schedule('actions', this, function(){
<add> Ember.run.schedule('actions', this, function() {
<ide> // this will be executed in the 'actions' queue, after bindings have synced.
<ide> console.log("scheduled on actions queue");
<ide> });
<ide> Ember.run.sync = function() {
<ide> together, which is often more efficient than using a real setTimeout.
<ide>
<ide> ```javascript
<del> Ember.run.later(myContext, function(){
<add> Ember.run.later(myContext, function() {
<ide> // code here will execute within a RunLoop in about 500ms with this == myContext
<ide> }, 500);
<ide> ```
<ide> Ember.run.once = function(target, method) {
<ide> calls.
<ide>
<ide> ```javascript
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> var sayHi = function() { console.log('hi'); }
<ide> Ember.run.scheduleOnce('afterRender', myContext, sayHi);
<ide> Ember.run.scheduleOnce('afterRender', myContext, sayHi);
<ide> Ember.run.scheduleOnce = function(queue, target, method) {
<ide> `Ember.run.later` with a wait time of 1ms.
<ide>
<ide> ```javascript
<del> Ember.run.next(myContext, function(){
<add> Ember.run.next(myContext, function() {
<ide> // code to be executed in the next run loop, which will be scheduled after the current one
<ide> });
<ide> ```
<ide> Ember.run.next = function() {
<ide> `Ember.run.once()`, or `Ember.run.next()`.
<ide>
<ide> ```javascript
<del> var runNext = Ember.run.next(myContext, function(){
<add> var runNext = Ember.run.next(myContext, function() {
<ide> // will not be executed
<ide> });
<ide> Ember.run.cancel(runNext);
<ide>
<del> var runLater = Ember.run.later(myContext, function(){
<add> var runLater = Ember.run.later(myContext, function() {
<ide> // will not be executed
<ide> }, 500);
<ide> Ember.run.cancel(runLater);
<ide>
<del> var runOnce = Ember.run.once(myContext, function(){
<add> var runOnce = Ember.run.once(myContext, function() {
<ide> // will not be executed
<ide> });
<ide> Ember.run.cancel(runOnce);
<ide><path>packages/ember-metal/lib/set_properties.js
<ide> var changeProperties = Ember.changeProperties,
<ide> @return self
<ide> */
<ide> Ember.setProperties = function(self, hash) {
<del> changeProperties(function(){
<add> changeProperties(function() {
<ide> for(var prop in hash) {
<ide> if (hash.hasOwnProperty(prop)) { set(self, prop, hash[prop]); }
<ide> }
<ide> });
<ide> return self;
<del>};
<ide>\ No newline at end of file
<add>};
<ide><path>packages/ember-metal/lib/utils.js
<ide> if (needsFinallyFix) {
<ide> } finally {
<ide> try {
<ide> finalResult = finalizer.call(binding);
<del> } catch (e){
<add> } catch (e) {
<ide> finalError = e;
<ide> }
<ide> }
<ide> if (needsFinallyFix) {
<ide> } finally {
<ide> try {
<ide> finalResult = finalizer.call(binding);
<del> } catch (e){
<add> } catch (e) {
<ide> finalError = e;
<ide> }
<ide> }
<ide><path>packages/ember-metal/tests/accessors/get_test.js
<ide> testBoth("should call unknownProperty on watched values if the value is undefine
<ide> equal(get(obj, 'foo'), 'FOO', 'should return value from unknown');
<ide> });
<ide>
<del>test('warn on attempts to get a property of undefined', function(){
<add>test('warn on attempts to get a property of undefined', function() {
<ide> expectAssertion(function() {
<ide> Ember.get(undefined, 'aProperty');
<ide> }, /Cannot call get with 'aProperty' on an undefined object/i);
<ide> });
<ide>
<del>test('warn on attempts to get a property path of undefined', function(){
<del> expectAssertion(function(){
<add>test('warn on attempts to get a property path of undefined', function() {
<add> expectAssertion(function() {
<ide> Ember.get(undefined, 'aProperty.on.aPath');
<ide> }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/);
<ide> });
<ide><path>packages/ember-metal/tests/accessors/isGlobalPath_test.js
<ide> module('Ember.isGlobalPath');
<ide>
<del>test("global path's are recognized", function(){
<add>test("global path's are recognized", function() {
<ide> ok( Ember.isGlobalPath('App.myProperty') );
<ide> ok( Ember.isGlobalPath('App.myProperty.subProperty') );
<ide> });
<ide>
<del>test("if there is a 'this' in the path, it's not a global path", function(){
<add>test("if there is a 'this' in the path, it's not a global path", function() {
<ide> ok( !Ember.isGlobalPath('this.myProperty') );
<ide> ok( !Ember.isGlobalPath('this') );
<ide> });
<ide>
<del>test("if the path starts with a lowercase character, it is not a global path", function(){
<add>test("if the path starts with a lowercase character, it is not a global path", function() {
<ide> ok( !Ember.isGlobalPath('myObj') );
<ide> ok( !Ember.isGlobalPath('myObj.SecondProperty') );
<del>});
<ide>\ No newline at end of file
<add>});
<ide><path>packages/ember-metal/tests/binding/connect_test.js
<ide> require('ember-metal/~tests/props_helper');
<ide>
<ide> function performTest(binding, a, b, get, set, connect) {
<del> if (connect === undefined) connect = function(){binding.connect(a);};
<add> if (connect === undefined) connect = function() {binding.connect(a);};
<ide>
<ide> ok(!Ember.run.currentRunLoop, 'performTest should not have a currentRunLoop');
<ide>
<ide> testBoth('Connecting a binding to path', function(get, set) {
<ide> // make sure modifications update
<ide> b = { bar: 'BIFF' };
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> set(GlobalB, 'b', b);
<ide> });
<ide>
<ide><path>packages/ember-metal/tests/binding/oneWay_test.js
<ide> module('system/mixin/binding/oneWay_test', {
<ide>
<ide> test('oneWay(true) should only sync one way', function() {
<ide> var binding;
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> binding = Ember.oneWay(MyApp, 'bar.value', 'foo.value');
<ide> });
<ide>
<ide> equal(Ember.get('MyApp.foo.value'), 'FOO', 'foo synced');
<ide> equal(Ember.get('MyApp.bar.value'), 'FOO', 'bar synced');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> Ember.set('MyApp.bar.value', 'BAZ');
<ide> });
<ide>
<ide> equal(Ember.get('MyApp.foo.value'), 'FOO', 'foo synced');
<ide> equal(Ember.get('MyApp.bar.value'), 'BAZ', 'bar not synced');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> Ember.set('MyApp.foo.value', 'BIFF');
<ide> });
<ide>
<ide><path>packages/ember-metal/tests/computed_test.js
<ide> testBoth('depending on Global chain', function(get, set) {
<ide>
<ide> });
<ide>
<del>testBoth('chained dependent keys should evaluate computed properties lazily', function(get,set){
<add>testBoth('chained dependent keys should evaluate computed properties lazily', function(get,set) {
<ide> Ember.defineProperty(obj.foo.bar, 'b', Ember.computed(func));
<del> Ember.defineProperty(obj.foo, 'c', Ember.computed(function(){}).property('bar.b'));
<add> Ember.defineProperty(obj.foo, 'c', Ember.computed(function() {}).property('bar.b'));
<ide> equal(count, 0, 'b should not run');
<ide> });
<ide>
<ide> testBoth("when setting a value on a computed property that doesn't handle sets",
<ide> module('Ember.computed - readOnly');
<ide>
<ide> test('is chainable', function() {
<del> var computed = Ember.computed(function(){}).readOnly();
<add> var computed = Ember.computed(function() {}).readOnly();
<ide>
<ide> ok(computed instanceof Ember.Descriptor);
<ide> ok(computed instanceof Ember.ComputedProperty);
<ide> test('is chainable', function() {
<ide> testBoth('protects against setting', function(get, set) {
<ide> var obj = { };
<ide>
<del> Ember.defineProperty(obj, 'bar', Ember.computed(function(key){
<add> Ember.defineProperty(obj, 'bar', Ember.computed(function(key) {
<ide> return 'barValue';
<ide> }).readOnly());
<ide>
<ide> equal(get(obj, 'bar'), 'barValue');
<ide>
<del> raises(function(){
<add> raises(function() {
<ide> set(obj, 'bar', 'newBar');
<ide> }, /Cannot Set: bar on:/ );
<ide>
<ide> testBoth('Ember.computed.empty', function(get, set) {
<ide> });
<ide>
<ide> testBoth('Ember.computed.bool', function(get, set) {
<del> var obj = {foo: function(){}, bar: 'asdf', baz: null, quz: false};
<add> var obj = {foo: function() {}, bar: 'asdf', baz: null, quz: false};
<ide> Ember.defineProperty(obj, 'fooBool', Ember.computed.bool('foo'));
<ide> Ember.defineProperty(obj, 'barBool', Ember.computed.bool('bar'));
<ide> Ember.defineProperty(obj, 'bazBool', Ember.computed.bool('baz'));
<ide> testBoth('Ember.computed.bool', function(get, set) {
<ide>
<ide> testBoth('Ember.computed.alias', function(get, set) {
<ide> var obj = { bar: 'asdf', baz: null, quz: false};
<del> Ember.defineProperty(obj, 'bay', Ember.computed(function(key){
<add> Ember.defineProperty(obj, 'bay', Ember.computed(function(key) {
<ide> return 'apple';
<ide> }));
<ide>
<ide><path>packages/ember-metal/tests/mixin/alias_method_test.js
<ide> test('methods of another name are aliased when the mixin is applied', function()
<ide> test('should follow aliasMethods all the way down', function() {
<ide> var MyMixin = Ember.Mixin.create({
<ide> bar: Ember.aliasMethod('foo'), // put first to break ordered iteration
<del> baz: function(){ return 'baz'; },
<add> baz: function() { return 'baz'; },
<ide> foo: Ember.aliasMethod('baz')
<ide> });
<ide>
<ide><path>packages/ember-metal/tests/mixin/alias_test.js
<ide> module('Ember.alias',{
<del> setup: function(){
<add> setup: function() {
<ide> Ember.TESTING_DEPRECATION = true;
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.TESTING_DEPRECATION = false;
<ide> }
<ide> });
<ide><path>packages/ember-metal/tests/observer_test.js
<ide> testBoth('deferring property change notifications safely despite exceptions', fu
<ide> Ember.addObserver(obj, 'foo' ,function() { fooCount++; });
<ide>
<ide> try {
<del> Ember.changeProperties(function(){
<add> Ember.changeProperties(function() {
<ide> set(obj, 'foo', 'BIFF');
<ide> set(obj, 'foo', 'BAZ');
<ide> throw exc;
<ide> testBoth('deferring property change notifications safely despite exceptions', fu
<ide>
<ide> equal(fooCount, 1, 'foo should have fired once');
<ide>
<del> Ember.changeProperties(function(){
<add> Ember.changeProperties(function() {
<ide> set(obj, 'foo', 'BIFF2');
<ide> set(obj, 'foo', 'BAZ2');
<ide> });
<ide> testBoth('addObserver should propagate through prototype', function(get,set) {
<ide> equal(obj2.count, 0, 'should not have invoked observer on inherited');
<ide> });
<ide>
<del>testBoth('addObserver should respect targets with methods', function(get,set){
<add>testBoth('addObserver should respect targets with methods', function(get,set) {
<ide> var observed = { foo: 'foo' };
<ide>
<ide> var target1 = {
<ide> testBoth('local observers can be removed', function(get, set) {
<ide> equal(barObserved, 1, 'removed observers should not be called');
<ide> });
<ide>
<del>testBoth('removeObserver should respect targets with methods', function(get,set){
<add>testBoth('removeObserver should respect targets with methods', function(get,set) {
<ide> var observed = { foo: 'foo' };
<ide>
<ide> var target1 = {
<ide> testBoth('addBeforeObserver should propagate through prototype', function(get,se
<ide> equal(obj2.count, 0, 'should not have invoked observer on inherited');
<ide> });
<ide>
<del>testBoth('addBeforeObserver should respect targets with methods', function(get,set){
<add>testBoth('addBeforeObserver should respect targets with methods', function(get,set) {
<ide> var observed = { foo: 'foo' };
<ide>
<ide> var target1 = {
<ide> testBoth('depending on a simple chain', function(get, set) {
<ide> testBoth('depending on a Global chain', function(get, set) {
<ide> var Global = lookup.Global, val;
<ide>
<del> Ember.addObserver(obj, 'Global.foo.bar.baz.biff', function(target, key){
<add> Ember.addObserver(obj, 'Global.foo.bar.baz.biff', function(target, key) {
<ide> val = Ember.get(lookup, key);
<ide> count++;
<ide> });
<ide><path>packages/ember-metal/tests/run_loop/debounce_test.js
<ide> var originalDebounce = Ember.run.backburner.debounce;
<ide> var wasCalled = false;
<ide> module('Ember.run.debounce',{
<del> setup: function(){
<del> Ember.run.backburner.debounce = function(){ wasCalled = true; };
<add> setup: function() {
<add> Ember.run.backburner.debounce = function() { wasCalled = true; };
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.run.backburner.debounce = originalDebounce;
<ide> }
<ide> });
<ide>
<del>test('Ember.run.debounce uses Backburner.debounce', function(){
<del> Ember.run.debounce(function(){});
<add>test('Ember.run.debounce uses Backburner.debounce', function() {
<add> Ember.run.debounce(function() {});
<ide> ok(wasCalled, 'Ember.run.debounce used');
<ide> });
<ide>
<ide><path>packages/ember-metal/tests/run_loop/join_test.js
<ide> test('Ember.run.join returns undefined if joining another run-loop', function()
<ide> var value = 'returned value',
<ide> result;
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> var result = Ember.run.join(function() {
<ide> return value;
<ide> });
<ide><path>packages/ember-metal/tests/run_loop/unwind_test.js
<ide> module('system/run_loop/unwind_test');
<ide> test('RunLoop unwinds despite unhandled exception', function() {
<ide> var initialRunLoop = Ember.run.currentRunLoop;
<ide>
<del> raises(function(){
<add> raises(function() {
<ide> Ember.run(function() {
<ide> Ember.run.schedule('actions', function() { throw new Error("boom!"); });
<ide> });
<ide> test('RunLoop unwinds despite unhandled exception', function() {
<ide> test('Ember.run unwinds despite unhandled exception', function() {
<ide> var initialRunLoop = Ember.run.currentRunLoop;
<ide>
<del> raises(function(){
<add> raises(function() {
<ide> Ember.run(function() {
<ide> throw new Error("boom!");
<ide> });
<ide><path>packages/ember-metal/tests/utils/is_array_test.js
<ide> module("Ember Type Checking");
<ide>
<ide> var global = this;
<ide>
<del>test("Ember.isArray" ,function(){
<add>test("Ember.isArray" ,function() {
<ide> var numarray = [1,2,3],
<ide> number = 23,
<ide> strarray = ["Hello", "Hi"],
<ide><path>packages/ember-metal/tests/utils/try_catch_finally_test.js
<ide> module("Ember.tryFinally", {
<ide> }
<ide> });
<ide>
<del>function callTryCatchFinallyWithError(){
<add>function callTryCatchFinallyWithError() {
<ide> var errorWasThrown;
<ide> try {
<ide> Ember.tryCatchFinally(tryable, catchable, finalizer);
<ide><path>packages/ember-metal/tests/utils/try_finally_test.js
<ide> module("Ember.tryFinally", {
<ide> }
<ide> });
<ide>
<del>function callTryFinallyWithError(){
<add>function callTryFinallyWithError() {
<ide> var errorWasThrown;
<ide> try {
<ide> Ember.tryFinally(tryable, finalizer);
<ide><path>packages/ember-old-router/lib/application/system/application.js
<ide> Ember.Application.registerInjection({
<ide> var name = property.charAt(0).toLowerCase() + property.substr(1),
<ide> controllerClass = app[property], controller;
<ide>
<del> if(!Ember.Object.detect(controllerClass)){ return; }
<add> if (!Ember.Object.detect(controllerClass)) { return; }
<ide> controller = app[property].create();
<ide>
<ide> router.set(name, controller);
<ide><path>packages/ember-old-router/lib/helpers/action.js
<ide> ActionHelper.registerAction = function(actionName, options) {
<ide> ```javascript
<ide> AView = Ember.View.extend({
<ide> templateName: 'a-template',
<del> anActionName: function(event){}
<add> anActionName: function(event) {}
<ide> });
<ide>
<ide> aView = AView.create();
<ide> ActionHelper.registerAction = function(actionName, options) {
<ide> AView = Ember.View.extend({
<ide> templateName; 'a-template',
<ide> // note: no method 'aMethodNameThatIsMissing'
<del> anActionName: function(event){}
<add> anActionName: function(event) {}
<ide> });
<ide>
<ide> aView = AView.create();
<ide><path>packages/ember-old-router/lib/location/history_location.js
<ide> Ember.HistoryLocation = Ember.Object.extend({
<ide> var guid = Ember.guidFor(this);
<ide>
<ide> Ember.$(window).on('popstate.ember-location-'+guid, function(e) {
<del> if(!popstateReady) {
<add> if (!popstateReady) {
<ide> return;
<ide> }
<ide> callback(location.pathname);
<ide><path>packages/ember-old-router/tests/application_test.js
<ide> var app;
<ide>
<ide> module("Ember.Application initialization", {
<ide> teardown: function() {
<del> Ember.run(function(){ app.destroy(); });
<add> Ember.run(function() { app.destroy(); });
<ide> }
<ide> });
<ide>
<ide><path>packages/ember-old-router/tests/helpers/action_test.js
<ide> test("should unregister event handlers on rerender", function() {
<ide>
<ide> var previousActionId = view.$('a[data-ember-action]').attr('data-ember-action');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.rerender();
<ide> });
<ide>
<ide> test("should allow 'send' as action name (#594)", function() {
<ide>
<ide> view = Ember.View.create({
<ide> template: Ember.Handlebars.compile('<a href="#" {{action "send" }}>send</a>'),
<del> send: function(evt){ eventHandlerWasCalled = true; eventObjectSent = evt; }
<add> send: function(evt) { eventHandlerWasCalled = true; eventObjectSent = evt; }
<ide> });
<ide>
<ide> appendView();
<ide> test("should send the view, event and current Handlebars context to the action",
<ide> deepEqual(passedEvent.context, aContext, "the context is passed");
<ide> equal(passedEvent.type, 'click', "the event passed is the event triggered for the action helper");
<ide>
<del> Ember.run(function(){ aTarget.destroy(); });
<add> Ember.run(function() { aTarget.destroy(); });
<ide> });
<ide>
<ide> test("should only trigger actions for the event they were registered on", function() {
<ide><path>packages/ember-old-router/tests/location_test.js
<ide> module("Ember.Location, hash implementation", {
<ide> // make sure the onhashchange event fires
<ide> stop();
<ide> // There are weird issues in FF 3.6 if we pass start itself as the parameter
<del> setTimeout(function(){ start(); }, 1);
<add> setTimeout(function() { start(); }, 1);
<ide> },
<ide>
<ide> teardown: function() {
<ide> window.location.hash = "";
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> locationObject.destroy();
<ide> });
<ide> }
<ide><path>packages/ember-old-router/tests/routable_test.js
<ide> test("urlFor raises an error when route property is not defined", function() {
<ide> })
<ide> });
<ide>
<del> expectAssertion(function (){
<add> expectAssertion(function () {
<ide> router.urlFor('root.dashboard');
<ide> });
<ide> });
<ide><path>packages/ember-old-router/tests/view_test.js
<ide> test("should load named templates from View.templates", function() {
<ide> templateName: 'testTemplate'
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide><path>packages/ember-routing/lib/helpers/link_to.js
<ide> Ember.onLoad('Ember.Handlebars', function(Handlebars) {
<ide>
<ide> function createPath(path) {
<ide> var fullPath = 'paramsContext';
<del> if(path !== '') {
<add> if (path !== '') {
<ide> fullPath += '.' + path;
<ide> }
<ide> return fullPath;
<ide> Ember.onLoad('Ember.Handlebars', function(Handlebars) {
<ide> var observer = function(object, path) {
<ide> var notify = true, i;
<ide> for(i=0; i < paths.length; i++) {
<del> if(!get(this, paths[i])) {
<add> if (!get(this, paths[i])) {
<ide> notify = false;
<ide> }
<ide> }
<del> if(notify) {
<add> if (notify) {
<ide> this.notifyPropertyChange('routeArgs');
<ide> }
<ide> };
<ide> Ember.onLoad('Ember.Handlebars', function(Handlebars) {
<ide> the model context of the linked route:
<ide>
<ide> ```javascript
<del> App.Router.map(function(){
<add> App.Router.map(function() {
<ide> this.resource("photoGallery", {path: "hamster-photos/:photo_id"});
<ide> })
<ide> ```
<ide> Ember.onLoad('Ember.Handlebars', function(Handlebars) {
<ide> route with the dynamic segments:
<ide>
<ide> ```javascript
<del> App.Router.map(function(){
<del> this.resource("photoGallery", {path: "hamster-photos/:photo_id"}, function(){
<add> App.Router.map(function() {
<add> this.resource("photoGallery", {path: "hamster-photos/:photo_id"}, function() {
<ide> this.route("comment", {path: "comments/:comment_id"});
<ide> });
<ide> });
<ide><path>packages/ember-routing/lib/helpers/outlet.js
<ide> Ember.onLoad('Ember.Handlebars', function(Handlebars) {
<ide> }
<ide>
<ide> outletSource = options.data.view;
<del> while (!(outletSource.get('template.isTop'))){
<add> while (!(outletSource.get('template.isTop'))) {
<ide> outletSource = outletSource.get('_parentView');
<ide> }
<ide>
<ide><path>packages/ember-routing/lib/location/history_location.js
<ide> Ember.HistoryLocation = Ember.Object.extend({
<ide> get(this, 'history').pushState(state, null, path);
<ide>
<ide> // store state if browser doesn't support `history.state`
<del> if(!supportsHistoryState) {
<add> if (!supportsHistoryState) {
<ide> this._historyState = state;
<ide> }
<ide>
<ide> Ember.HistoryLocation = Ember.Object.extend({
<ide> get(this, 'history').replaceState(state, null, path);
<ide>
<ide> // store state if browser doesn't support `history.state`
<del> if(!supportsHistoryState) {
<add> if (!supportsHistoryState) {
<ide> this._historyState = state;
<ide> }
<ide>
<ide> Ember.HistoryLocation = Ember.Object.extend({
<ide>
<ide> Ember.$(window).on('popstate.ember-location-'+guid, function(e) {
<ide> // Ignore initial page load popstate event in Chrome
<del> if(!popstateFired) {
<add> if (!popstateFired) {
<ide> popstateFired = true;
<ide> if (self.getURL() === self._previousURL) { return; }
<ide> }
<ide><path>packages/ember-routing/lib/system/route.js
<ide> Ember.Route = Ember.Object.extend({
<ide>
<ide> @method setupController
<ide> */
<del> setupController: function(controller, context){
<add> setupController: function(controller, context) {
<ide> if (controller && (context !== undefined)) {
<ide> set(controller, 'model', context);
<ide> }
<ide><path>packages/ember-routing/lib/system/router.js
<ide> function transitionCompleted(route) {
<ide> Ember.Router.reopenClass({
<ide> map: function(callback) {
<ide> var router = this.router;
<del> if (!router){
<add> if (!router) {
<ide> router = this.router = new Router();
<ide> router.callbacks = [];
<ide> }
<ide> Ember.Router.reopenClass({
<ide>
<ide> var dsl = Ember.RouterDSL.map(function() {
<ide> this.resource('application', { path: "/" }, function() {
<del> for (var i=0; i < router.callbacks.length; i++){
<add> for (var i=0; i < router.callbacks.length; i++) {
<ide> router.callbacks[i].call(this);
<ide> }
<ide> callback.call(this);
<ide><path>packages/ember-routing/lib/vendor/route-recognizer.js
<ide> define("route-recognizer",
<ide> results.push(new StarSegment(match[1]));
<ide> names.push(match[1]);
<ide> types.stars++;
<del> } else if(segment === "") {
<add> } else if (segment === "") {
<ide> results.push(new EpsilonSegment());
<ide> } else {
<ide> results.push(new StaticSegment(segment));
<ide><path>packages/ember-routing/tests/helpers/action_test.js
<ide> test("should unregister event handlers on rerender", function() {
<ide>
<ide> var previousActionId = view.$('a[data-ember-action]').attr('data-ember-action');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.rerender();
<ide> });
<ide>
<ide><path>packages/ember-routing/tests/helpers/render_test.js
<ide> test("{{render}} helper should raise an error when a given controller name does
<ide>
<ide> Ember.TEMPLATES['home'] = compile("<p>BYE</p>");
<ide>
<del> expectAssertion(function(){
<add> expectAssertion(function() {
<ide> appendView(view);
<ide> }, 'The controller name you supplied \'postss\' did not resolve to a controller.');
<ide> });
<ide><path>packages/ember-routing/tests/system/route_test.js
<ide> module("Ember.Route", {
<ide> }
<ide> });
<ide>
<del>test("default model utilizes the container to acquire the model factory", function(){
<add>test("default model utilizes the container to acquire the model factory", function() {
<ide> var container, Post, post;
<ide>
<ide> expect(2);
<ide><path>packages/ember-runtime/lib/controllers/controller.js
<ide> Ember.ControllerMixin = Ember.Mixin.create({
<ide> if (this[actionName]) {
<ide> Ember.assert("The controller " + this + " does not have the action " + actionName, typeof this[actionName] === 'function');
<ide> this[actionName].apply(this, args);
<del> } else if(target = get(this, 'target')) {
<add> } else if (target = get(this, 'target')) {
<ide> Ember.assert("The target for controller " + this + " (" + target + ") did not define a `send` method", typeof target.send === 'function');
<ide> target.send.apply(target, arguments);
<ide> }
<ide><path>packages/ember-runtime/lib/mixins/array.js
<ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
<ide> */
<ide> objectsAt: function(indexes) {
<ide> var self = this;
<del> return map(indexes, function(idx){ return self.objectAt(idx); });
<add> return map(indexes, function(idx) { return self.objectAt(idx); });
<ide> },
<ide>
<ide> // overrides Ember.Enumerable version
<ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
<ide> }),
<ide>
<ide> // optimized version from Enumerable
<del> contains: function(obj){
<add> contains: function(obj) {
<ide> return this.indexOf(obj) >= 0;
<ide> },
<ide>
<ide><path>packages/ember-runtime/lib/mixins/deferred.js
<ide> Ember.DeferredMixin = Ember.Mixin.create({
<ide> deferred = get(this, '_deferred');
<ide> promise = deferred.promise;
<ide>
<del> if (value === this){
<add> if (value === this) {
<ide> deferred.resolve(promise);
<ide> } else {
<ide> deferred.resolve(value);
<ide><path>packages/ember-runtime/lib/mixins/enumerable.js
<ide> Ember.Enumerable = Ember.Mixin.create({
<ide> */
<ide> uniq: function() {
<ide> var ret = Ember.A();
<del> this.forEach(function(k){
<add> this.forEach(function(k) {
<ide> if (a_indexOf(ret, k)<0) ret.push(k);
<ide> });
<ide> return ret;
<ide><path>packages/ember-runtime/lib/mixins/mutable_array.js
<ide> Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,/**
<ide> @return {Ember.Array} receiver
<ide> */
<ide> pushObjects: function(objects) {
<del> if(!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {
<add> if (!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {
<ide> throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");
<ide> }
<ide> this.replace(get(this, 'length'), 0, objects);
<ide><path>packages/ember-runtime/lib/mixins/observable.js
<ide> Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
<ide> @param {String} keyName The property key that is about to change.
<ide> @return {Ember.Observable}
<ide> */
<del> propertyWillChange: function(keyName){
<add> propertyWillChange: function(keyName) {
<ide> Ember.propertyWillChange(this, keyName);
<ide> return this;
<ide> },
<ide><path>packages/ember-runtime/lib/mixins/sortable.js
<ide> Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {
<ide> return a positive value otherwise:
<ide>
<ide> ```javascript
<del> function(x,y){ // These are assumed to be integers
<del> if(x === y)
<add> function(x,y) { // These are assumed to be integers
<add> if (x === y)
<ide> return 0;
<ide> return x < y ? -1 : 1;
<ide> }
<ide><path>packages/ember-runtime/lib/mixins/target_action_support.js
<ide> Ember.TargetActionSupport = Ember.Mixin.create({
<ide> target: Ember.computed.alias('controller'),
<ide> action: 'save',
<ide> actionContext: Ember.computed.alias('context'),
<del> click: function(){
<add> click: function() {
<ide> this.triggerAction(); // Sends the `save` action, along with the current context
<ide> // to the current controller
<ide> }
<ide> Ember.TargetActionSupport = Ember.Mixin.create({
<ide>
<ide> ```javascript
<ide> App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
<del> click: function(){
<add> click: function() {
<ide> this.triggerAction({
<ide> action: 'save',
<ide> target: this.get('controller'),
<ide> Ember.TargetActionSupport = Ember.Mixin.create({
<ide> ```javascript
<ide> App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
<ide> target: Ember.computed.alias('controller'),
<del> click: function(){
<add> click: function() {
<ide> this.triggerAction({
<ide> action: 'save'
<ide> }); // Sends the `save` action, along with a reference to `this`,
<ide><path>packages/ember-runtime/lib/system/array_proxy.js
<ide> Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,/** @scope Ember.Array
<ide> },
<ide>
<ide> pushObjects: function(objects) {
<del> if(!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {
<add> if (!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {
<ide> throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");
<ide> }
<ide> this._replace(get(this, 'length'), 0, objects);
<ide><path>packages/ember-runtime/lib/system/core_object.js
<ide> CoreObject.PrototypeMixin = Mixin.create({
<ide> included in the output.
<ide>
<ide> App.Teacher = App.Person.extend({
<del> toStringExtension: function(){
<add> toStringExtension: function() {
<ide> return this.get('fullName');
<ide> }
<ide> });
<ide><path>packages/ember-runtime/lib/system/native_array.js
<ide> var NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember
<ide>
<ide> copy: function(deep) {
<ide> if (deep) {
<del> return this.map(function(item){ return Ember.copy(item, true); });
<add> return this.map(function(item) { return Ember.copy(item, true); });
<ide> }
<ide>
<ide> return this.slice();
<ide> Ember.NativeArray = NativeArray;
<ide> @for Ember
<ide> @return {Ember.NativeArray}
<ide> */
<del>Ember.A = function(arr){
<add>Ember.A = function(arr) {
<ide> if (arr === undefined) { arr = []; }
<ide> return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);
<ide> };
<ide><path>packages/ember-runtime/lib/system/set.js
<ide> Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Emb
<ide> Ember.propertyWillChange(this, 'firstObject');
<ide> Ember.propertyWillChange(this, 'lastObject');
<ide>
<del> for (var i=0; i < len; i++){
<add> for (var i=0; i < len; i++) {
<ide> guid = guidFor(this[i]);
<ide> delete this[guid];
<ide> delete this[i];
<ide><path>packages/ember-runtime/tests/core/error_test.js
<ide> module("Ember Error Throwing");
<ide>
<ide> test("new Ember.Error displays provided message", function() {
<del> raises( function(){
<add> raises( function() {
<ide> throw new Ember.Error('A Message');
<del> }, function(e){
<add> }, function(e) {
<ide> return e.message === 'A Message';
<ide> }, 'the assigned message was displayed' );
<ide> });
<ide><path>packages/ember-runtime/tests/core/isEqual_test.js
<ide> test("undefined and null", function() {
<ide> ok( !Ember.isEqual(null, undefined), "null is not equal to undefined" );
<ide> });
<ide>
<del>test("strings should be equal",function(){
<add>test("strings should be equal",function() {
<ide> ok( !Ember.isEqual("Hello", "Hi"), "different Strings are unequal" );
<ide> ok( Ember.isEqual("Hello", "Hello"), "same Strings are equal" );
<ide> });
<ide>
<del>test("numericals should be equal",function(){
<add>test("numericals should be equal",function() {
<ide> ok( Ember.isEqual(24, 24), "same numbers are equal" );
<ide> ok( !Ember.isEqual(24, 21), "different numbers are inequal" );
<ide> });
<ide>
<del>test("array should be equal",function(){
<add>test("array should be equal",function() {
<ide> // NOTE: We don't test for array contents -- that would be too expensive.
<ide> ok( !Ember.isEqual( [1,2], [1,2] ), 'two array instances with the same values should not be equal' );
<ide> ok( !Ember.isEqual( [1,2], [1] ), 'two array instances with different values should not be equal' );
<ide><path>packages/ember-runtime/tests/core/is_array_test.js
<ide> module("Ember Type Checking");
<ide>
<del>test("Ember.isArray" ,function(){
<add>test("Ember.isArray" ,function() {
<ide> var arrayProxy = Ember.ArrayProxy.create({ content: Ember.A() });
<ide>
<ide> equal(Ember.isArray(arrayProxy), true, "[]");
<ide><path>packages/ember-runtime/tests/ext/mixin_test.js
<ide> test('Defining a property ending in Binding should setup binding when applied',
<ide>
<ide> var obj = { bar: { baz: 'BIFF' } };
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> MyMixin.apply(obj);
<ide> });
<ide>
<ide> test('Defining a property ending in Binding should setup binding when applied',
<ide> test('Defining a property ending in Binding should apply to prototype children', function() {
<ide> var MyMixin, obj, obj2;
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> MyMixin = Ember.Mixin.create({
<ide> fooBinding: 'bar.baz'
<ide> });
<ide> });
<ide>
<ide> obj = { bar: { baz: 'BIFF' } };
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> MyMixin.apply(obj);
<ide> });
<ide>
<ide>
<ide> obj2 = Ember.create(obj);
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> Ember.set(Ember.get(obj2, 'bar'), 'baz', 'BARG');
<ide> });
<ide>
<ide><path>packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js
<ide> test("cacheable nested dependent keys should clear after their dependencies upda
<ide>
<ide> var DepObj;
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> lookup.DepObj = DepObj = ObservableObject.createWithMixins({
<ide> restaurant: ObservableObject.create({
<ide> menu: ObservableObject.create({
<ide> test("cacheable nested dependent keys should clear after their dependencies upda
<ide>
<ide> equal(DepObj.get('price'), 5, "precond - computed property is correct");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> DepObj.set('restaurant.menu.price', 10);
<ide> });
<ide> equal(DepObj.get('price'), 10, "cacheable computed properties are invalidated even if no run loop occurred");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> DepObj.set('restaurant.menu.price', 20);
<ide> });
<ide> equal(DepObj.get('price'), 20, "cacheable computed properties are invalidated after a second get before a run loop");
<ide> equal(DepObj.get('price'), 20, "precond - computed properties remain correct after a run loop");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> DepObj.set('restaurant.menu', ObservableObject.create({
<ide> price: 15
<ide> }));
<ide> test("cacheable nested dependent keys should clear after their dependencies upda
<ide>
<ide> equal(DepObj.get('price'), 15, "cacheable computed properties are invalidated after a middle property changes");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> DepObj.set('restaurant.menu', ObservableObject.create({
<ide> price: 25
<ide> }));
<ide> module("Observable objects & object properties ", {
<ide> return ret ;
<ide> },
<ide>
<del> newObserver:function(){
<add> newObserver:function() {
<ide> this.abnormal = 'changedValueObserved';
<ide> },
<ide>
<del> testObserver: Ember.observer(function(){
<add> testObserver: Ember.observer(function() {
<ide> this.abnormal = 'removedObserver';
<ide> }, 'normal'),
<ide>
<del> testArrayObserver: Ember.observer(function(){
<add> testArrayObserver: Ember.observer(function() {
<ide> this.abnormal = 'notifiedObserver';
<ide> }, 'normalArray.[]')
<ide>
<ide> module("Observable objects & object properties ", {
<ide>
<ide> });
<ide>
<del>test('incrementProperty and decrementProperty',function(){
<add>test('incrementProperty and decrementProperty',function() {
<ide> var newValue = object.incrementProperty('numberVal');
<ide> equal(25,newValue,'numerical value incremented');
<ide> object.numberVal = 24;
<ide> test('incrementProperty and decrementProperty',function(){
<ide> equal(25,newValue,'zero numerical value decremented by specified increment');
<ide> });
<ide>
<del>test('toggle function, should be boolean',function(){
<add>test('toggle function, should be boolean',function() {
<ide> equal(object.toggleProperty('toggleVal',true,false),object.get('toggleVal'));
<ide> equal(object.toggleProperty('toggleVal',true,false),object.get('toggleVal'));
<ide> equal(object.toggleProperty('toggleVal',undefined,undefined),object.get('toggleVal'));
<ide> });
<ide>
<del>test('should notify array observer when array changes',function(){
<add>test('should notify array observer when array changes',function() {
<ide> get(object, 'normalArray').replace(0,0,6);
<ide> equal(object.abnormal, 'notifiedObserver', 'observer should be notified');
<ide> });
<ide> module("object.addObserver()", {
<ide> this.incrementor= this.incrementor+1;
<ide> },
<ide>
<del> chainedObserver:function(){
<add> chainedObserver:function() {
<ide> this.normal2 = 'chainedPropertyObserved' ;
<ide> }
<ide>
<ide> module("object.removeObserver()", {
<ide> removeAction: function() {
<ide> this.normal2 = 'newDependentValue';
<ide> },
<del> removeChainedObserver:function(){
<add> removeChainedObserver:function() {
<ide> this.normal2 = 'chainedPropertyObserved' ;
<ide> },
<ide>
<ide> module("Bind function ", {
<ide>
<ide> test("should bind property with method parameter as undefined", function() {
<ide> // creating binding
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> objectA.bind("name", "Namespace.objectB.normal",undefined) ;
<ide> });
<ide>
<ide> // now make a change to see if the binding triggers.
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> objectB.set("normal", "changedValue") ;
<ide> });
<ide>
<ide><path>packages/ember-runtime/tests/legacy_1x/system/binding_test.js
<ide> module("one way binding", {
<ide> binding = Ember.oneWay(root, 'toObject.value', 'fromObject.value');
<ide> });
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.run.cancelTimers();
<ide> }
<ide> });
<ide> module("chained binding", {
<ide> binding2 = Ember.bind(root, 'second.output', 'third.input');
<ide> });
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.run.cancelTimers();
<ide> }
<ide> });
<ide> test("two bindings to the same value should sync in the order they are initializ
<ide> //
<ide>
<ide> module("propertyNameBinding with longhand", {
<del> setup: function(){
<add> setup: function() {
<ide> TestNamespace = {};
<ide> Ember.run(function () {
<ide> TestNamespace.fromObject = Ember.Object.create({
<ide> module("propertyNameBinding with longhand", {
<ide> });
<ide> });
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> TestNamespace = undefined;
<ide> }
<ide> });
<ide>
<del>test("works with full path", function(){
<add>test("works with full path", function() {
<ide> Ember.run(function () {
<ide> set(TestNamespace.fromObject, 'value', "updatedValue");
<ide> });
<ide> test("works with full path", function(){
<ide> equal(get(TestNamespace.toObject, 'value'), "newerValue");
<ide> });
<ide>
<del>test("works with local path", function(){
<add>test("works with local path", function() {
<ide> Ember.run(function () {
<ide> set(TestNamespace.toObject, 'localValue', "updatedValue");
<ide> });
<ide><path>packages/ember-runtime/tests/legacy_1x/system/object/base_test.js
<ide> module("Ember.Object observers", {
<ide> prop1: null,
<ide>
<ide> // normal observer
<del> observer: Ember.observer(function(){
<add> observer: Ember.observer(function() {
<ide> this._normal = true;
<ide> }, "prop1"),
<ide>
<ide> module("Ember.Object superclass and subclasses", {
<ide> }
<ide> });
<ide>
<del>test("Checking the detect() function on an object and its subclass", function(){
<add>test("Checking the detect() function on an object and its subclass", function() {
<ide> equal(obj.detect(obj1), true);
<ide> equal(obj1.detect(obj), false);
<ide> });
<ide><path>packages/ember-runtime/tests/legacy_1x/system/object/bindings_test.js
<ide> var bindModuleOpts = {
<ide> module("bind() method", bindModuleOpts);
<ide>
<ide> test("bind(TestNamespace.fromObject.bar) should follow absolute path", function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> // create binding
<ide> testObject.bind("foo", "TestNamespace.fromObject.bar");
<ide>
<ide> test("bind(TestNamespace.fromObject.bar) should follow absolute path", function(
<ide> });
<ide>
<ide> test("bind(.bar) should bind to relative path", function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> // create binding
<ide> testObject.bind("foo", "bar") ;
<ide>
<ide> module("fooBinding method", fooBindingModuleOpts);
<ide>
<ide> test("fooBinding: TestNamespace.fromObject.bar should follow absolute path", function() {
<ide> // create binding
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> testObject = TestObject.createWithMixins({
<ide> fooBinding: "TestNamespace.fromObject.bar"
<ide> }) ;
<ide> test("fooBinding: TestNamespace.fromObject.bar should follow absolute path", fun
<ide> });
<ide>
<ide> test("fooBinding: .bar should bind to relative path", function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> testObject = TestObject.createWithMixins({
<ide> fooBinding: "bar"
<ide> });
<ide> test("fooBinding: .bar should bind to relative path", function() {
<ide> });
<ide>
<ide> test('fooBinding: should disconnect bindings when destroyed', function () {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> testObject = TestObject.createWithMixins({
<ide> fooBinding: "TestNamespace.fromObject.bar"
<ide> });
<ide> test('fooBinding: should disconnect bindings when destroyed', function () {
<ide>
<ide> Ember.destroy(testObject);
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> set(TestNamespace.fromObject, 'bar', 'BIFF');
<ide> });
<ide>
<ide><path>packages/ember-runtime/tests/legacy_1x/system/object/concatenated_test.js
<ide> var klass, get = Ember.get, set = Ember.set;
<ide>
<ide> module("Ember.Object Concatenated Properties", {
<del> setup: function(){
<add> setup: function() {
<ide> klass = Ember.Object.extend({
<ide> concatenatedProperties: ['values'],
<ide> values: ['a', 'b', 'c']
<ide><path>packages/ember-runtime/tests/legacy_1x/system/set_test.js
<ide> test("should remove a bools and reduce length", function() {
<ide> equal(set.length, oldLength-2, "should be 2 shorter") ;
<ide> });
<ide>
<del>test("should remove 0 and reduce length", function(){
<add>test("should remove 0 and reduce length", function() {
<ide> var oldLength = set.length;
<ide> set.remove(0) ;
<ide> equal(set.contains(0), false, "should be removed") ;
<ide> test("the pop() should remove an arbitrary object from the set", function() {
<ide> equal(set.length, oldLength-1, 'length shorter by 1');
<ide> });
<ide>
<del>test("should pop false and 0", function(){
<add>test("should pop false and 0", function() {
<ide> set = new Ember.Set(Ember.A([false]));
<ide> ok(set.pop() === false, "should pop false");
<ide>
<ide><path>packages/ember-runtime/tests/mixins/array_test.js
<ide> Ember.ArrayTests.extend({
<ide>
<ide> }).run();
<ide>
<del>test("the return value of slice has Ember.Array applied", function(){
<add>test("the return value of slice has Ember.Array applied", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Array, {
<ide> length: 0
<ide> });
<ide> var y = x.slice(1);
<ide> equal(Ember.Array.detect(y), true, "mixin should be applied");
<ide> });
<ide>
<del>test("slice supports negative index arguments", function(){
<add>test("slice supports negative index arguments", function() {
<ide> var testArray = new TestArray([1,2,3,4]);
<ide>
<ide> deepEqual(testArray.slice(-2), [3, 4], 'slice(-2)');
<ide><path>packages/ember-runtime/tests/mixins/deferred_test.js
<ide> test("can self reject", function() {
<ide> deferred = Ember.Object.createWithMixins(Ember.DeferredMixin);
<ide> });
<ide>
<del> deferred.then(function(){
<add> deferred.then(function() {
<ide> ok(false, 'should not fulfill');
<ide> },function(value) {
<ide> equal(value, deferred, "successfully rejected to itself");
<ide> test("can do multi level assimilation", function() {
<ide> });
<ide>
<ide>
<del>test("can handle rejection without rejection handler", function(){
<add>test("can handle rejection without rejection handler", function() {
<ide> expect(2);
<ide>
<ide> var reason = 'some reason';
<ide> test("can handle rejection without rejection handler", function(){
<ide> return Ember.Object.createWithMixins(Ember.DeferredMixin);
<ide> });
<ide>
<del> deferred.then().then(function(){
<add> deferred.then().then(function() {
<ide> ok(false, 'expected rejection, got fulfillment');
<del> }, function(actualReason){
<add> }, function(actualReason) {
<ide> ok(true, 'expected fulfillment');
<ide> equal(actualReason, reason);
<ide> });
<ide>
<ide> Ember.run(deferred, 'reject', reason);
<ide> });
<ide>
<del>test("can handle fulfillment without fulfillment handler", function(){
<add>test("can handle fulfillment without fulfillment handler", function() {
<ide> expect(2);
<ide>
<ide> var fulfillment = 'some fulfillment';
<ide><path>packages/ember-runtime/tests/mixins/enumerable_test.js
<ide> Ember.EnumerableTests.extend({
<ide>
<ide> }).run();
<ide>
<del>test("should apply Ember.Array to return value of map", function(){
<add>test("should apply Ember.Array to return value of map", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Enumerable);
<ide> var y = x.map(Ember.K);
<ide> equal(Ember.Array.detect(y), true, "should have mixin applied");
<ide> });
<ide>
<del>test("should apply Ember.Array to return value of filter", function(){
<add>test("should apply Ember.Array to return value of filter", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Enumerable);
<ide> var y = x.filter(Ember.K);
<ide> equal(Ember.Array.detect(y), true, "should have mixin applied");
<ide> });
<ide>
<del>test("should apply Ember.Array to return value of invoke", function(){
<add>test("should apply Ember.Array to return value of invoke", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Enumerable);
<ide> var y = x.invoke(Ember.K);
<ide> equal(Ember.Array.detect(y), true, "should have mixin applied");
<ide> });
<ide>
<del>test("should apply Ember.Array to return value of toArray", function(){
<add>test("should apply Ember.Array to return value of toArray", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Enumerable);
<ide> var y = x.toArray(Ember.K);
<ide> equal(Ember.Array.detect(y), true, "should have mixin applied");
<ide> });
<ide>
<del>test("should apply Ember.Array to return value of without", function(){
<add>test("should apply Ember.Array to return value of without", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Enumerable, {
<del> contains: function(){
<add> contains: function() {
<ide> return true;
<ide> }
<ide> });
<ide> var y = x.without(Ember.K);
<ide> equal(Ember.Array.detect(y), true, "should have mixin applied");
<ide> });
<ide>
<del>test("should apply Ember.Array to return value of uniq", function(){
<add>test("should apply Ember.Array to return value of uniq", function() {
<ide> var x = Ember.Object.createWithMixins(Ember.Enumerable);
<ide> var y = x.uniq(Ember.K);
<ide> equal(Ember.Array.detect(y), true, "should have mixin applied");
<ide><path>packages/ember-runtime/tests/mixins/sortable_test.js
<ide> module("Ember.Sortable with sortFunction and sortProperties", {
<ide> Ember.run(function() {
<ide> sortedArrayController = Ember.ArrayController.create({
<ide> sortProperties: ['name'],
<del> sortFunction: function(v, w){
<add> sortFunction: function(v, w) {
<ide> var lowerV = v.toLowerCase(),
<ide> lowerW = w.toLowerCase();
<ide>
<del> if(lowerV < lowerW){
<add> if (lowerV < lowerW) {
<ide> return -1;
<ide> }
<del> if(lowerV > lowerW){
<add> if (lowerV > lowerW) {
<ide> return 1;
<ide> }
<ide> return 0;
<ide><path>packages/ember-runtime/tests/mixins/target_action_support_test.js
<ide> test("it should find targets specified using a property path", function() {
<ide> ok(true === myObj.triggerAction(), "a valid target and action were specified");
<ide> });
<ide>
<del>test("it should use an actionContext object specified as a property on the object", function(){
<add>test("it should use an actionContext object specified as a property on the object", function() {
<ide> expect(2);
<ide> var obj = Ember.Object.createWithMixins(Ember.TargetActionSupport,{
<ide> action: 'anEvent',
<ide> test("it should use an actionContext object specified as a property on the objec
<ide> ok(true === obj.triggerAction(), "a valid target and action were specified");
<ide> });
<ide>
<del>test("it should find an actionContext specified as a property path", function(){
<add>test("it should find an actionContext specified as a property path", function() {
<ide> expect(2);
<ide>
<ide> var Test = {};
<ide> test("it should find an actionContext specified as a property path", function(){
<ide> ok(true === obj.triggerAction(), "a valid target and action were specified");
<ide> });
<ide>
<del>test("it should use the target specified in the argument", function(){
<add>test("it should use the target specified in the argument", function() {
<ide> expect(2);
<ide> var targetObj = Ember.Object.create({
<ide> anEvent: function() {
<ide> test("it should use the target specified in the argument", function(){
<ide> ok(true === obj.triggerAction({target: targetObj}), "a valid target and action were specified");
<ide> });
<ide>
<del>test("it should use the action specified in the argument", function(){
<add>test("it should use the action specified in the argument", function() {
<ide> expect(2);
<ide>
<ide> var obj = Ember.Object.createWithMixins(Ember.TargetActionSupport,{
<ide> test("it should use the action specified in the argument", function(){
<ide> ok(true === obj.triggerAction({action: 'anEvent'}), "a valid target and action were specified");
<ide> });
<ide>
<del>test("it should use the actionContext specified in the argument", function(){
<add>test("it should use the actionContext specified in the argument", function() {
<ide> expect(2);
<ide> var context = {},
<ide> obj = Ember.Object.createWithMixins(Ember.TargetActionSupport,{
<ide><path>packages/ember-runtime/tests/suites/enumerable.js
<ide> var EnumerableTests = Ember.Object.extend({
<ide>
<ide> @returns {void}
<ide> */
<del> mutate: function(){},
<add> mutate: function() {},
<ide>
<ide> /**
<ide> Becomes true when you define a new mutate() method, indicating that
<ide><path>packages/ember-runtime/tests/system/array_proxy/arranged_content_test.js
<ide> test("toArray - returns copy of arrangedContent", function() {
<ide> });
<ide>
<ide> test("unshiftObject - adds to start of content", function() {
<del> Ember.run(function(){ array.unshiftObject(6); });
<add> Ember.run(function() { array.unshiftObject(6); });
<ide> deepEqual(array.get('content'), [6,1,2,4,5], 'adds to start of content');
<ide> });
<ide>
<ide> test("unshiftObjects - adds to start of content", function() {
<del> Ember.run(function(){ array.unshiftObjects([6,7]); });
<add> Ember.run(function() { array.unshiftObjects([6,7]); });
<ide> deepEqual(array.get('content'), [6,7,1,2,4,5], 'adds to start of content');
<ide> });
<ide>
<ide><path>packages/ember-runtime/tests/system/namespace/base_test.js
<ide> module('Ember.Namespace', {
<ide> teardown: function() {
<ide> Ember.BOOTED = false;
<ide>
<del> if (lookup.NamespaceA) { Ember.run(function(){ lookup.NamespaceA.destroy(); }); }
<del> if (lookup.NamespaceB) { Ember.run(function(){ lookup.NamespaceB.destroy(); }); }
<add> if (lookup.NamespaceA) { Ember.run(function() { lookup.NamespaceA.destroy(); }); }
<add> if (lookup.NamespaceB) { Ember.run(function() { lookup.NamespaceB.destroy(); }); }
<ide> if (lookup.namespaceC) {
<ide> try {
<ide> Ember.TESTING_DEPRECATION = true;
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> lookup.namespaceC.destroy();
<ide> });
<ide> } finally {
<ide><path>packages/ember-runtime/tests/system/object/create_test.js
<ide> test("calls setUnknownProperty if defined", function() {
<ide> test("throws if you try to define a computed property", function() {
<ide> expectAssertion(function() {
<ide> Ember.Object.create({
<del> foo: Ember.computed(function(){})
<add> foo: Ember.computed(function() {})
<ide> });
<ide> }, 'Ember.Object.create no longer supports defining computed properties.');
<ide> });
<ide>
<ide> test("throws if you try to call _super in a method", function() {
<del> expectAssertion(function(){
<add> expectAssertion(function() {
<ide> Ember.Object.create({
<ide> foo: function() {
<ide> this._super();
<ide> test("throws if you try to call _super in a method", function() {
<ide> }, 'Ember.Object.create no longer supports defining methods that call _super.');
<ide> });
<ide>
<del>test("throws if you try to 'mixin' a definition", function(){
<add>test("throws if you try to 'mixin' a definition", function() {
<ide> var myMixin = Ember.Mixin.create({
<del> adder: function(arg1, arg2){
<add> adder: function(arg1, arg2) {
<ide> return arg1 + arg2;
<ide> }
<ide> });
<ide>
<del> expectAssertion(function(){
<add> expectAssertion(function() {
<ide> var o = Ember.Object.create(myMixin);
<ide> }, "Ember.Object.create no longer supports mixing in other definitions, use createWithMixins instead.");
<ide> });
<ide><path>packages/ember-runtime/tests/system/object/destroy_test.js
<ide> test("bindings should be synced when are updated in the willDestroy hook", funct
<ide> bar: bar
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> Ember.bind(foo, 'value', 'bar.value');
<ide> });
<ide>
<ide><path>packages/ember-runtime/tests/system/object/toString_test.js
<ide> test("toString on a namespace finds the namespace in Ember.lookup", function() {
<ide>
<ide> test('toString includes toStringExtension if defined', function() {
<ide> var Foo = Ember.Object.extend({
<del> toStringExtension: function(){
<add> toStringExtension: function() {
<ide> return "fooey";
<ide> }
<ide> }),
<ide><path>packages/ember-states/lib/state.js
<ide> Ember.State.reopenClass({
<ide>
<ide> bManager = Ember.StateManager.create({
<ide> stateOne: Ember.State.create({
<del> changeToStateTwo: function(manager, context){
<add> changeToStateTwo: function(manager, context) {
<ide> manager.transitionTo('stateTwo', context)
<ide> }
<ide> }),
<ide><path>packages/ember-states/lib/state_manager.js
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide>
<ide> ```javascript
<ide> managerC = Ember.StateManager.create({
<del> initialState: function(){
<add> initialState: function() {
<ide> if (someLogic) {
<ide> return 'active';
<ide> } else {
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide> robotManager = Ember.StateManager.create({
<ide> initialState: 'poweredDown',
<ide> poweredDown: Ember.State.create({
<del> exit: function(stateManager){
<add> exit: function(stateManager) {
<ide> console.log("exiting the poweredDown state")
<ide> }
<ide> }),
<ide> poweredUp: Ember.State.create({
<del> enter: function(stateManager){
<add> enter: function(stateManager) {
<ide> console.log("entering the poweredUp state. Destroy all humans.")
<ide> }
<ide> })
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide> robotManager = Ember.StateManager.create({
<ide> initialState: 'poweredDown',
<ide> poweredDown: Ember.State.create({
<del> exit: function(stateManager){
<add> exit: function(stateManager) {
<ide> console.log("exiting the poweredDown state")
<ide> }
<ide> }),
<ide> poweredUp: Ember.State.create({
<del> enter: function(stateManager){
<add> enter: function(stateManager) {
<ide> console.log("entering the poweredUp state. Destroy all humans.")
<ide> }
<ide> })
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide> robotManager = Ember.StateManager.create({
<ide> initialState: 'poweredDown',
<ide> poweredDown: Ember.State.create({
<del> enter: function(){},
<del> exit: function(){
<add> enter: function() {},
<add> exit: function() {
<ide> console.log("exited poweredDown state")
<ide> },
<ide> charging: Ember.State.create({
<del> enter: function(){},
<del> exit: function(){}
<add> enter: function() {},
<add> exit: function() {}
<ide> }),
<ide> charged: Ember.State.create({
<del> enter: function(){
<add> enter: function() {
<ide> console.log("entered charged state")
<ide> },
<del> exit: function(){
<add> exit: function() {
<ide> console.log("exited charged state")
<ide> }
<ide> })
<ide> }),
<ide> poweredUp: Ember.State.create({
<del> enter: function(){
<add> enter: function() {
<ide> console.log("entered poweredUp state")
<ide> },
<del> exit: function(){},
<add> exit: function() {},
<ide> mobile: Ember.State.create({
<del> enter: function(){
<add> enter: function() {
<ide> console.log("entered mobile state")
<ide> },
<del> exit: function(){}
<add> exit: function() {}
<ide> }),
<ide> stationary: Ember.State.create({
<del> enter: function(){},
<del> exit: function(){}
<add> enter: function() {},
<add> exit: function() {}
<ide> })
<ide> })
<ide> })
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide> initialState: 'stateOne.substateOne.subsubstateOne',
<ide> stateOne: Ember.State.create({
<ide> substateOne: Ember.State.create({
<del> anAction: function(manager, context){
<add> anAction: function(manager, context) {
<ide> console.log("an action was called")
<ide> },
<ide> subsubstateOne: Ember.State.create({})
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide> })
<ide> }),
<ide> stateTwo: Ember.State.create({
<del> anAction: function(manager, context){
<add> anAction: function(manager, context) {
<ide> // will not be called below because it is
<ide> // not a parent of the current state
<ide> }
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide> initialState: 'poweredDown.charging',
<ide> poweredDown: Ember.State.create({
<ide> charging: Ember.State.create({
<del> chargeComplete: function(manager, context){
<add> chargeComplete: function(manager, context) {
<ide> manager.transitionTo('charged')
<ide> }
<ide> }),
<ide> charged: Ember.State.create({
<del> boot: function(manager, context){
<add> boot: function(manager, context) {
<ide> manager.transitionTo('poweredUp')
<ide> }
<ide> })
<ide> }),
<ide> poweredUp: Ember.State.create({
<del> beginExtermination: function(manager, context){
<add> beginExtermination: function(manager, context) {
<ide> manager.transitionTo('rampaging')
<ide> },
<ide> rampaging: Ember.State.create()
<ide> var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
<ide>
<ide> bManager = Ember.StateManager.create({
<ide> stateOne: Ember.State.create({
<del> changeToStateTwo: function(manager, context){
<add> changeToStateTwo: function(manager, context) {
<ide> manager.transitionTo('stateTwo', context)
<ide> }
<ide> }),
<ide><path>packages/ember-states/tests/state_test.js
<ide> test("the isLeaf property is false when a state has child states", function() {
<ide> equal(definitelyInside.get('isLeaf'), true);
<ide> });
<ide>
<del>test("propagates its container to its child states", function(){
<add>test("propagates its container to its child states", function() {
<ide> var container = { lookup: Ember.K },
<ide> manager = Ember.StateManager.create({
<ide> container: container,
<ide> test("propagates its container to its child states", function(){
<ide> });
<ide>
<ide> module("Ember.State.transitionTo", {
<del> setup: function(){
<add> setup: function() {
<ide> _$ = Ember.$;
<ide> Ember.$ = {};
<del> Ember.$.Event = function(){};
<add> Ember.$.Event = function() {};
<ide> },
<del> teardown: function(){
<add> teardown: function() {
<ide> Ember.$ = _$;
<ide> }
<ide> });
<del>test("sets the transition target", function(){
<add>test("sets the transition target", function() {
<ide> var receivedTarget,
<ide> receivedContext,
<ide> stateManager,
<ide> transitionFunction;
<ide>
<ide> stateManager = {
<del> transitionTo: function(target, context){
<add> transitionTo: function(target, context) {
<ide> receivedTarget = target;
<ide> receivedContext = context;
<ide> }
<ide> test("sets the transition target", function(){
<ide> ok(!receivedContext, "does not pass a context when given an event without context");
<ide> });
<ide>
<del>test("passes no context arguments when there are no contexts", function(){
<add>test("passes no context arguments when there are no contexts", function() {
<ide> var contextArgsCount,
<ide> stateManager,
<ide> transitionFunction,
<ide> test("passes no context arguments when there are no contexts", function(){
<ide> event.contexts = [];
<ide>
<ide> stateManager = {
<del> transitionTo: function(){
<add> transitionTo: function() {
<ide> contextArgsCount = [].slice.call(arguments, 1).length;
<ide> }
<ide> };
<ide> test("passes no context arguments when there are no contexts", function(){
<ide> equal( contextArgsCount, 0);
<ide> });
<ide>
<del>test("passes through a single context", function(){
<add>test("passes through a single context", function() {
<ide> var receivedContext,
<ide> stateManager,
<ide> transitionFunction,
<ide> test("passes through a single context", function(){
<ide> event.contexts = [{ value: 'context value' }];
<ide>
<ide> stateManager = {
<del> transitionTo: function(target, context){
<add> transitionTo: function(target, context) {
<ide> receivedContext = context;
<ide> }
<ide> };
<ide> test("passes through a single context", function(){
<ide> equal( receivedContext, event.contexts[0]);
<ide> });
<ide>
<del>test("passes through multiple contexts as additional arguments", function(){
<add>test("passes through multiple contexts as additional arguments", function() {
<ide> var receivedContexts,
<ide> stateManager,
<ide> transitionFunction,
<ide> test("passes through multiple contexts as additional arguments", function(){
<ide> event.contexts = [ { value: 'context1' }, { value: 'context2' } ];
<ide>
<ide> stateManager = {
<del> transitionTo: function(target){
<add> transitionTo: function(target) {
<ide> receivedContexts = [].slice.call(arguments, 1);
<ide> }
<ide> };
<ide> test("passes through multiple contexts as additional arguments", function(){
<ide> deepEqual( receivedContexts, event.contexts);
<ide> });
<ide>
<del>test("does not mutate the event contexts value", function(){
<add>test("does not mutate the event contexts value", function() {
<ide> var receivedContexts,
<ide> stateManager,
<ide> transitionFunction,
<ide> test("does not mutate the event contexts value", function(){
<ide> event.contexts = originalContext.slice();
<ide>
<ide> stateManager = {
<del> transitionTo: function(target){
<add> transitionTo: function(target) {
<ide> receivedContexts = [].slice.call(arguments, 1);
<ide> }
<ide> };
<ide> test("does not mutate the event contexts value", function(){
<ide> deepEqual(event.contexts, originalContext);
<ide> });
<ide>
<del>test("passes no context arguments when called with no context or event", function(){
<add>test("passes no context arguments when called with no context or event", function() {
<ide> var receivedContexts,
<ide> stateManager,
<ide> transitionFunction;
<ide>
<ide> stateManager = {
<del> transitionTo: function(target){
<add> transitionTo: function(target) {
<ide> receivedContexts = [].slice.call(arguments, 1);
<ide> }
<ide> };
<ide> test("passes no context arguments when called with no context or event", functio
<ide> equal( receivedContexts.length, 0, "transitionTo receives no context");
<ide> });
<ide>
<del>test("handles contexts without an event", function(){
<add>test("handles contexts without an event", function() {
<ide> var receivedContexts,
<ide> stateManager,
<ide> transitionFunction,
<ide> test("handles contexts without an event", function(){
<ide> context2 = { value: 'context2', contexts: ''};
<ide>
<ide> stateManager = {
<del> transitionTo: function(target){
<add> transitionTo: function(target) {
<ide> receivedContexts = [].slice.call(arguments, 1);
<ide> }
<ide> };
<ide><path>packages/ember-testing/lib/helpers.js
<ide> function click(app, selector, context) {
<ide>
<ide> function keyEvent(app, selector, context, type, keyCode) {
<ide> var $el;
<del> if(typeof keyCode === 'undefined'){
<add> if (typeof keyCode === 'undefined') {
<ide> keyCode = type;
<ide> type = context;
<ide> context = null;
<ide> function chain(app, promise, fn) {
<ide> * Example:
<ide> *
<ide> * ```
<del>* visit('posts/index').then(function(){
<add>* visit('posts/index').then(function() {
<ide> * // assert something
<ide> * });
<ide> * ```
<ide> helper('visit', visit);
<ide> * Example:
<ide> *
<ide> * ```
<del>* click('.some-jQuery-selector').then(function(){
<add>* click('.some-jQuery-selector').then(function() {
<ide> * // assert something
<ide> * });
<ide> * ```
<ide> helper('click', click);
<ide> * Example:
<ide> *
<ide> * ```
<del>* keyEvent('.some-jQuery-selector', 'keypress', 13).then(function(){
<add>* keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
<ide> * // assert something
<ide> * });
<ide> * ```
<ide> helper('keyEvent', keyEvent);
<ide> * Example:
<ide> *
<ide> * ```
<del>* fillIn('#email', 'you@example.com').then(function(){
<add>* fillIn('#email', 'you@example.com').then(function() {
<ide> * // assert something
<ide> * });
<ide> * ```
<ide><path>packages/ember-testing/lib/support.js
<ide> $(function() {
<ide> $.event.special.click = {
<ide> // For checkbox, fire native event so checked state will be right
<ide> trigger: function() {
<del> if ( $.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
<add> if ($.nodeName( this, "input" ) && this.type === "checkbox" && this.click) {
<ide> this.click();
<ide> return false;
<ide> }
<ide><path>packages/ember-testing/tests/acceptance_test.js
<ide> var App, find, click, fillIn, currentRoute, visit, originalAdapter;
<ide>
<ide> module("ember-testing Acceptance", {
<del> setup: function(){
<add> setup: function() {
<ide> Ember.$('<style>#ember-testing-container { position: absolute; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; } #ember-testing { zoom: 50%; }</style>').appendTo('head');
<ide> Ember.$('<div id="ember-testing-container"><div id="ember-testing"></div></div>').appendTo('body');
<ide> Ember.run(function() {
<ide> module("ember-testing Acceptance", {
<ide> App.setupForTesting();
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> App.advanceReadiness();
<ide> });
<ide>
<ide> module("ember-testing Acceptance", {
<ide> originalAdapter = Ember.Test.adapter;
<ide> },
<ide>
<del> teardown: function(){
<add> teardown: function() {
<ide> App.removeTestHelpers();
<ide> Ember.$('#ember-testing-container, #ember-testing').remove();
<ide> Ember.run(App, App.destroy);
<ide> test("helpers can be chained with then", function() {
<ide> }).then(function() {
<ide> equal(Ember.$('.ember-text-field').val(), 'yeah', "chained with fillIn");
<ide> return fillIn('.ember-text-field', '#ember-testing-container', "context working");
<del> }).then(function(){
<add> }).then(function() {
<ide> equal(Ember.$('.ember-text-field').val(), 'context working', "chained with fillIn");
<ide> click(".does-not-exist");
<ide> }).then(function() {
<ide> test("helpers can be chained to each other", function() {
<ide> .then(function() {
<ide> equal(currentRoute, 'comments', "Successfully visited posts route");
<ide> equal(Ember.$('.ember-text-field').val(), 'hello', "Fillin successfully works");
<del> find('.ember-text-field').one('keypress', function(e){
<add> find('.ember-text-field').one('keypress', function(e) {
<ide> equal(e.keyCode, 13, "keyevent chained with correct keyCode.");
<ide> });
<ide> })
<ide><path>packages/ember-views/lib/mixins/view_target_action_support.js
<ide> For example:
<ide> ```javascript
<ide> App.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {
<ide> action: 'save',
<del> click: function(){
<add> click: function() {
<ide> this.triggerAction(); // Sends the `save` action, along with the current context
<ide> // to the current controller
<ide> }
<ide> to `triggerAction` as well.
<ide>
<ide> ```javascript
<ide> App.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {
<del> click: function(){
<add> click: function() {
<ide> this.triggerAction({
<ide> action: 'save'
<ide> }); // Sends the `save` action, along with the current context
<ide><path>packages/ember-views/lib/system/render_buffer.js
<ide> Ember._RenderBuffer.prototype =
<ide> if (this._hasElement && this._element) {
<ide> // Firefox versions < 11 do not have support for element.outerHTML.
<ide> var thisElement = this.element(), outerHTML = thisElement.outerHTML;
<del> if (typeof outerHTML === 'undefined'){
<add> if (typeof outerHTML === 'undefined') {
<ide> return Ember.$('<div/>').append(thisElement).html();
<ide> }
<ide> return outerHTML;
<ide> Ember._RenderBuffer.prototype =
<ide>
<ide> var string = value.toString();
<ide>
<del> if(!possible.test(string)) { return string; }
<add> if (!possible.test(string)) { return string; }
<ide> return string.replace(badChars, escapeChar);
<ide> }
<ide>
<ide><path>packages/ember-views/lib/system/utils.js
<ide> // is a "zero-scope" element. This problem can be worked around by making
<ide> // the first node an invisible text node. We, like Modernizr, use ­
<ide>
<del>var needsShy = this.document && (function(){
<add>var needsShy = this.document && (function() {
<ide> var testEl = document.createElement('div');
<ide> testEl.innerHTML = "<div></div>";
<ide> testEl.firstChild.innerHTML = "<script></script>";
<ide><path>packages/ember-views/lib/views/view.js
<ide> var childViewsProperty = Ember.computed(function() {
<ide> a_forEach(childViews, function(view) {
<ide> var currentChildViews;
<ide> if (view.isVirtual) {
<del> if(currentChildViews = get(view, 'childViews')) {
<add> if (currentChildViews = get(view, 'childViews')) {
<ide> ret.pushObjects(currentChildViews);
<ide> }
<ide> } else {
<ide> class:
<ide> MyView = Ember.View.extend({
<ide> classNameBindings: ['propertyA', 'propertyB'],
<ide> propertyA: 'from-a',
<del> propertyB: function(){
<del> if(someLogic){ return 'from-b'; }
<add> propertyB: function() {
<add> if (someLogic) { return 'from-b'; }
<ide> }.property()
<ide> });
<ide> ```
<ide> class:
<ide> MyTextInput = Ember.View.extend({
<ide> tagName: 'input',
<ide> attributeBindings: ['disabled'],
<del> disabled: function(){
<add> disabled: function() {
<ide> if (someLogic) {
<ide> return true;
<ide> } else {
<ide> class:
<ide>
<ide> aController = Ember.Object.create({
<ide> firstName: 'Barry',
<del> excitedGreeting: function(){
<add> excitedGreeting: function() {
<ide> return this.get("content.firstName") + "!!!"
<ide> }.property()
<ide> });
<ide> class:
<ide>
<ide> ```javascript
<ide> AView = Ember.View.extend({
<del> click: function(event){
<add> click: function(event) {
<ide> // will be called when when an instance's
<ide> // rendered element is clicked
<ide> }
<ide> class:
<ide> ```javascript
<ide> AView = Ember.View.extend({
<ide> eventManager: Ember.Object.create({
<del> doubleClick: function(event, view){
<add> doubleClick: function(event, view) {
<ide> // will be called when when an instance's
<ide> // rendered element or any rendering
<ide> // of this views's descendent
<ide> class:
<ide>
<ide> ```javascript
<ide> AView = Ember.View.extend({
<del> mouseEnter: function(event){
<add> mouseEnter: function(event) {
<ide> // will never trigger.
<ide> },
<ide> eventManager: Ember.Object.create({
<del> mouseEnter: function(event, view){
<add> mouseEnter: function(event, view) {
<ide> // takes presedence over AView#mouseEnter
<ide> }
<ide> })
<ide> class:
<ide> OuterView = Ember.View.extend({
<ide> template: Ember.Handlebars.compile("outer {{#view InnerView}}inner{{/view}} outer"),
<ide> eventManager: Ember.Object.create({
<del> mouseEnter: function(event, view){
<add> mouseEnter: function(event, view) {
<ide> // view might be instance of either
<ide> // OuterView or InnerView depending on
<ide> // where on the page the user interaction occured
<ide> class:
<ide> });
<ide>
<ide> InnerView = Ember.View.extend({
<del> click: function(event){
<add> click: function(event) {
<ide> // will be called if rendered inside
<ide> // an OuterView because OuterView's
<ide> // eventManager doesn't handle click events
<ide> },
<del> mouseEnter: function(event){
<add> mouseEnter: function(event) {
<ide> // will never be called if rendered inside
<ide> // an OuterView.
<ide> }
<ide> Ember.View = Ember.CoreView.extend(
<ide> var view = get(this, 'parentView');
<ide>
<ide> while (view) {
<del> if(view instanceof klass) { return view; }
<add> if (view instanceof klass) { return view; }
<ide> view = get(view, 'parentView');
<ide> }
<ide> },
<ide> Ember.View = Ember.CoreView.extend(
<ide> function(view) { return klass.detect(view.constructor); };
<ide>
<ide> while (view) {
<del> if( isOfType(view) ) { return view; }
<add> if (isOfType(view)) { return view; }
<ide> view = get(view, 'parentView');
<ide> }
<ide> },
<ide> Ember.View = Ember.CoreView.extend(
<ide> var view = get(this, 'parentView');
<ide>
<ide> while (view) {
<del> if(get(view, 'parentView') instanceof klass) { return view; }
<add> if (get(view, 'parentView') instanceof klass) { return view; }
<ide> view = get(view, 'parentView');
<ide> }
<ide> },
<ide> Ember.View = Ember.CoreView.extend(
<ide> }
<ide>
<ide> var view = this,
<del> stateCheckedObserver = function(){
<add> stateCheckedObserver = function() {
<ide> view.currentState.invokeObserver(this, observer);
<ide> },
<ide> scheduledObserver = function() {
<ide><path>packages/ember-views/tests/system/ext_test.js
<ide> test("View hierarchy is done rendering to DOM when functions queued in afterRend
<ide> render: function(buffer) {
<ide> buffer.push('child');
<ide> },
<del> didInsertElement: function(){
<add> didInsertElement: function() {
<ide> this.$().addClass('extra-class');
<ide> }
<ide> });
<ide> test("View hierarchy is done rendering to DOM when functions queued in afterRend
<ide> },
<ide> didInsertElement: function() {
<ide> lookup1 = this.$('.extra-class');
<del> Ember.run.scheduleOnce('afterRender', this, function(){
<add> Ember.run.scheduleOnce('afterRender', this, function() {
<ide> lookup2 = this.$('.extra-class');
<ide> });
<ide> }
<ide> test("View hierarchy is done rendering to DOM when functions queued in afterRend
<ide> equal(lookup1.length, 0, "doesn't not find child in DOM on didInsertElement");
<ide> equal(lookup2.length, 1, "finds child in DOM afterRender");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> parentView.destroy();
<ide> });
<ide> });
<ide><path>packages/ember-views/tests/system/render_buffer_test.js
<ide> test("handles null props - Issue #2019", function() {
<ide> equal('<span></span><div>', buffer.string());
<ide> });
<ide>
<del>test("handles browsers like Firefox < 11 that don't support outerHTML Issue #1952", function(){
<add>test("handles browsers like Firefox < 11 that don't support outerHTML Issue #1952", function() {
<ide> var buffer = new Ember.RenderBuffer('div');
<ide> buffer.pushOpeningTag();
<ide> // Make sure element.outerHTML is falsy to trigger the fallback.
<ide> var elementStub = '<div></div>';
<del> buffer.element = function(){ return elementStub; };
<add> buffer.element = function() { return elementStub; };
<ide> // IE8 returns `element name as upper case with extra whitespace.
<ide> equal(elementStub, buffer.string().toLowerCase().replace(/\s/g, ''));
<ide> });
<ide><path>packages/ember-views/tests/views/collection_test.js
<ide> module("Ember.CollectionView", {
<ide> },
<ide> teardown: function() {
<ide> delete Ember.CollectionView.CONTAINER_MAP.del;
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (view) { view.destroy(); }
<ide> });
<ide> }
<ide> test("a array_proxy that backs an sorted array_controller that backs a collectio
<ide> test("when a collection view is emptied, deeply nested views elements are not removed from the DOM and then destroyed again", function() {
<ide> var assertProperDestruction = Ember.Mixin.create({
<ide> destroyElement: function() {
<del> if ( this.state === 'inDOM' ) {
<add> if (this.state === 'inDOM') {
<ide> ok(this.get('element'), this + ' still exists in DOM');
<ide> }
<ide> return this._super();
<ide><path>packages/ember-views/tests/views/container_view_test.js
<ide> test("should be able to insert views after the DOM representation is created", f
<ide> equal(view._parentView, container, 'view\'s _parentView is the container');
<ide> equal(Ember.$.trim(container.$().text()), "This is my moment");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> container.destroy();
<ide> });
<ide>
<ide> test("should set the parentView property on views that are added to the child vi
<ide> container.appendTo('#qunit-fixture');
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> container.pushObject(view);
<ide> });
<ide>
<ide> test("should set the parentView property on views that are added to the child vi
<ide> thirdView = View.create(),
<ide> fourthView = View.create();
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> container.pushObject(secondView);
<ide> container.replace(1, 0, [thirdView, fourthView]);
<ide> });
<ide> test("Child view can only be added to one container at a time", function () {
<ide> container.set('currentView', view);
<ide> });
<ide>
<del> expectAssertion(function(){
<add> expectAssertion(function() {
<ide> Ember.run(function() {
<ide> secondContainer.set('currentView', view);
<ide> });
<ide> });
<ide>
<del> expectAssertion(function(){
<add> expectAssertion(function() {
<ide> Ember.run(function() {
<ide> secondContainer.pushObject(view);
<ide> });
<ide><path>packages/ember-views/tests/views/view/append_to_test.js
<ide> module("Ember.View - append() and appendTo()", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (!view.isDestroyed) { view.destroy(); }
<ide> });
<ide> }
<ide> test("should be added to the document body when calling append()", function() {
<ide> ok(viewElem.length > 0, "creates and appends the view's element");
<ide> });
<ide>
<del>test("append calls willInsertElement and didInsertElement callbacks", function(){
<add>test("append calls willInsertElement and didInsertElement callbacks", function() {
<ide> var willInsertElementCalled = false;
<ide> var willInsertElementCalledInChild = false;
<ide> var didInsertElementCalled = false;
<ide>
<ide> var ViewWithCallback = View.extend({
<del> willInsertElement: function(){
<add> willInsertElement: function() {
<ide> willInsertElementCalled = true;
<ide> },
<del> didInsertElement: function(){
<add> didInsertElement: function() {
<ide> didInsertElementCalled = true;
<ide> },
<ide> render: function(buffer) {
<ide> module("Ember.View - append() and appendTo() in a view hierarchy", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (!view.isDestroyed) { view.destroy(); }
<ide> });
<ide> }
<ide> module("Ember.View - removing views in a view hierarchy", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> if (!view.isDestroyed) { view.destroy(); }
<ide> });
<ide> }
<ide><path>packages/ember-views/tests/views/view/attribute_bindings_test.js
<ide> module("Ember.View - Attribute Bindings", {
<ide> },
<ide> teardown: function() {
<ide> if (view) {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> view = null;
<ide> test("should render attribute bindings", function() {
<ide> notNumber: NaN
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should update attribute bindings", function() {
<ide> explosions: 15
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should update attribute bindings", function() {
<ide> ok(view.$().prop('notNumber'), "adds notNumber attribute when true");
<ide> equal(view.$().attr('explosions'), "15", "adds integer attributes");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.set('type', 'submit');
<ide> view.set('isDisabled', false);
<ide> view.set('exploded', false);
<ide> test("should allow binding to String objects", function() {
<ide> view = Ember.View.create({
<ide> attributeBindings: ['foo'],
<ide> // JSHint doesn't like `new String` so we'll create it the same way it gets created in practice
<del> foo: (function(){ return this; }).call("bar")
<add> foo: (function() { return this; }).call("bar")
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("handles a 0 value attribute on text fields", function() {
<ide> strictEqual(view.$().prop('value'), "0", "value should be 0");
<ide> });
<ide>
<del>test("attributeBindings should not fail if view has been removed", function(){
<del> Ember.run(function(){
<add>test("attributeBindings should not fail if view has been removed", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> attributeBindings: ['checked'],
<ide> checked: true
<ide> });
<ide> });
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide> var error;
<ide> try {
<del> Ember.run(function(){
<del> Ember.changeProperties(function(){
<add> Ember.run(function() {
<add> Ember.changeProperties(function() {
<ide> view.set('checked', false);
<ide> view.remove();
<ide> });
<ide> test("attributeBindings should not fail if view has been removed", function(){
<ide> ok(!error, error);
<ide> });
<ide>
<del>test("attributeBindings should not fail if view has been destroyed", function(){
<del> Ember.run(function(){
<add>test("attributeBindings should not fail if view has been destroyed", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> attributeBindings: ['checked'],
<ide> checked: true
<ide> });
<ide> });
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide> var error;
<ide> try {
<del> Ember.run(function(){
<del> Ember.changeProperties(function(){
<add> Ember.run(function() {
<add> Ember.changeProperties(function() {
<ide> view.set('checked', false);
<ide> view.destroy();
<ide> });
<ide><path>packages/ember-views/tests/views/view/child_views_test.js
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> parentView.destroy();
<ide> childView.destroy();
<ide> });
<ide><path>packages/ember-views/tests/views/view/class_name_bindings_test.js
<ide> test("should apply bound class names to the element", function() {
<ide> }
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should add, remove, or change class names if changed after element is crea
<ide> })
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> set(view, 'priority', 'orange');
<ide> set(view, 'isUrgent', false);
<ide> test(":: class name syntax works with an empty true class", function() {
<ide> classNameBindings: ['isEnabled::not-enabled']
<ide> });
<ide>
<del> Ember.run(function(){ view.createElement(); });
<add> Ember.run(function() { view.createElement(); });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view not-enabled', "false class is rendered when property is false");
<ide>
<del> Ember.run(function(){ view.set('isEnabled', true); });
<add> Ember.run(function() { view.set('isEnabled', true); });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view', "no class is added when property is true and the class is empty");
<ide> });
<ide>
<del>test("classNames should not be duplicated on rerender", function(){
<del> Ember.run(function(){
<add>test("classNames should not be duplicated on rerender", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> classNameBindings: ['priority'],
<ide> priority: 'high'
<ide> });
<ide> });
<ide>
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view high');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.rerender();
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view high');
<ide> });
<ide>
<del>test("classNameBindings should work when the binding property is updated and the view has been removed of the DOM", function(){
<del> Ember.run(function(){
<add>test("classNameBindings should work when the binding property is updated and the view has been removed of the DOM", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> classNameBindings: ['priority'],
<ide> priority: 'high'
<ide> });
<ide> });
<ide>
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view high');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.remove();
<ide> });
<ide>
<ide> test("classNameBindings should work when the binding property is updated and the
<ide>
<ide> });
<ide>
<del>test("classNames removed by a classNameBindings observer should not re-appear on rerender", function(){
<add>test("classNames removed by a classNameBindings observer should not re-appear on rerender", function() {
<ide> view = Ember.View.create({
<ide> classNameBindings: ['isUrgent'],
<ide> isUrgent: true
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view is-urgent');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.set('isUrgent', false);
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.rerender();
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view');
<ide> });
<ide>
<del>test("classNameBindings lifecycle test", function(){
<del> Ember.run(function(){
<add>test("classNameBindings lifecycle test", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> classNameBindings: ['priority'],
<ide> priority: 'high'
<ide> test("classNameBindings lifecycle test", function(){
<ide>
<ide> equal(Ember.isWatching(view, 'priority'), false);
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> equal(view.$().attr('class'), 'ember-view high');
<ide> equal(Ember.isWatching(view, 'priority'), true);
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.remove();
<ide> view.set('priority', 'low');
<ide> });
<ide>
<ide> equal(Ember.isWatching(view, 'priority'), false);
<ide> });
<ide>
<del>test("classNameBindings should not fail if view has been removed", function(){
<del> Ember.run(function(){
<add>test("classNameBindings should not fail if view has been removed", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> classNameBindings: ['priority'],
<ide> priority: 'high'
<ide> });
<ide> });
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide> var error;
<ide> try {
<del> Ember.run(function(){
<del> Ember.changeProperties(function(){
<add> Ember.run(function() {
<add> Ember.changeProperties(function() {
<ide> view.set('priority', 'low');
<ide> view.remove();
<ide> });
<ide> test("classNameBindings should not fail if view has been removed", function(){
<ide> ok(!error, error);
<ide> });
<ide>
<del>test("classNameBindings should not fail if view has been destroyed", function(){
<del> Ember.run(function(){
<add>test("classNameBindings should not fail if view has been destroyed", function() {
<add> Ember.run(function() {
<ide> view = Ember.View.create({
<ide> classNameBindings: ['priority'],
<ide> priority: 'high'
<ide> });
<ide> });
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide> var error;
<ide> try {
<del> Ember.run(function(){
<del> Ember.changeProperties(function(){
<add> Ember.run(function() {
<add> Ember.changeProperties(function() {
<ide> view.set('priority', 'low');
<ide> view.destroy();
<ide> });
<ide><path>packages/ember-views/tests/views/view/create_element_test.js
<ide> test("returns the receiver", function() {
<ide>
<ide> view = Ember.View.create();
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> ret = view.createElement();
<ide> });
<ide>
<ide> test("calls render and turns resultant string into element", function() {
<ide> });
<ide>
<ide> equal(get(view, 'element'), null, 'precondition - has no element');
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("generated element include HTML from child views as well", function() {
<ide> childViews: [ Ember.View.create({ elementId: "foo" })]
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide><path>packages/ember-views/tests/views/view/destroy_element_test.js
<ide> test("if it has a element, calls willDestroyElement on receiver and child views
<ide> })]
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("returns receiver", function() {
<ide> var ret;
<ide> view = Ember.View.create();
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> ret = view.destroyElement();
<ide> });
<ide><path>packages/ember-views/tests/views/view/destroy_test.js
<ide> test("should teardown viewName on parentView when childView is destroyed", funct
<ide>
<ide> equal(get(parentView, viewName), childView, "Precond - child view was registered on parent");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> childView.destroy();
<ide> });
<ide>
<ide><path>packages/ember-views/tests/views/view/is_visible_test.js
<ide> module("Ember.View#isVisible", {
<ide>
<ide> teardown: function() {
<ide> if (view) {
<del> Ember.run(function(){ view.destroy(); });
<add> Ember.run(function() { view.destroy(); });
<ide> }
<ide> }
<ide> });
<ide> test("should hide element if isVisible is false before element is created", func
<ide> });
<ide>
<ide> test("view should be notified after isVisible is set to false and the element has been hidden", function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view = View.create({ isVisible: false });
<ide> view.append();
<ide> });
<ide><path>packages/ember-views/tests/views/view/jquery_test.js
<ide> module("Ember.View#$", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> }
<ide><path>packages/ember-views/tests/views/view/layout_test.js
<ide> test("should call the function of the associated layout", function() {
<ide> templateName: 'template'
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should call the function of the associated template with itself as the con
<ide> }
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should fall back to defaultTemplate if neither template nor templateName a
<ide> }
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should not use defaultLayout if layout is provided", function() {
<ide> });
<ide>
<ide> view = View.create();
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("the template property is available to the layout template", function() {
<ide> }
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide><path>packages/ember-views/tests/views/view/nearest_of_type_test.js
<ide> module("Ember.View#nearest*", {
<ide> equal(child.nearestOfType(Mixin), parentView, "finds closest view in the hierarchy by class");
<ide> });
<ide>
<del>test("nearestWithProperty should search immediate parent", function(){
<add>test("nearestWithProperty should search immediate parent", function() {
<ide> var childView;
<ide>
<ide> view = Ember.View.create({
<ide><path>packages/ember-views/tests/views/view/remove_test.js
<ide> module("Ember.View#removeAllChildren", {
<ide> },
<ide> teardown: function() {
<ide> Ember.run(function() {
<del> childViews.forEach(function(v){ v.destroy(); });
<add> childViews.forEach(function(v) { v.destroy(); });
<ide> view.destroy();
<ide> });
<ide> }
<ide> test("removes view from parent view", function() {
<ide> child = get(parentView, 'childViews').objectAt(0);
<ide> ok(get(child, 'parentView'), 'precond - has parentView');
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> parentView.createElement();
<ide> });
<ide>
<ide><path>packages/ember-views/tests/views/view/render_test.js
<ide> test("default implementation does not render child views", function() {
<ide> })
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide> equal(rendered, 1, 'rendered the child once');
<ide> test("should invoke renderChildViews if layer is destroyed then re-rendered", fu
<ide> equal(parentRendered, 2);
<ide> equal(view.$('div').length, 1);
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> });
<ide> test("should render child views with a different tagName", function() {
<ide> })
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should render child views with a different tagName", function() {
<ide> test("should add ember-view to views", function() {
<ide> view = Ember.View.create();
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should add ember-view to views", function() {
<ide> test("should not add role attribute unless one is specified", function() {
<ide> view = Ember.View.create();
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide><path>packages/ember-views/tests/views/view/replace_in_test.js
<ide> module("Ember.View - replaceIn()", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> }
<ide> module("Ember.View - replaceIn() in a view hierarchy", {
<ide> },
<ide>
<ide> teardown: function() {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> }
<ide><path>packages/ember-views/tests/views/view/template_test.js
<ide> test("should call the function of the associated template", function() {
<ide> templateName: 'testTemplate'
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should call the function of the associated template with itself as the con
<ide> }
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should fall back to defaultTemplate if neither template nor templateName a
<ide> }
<ide> });
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should not use defaultTemplate if template is provided", function() {
<ide> });
<ide>
<ide> view = View.create();
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should not use defaultTemplate if template is provided", function() {
<ide> });
<ide>
<ide> view = View.create();
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should not use defaultTemplate if template is provided", function() {
<ide>
<ide> test("should render an empty element if no template is specified", function() {
<ide> view = Ember.View.create();
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.createElement();
<ide> });
<ide>
<ide> test("should provide a controller to the template if a controller is specified o
<ide>
<ide> strictEqual(optionsDataKeywordsControllerForView, controller1, "passes the controller in the data");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide>
<ide> test("should provide a controller to the template if a controller is specified o
<ide> strictEqual(optionsDataKeywordsControllerForView, controller1, "passes the controller in the data");
<ide> strictEqual(optionsDataKeywordsControllerForChildView, controller2, "passes the child view's controller in the data");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> parentView.destroy();
<ide> });
<ide>
<ide><path>packages/ember-views/tests/views/view/view_lifecycle_test.js
<ide> module("views/view/view_lifecycle_test - pre-render", {
<ide>
<ide> teardown: function() {
<ide> if (view) {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> }
<ide> module("views/view/view_lifecycle_test - in render", {
<ide>
<ide> teardown: function() {
<ide> if (view) {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> }
<ide> test("rerender should throw inside a template", function() {
<ide> module("views/view/view_lifecycle_test - in DOM", {
<ide> teardown: function() {
<ide> if (view) {
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> view.destroy();
<ide> });
<ide> }
<ide><path>packages/ember/tests/helpers/link_to_test.js
<ide> test("The {{linkTo}} helper supports URL replacement", function() {
<ide> equal(replaceCount, 1, 'replaceURL should be called once');
<ide> });
<ide>
<del>test("the {{linkTo}} helper doesn't add an href when the tagName isn't 'a'", function(){
<add>test("the {{linkTo}} helper doesn't add an href when the tagName isn't 'a'", function() {
<ide> Ember.TEMPLATES.index = Ember.Handlebars.compile("{{#linkTo 'about' id='about-link' tagName='div'}}About{{/linkTo}}");
<ide>
<ide> Router.map(function() {
<ide><path>packages/ember/tests/routing/basic_test.js
<ide> test("The Homepage with a computed context that does not get overridden", functi
<ide> });
<ide>
<ide> App.HomeController = Ember.ArrayController.extend({
<del> content: Ember.computed(function(){
<add> content: Ember.computed(function() {
<ide> return Ember.A([
<ide> "Monday through Friday: 9am to 5pm",
<ide> "Saturday: Noon to Midnight",
<ide> asyncTest("Events are triggered on the controller if a matching action name is i
<ide> );
<ide>
<ide> var controller = Ember.Controller.extend({
<del> showStuff: function(context){
<add> showStuff: function(context) {
<ide> ok (stateIsNotCalled, "an event on the state is not triggered");
<ide> deepEqual(context, { name: "Tom Dale" }, "an event with context is passed");
<ide> start();
<ide> test('navigating away triggers a url property change', function() {
<ide>
<ide> var transition = handleURL("/");
<ide>
<del> Ember.run(function(){
<add> Ember.run(function() {
<ide> transition.then(function() {
<ide> equal(urlPropertyChangeCount, 2);
<ide>
<ide> test("Route supports clearing outlet explicitly", function() {
<ide>
<ide> App.PostsRoute = Ember.Route.extend({
<ide> events: {
<del> showModal: function(){
<add> showModal: function() {
<ide> this.render('postsModal', {
<ide> into: 'application',
<ide> outlet: 'modal'
<ide> });
<ide> },
<del> hideModal: function(){
<add> hideModal: function() {
<ide> this.disconnectOutlet({outlet: 'modal', parentView: 'application'});
<ide> }
<ide> }
<ide> });
<ide>
<ide> App.PostsIndexRoute = Ember.Route.extend({
<ide> events: {
<del> showExtra: function(){
<add> showExtra: function() {
<ide> this.render('postsExtra', {
<ide> into: 'posts/index'
<ide> });
<ide> },
<del> hideExtra: function(){
<add> hideExtra: function() {
<ide> this.disconnectOutlet({parentView: 'posts/index'});
<ide> }
<ide> }
<ide><path>packages/metamorph/lib/main.js
<ide> define("metamorph",
<ide> // Copyright: ©2011 My Company Inc. All rights reserved.
<ide> // ==========================================================================
<ide>
<del> var K = function(){},
<add> var K = function() {},
<ide> guid = 0,
<ide> document = this.document,
<ide>
<ide> define("metamorph",
<ide> // Internet Explorer prior to 9 does not allow setting innerHTML if the first element
<ide> // is a "zero-scope" element. This problem can be worked around by making
<ide> // the first node an invisible text node. We, like Modernizr, use ­
<del> needsShy = document && (function(){
<add> needsShy = document && (function() {
<ide> var testEl = document.createElement('div');
<ide> testEl.innerHTML = "<div></div>";
<ide> testEl.firstChild.innerHTML = "<script></script>";
<ide><path>packages/rsvp/lib/main.js
<ide> define("rsvp/async",
<ide> observer.observe(element, { attributes: true });
<ide>
<ide> // Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661
<del> window.addEventListener('unload', function(){
<add> window.addEventListener('unload', function() {
<ide> observer.disconnect();
<ide> observer = null;
<ide> });
<ide> define("rsvp/promise",
<ide> return isFunction(x) || (typeof x === "object" && x !== null);
<ide> }
<ide>
<del> function isFunction(x){
<add> function isFunction(x) {
<ide> return typeof x === "function";
<ide> }
<ide>
<ide> define("rsvp/resolve",
<ide> return typeof x === "function" || (typeof x === "object" && x !== null);
<ide> }
<ide>
<del> function resolve(thenable){
<del> var promise = new Promise(function(resolve, reject){
<add> function resolve(thenable) {
<add> var promise = new Promise(function(resolve, reject) {
<ide> var then;
<ide>
<ide> try {
<del> if ( objectOrFunction(thenable) ) {
<add> if (objectOrFunction(thenable)) {
<ide> then = thenable.then;
<ide>
<ide> if (typeof then === "function") { | 140 |
Mixed | Javascript | add capturerejection option | ae8f20ec5eee55f648823392c9c4e9491c958b60 | <ide><path>doc/api/events.md
<ide> myEmitter.emit('error', new Error('whoops!'));
<ide> // Prints: whoops! there was an error
<ide> ```
<ide>
<add>## Capture Rejections of Promises
<add>
<add>> Stability: 1 - captureRejections is experimental.
<add>
<add>Using `async` functions with event handlers is problematic, because it
<add>can lead to an unhandled rejection in case of a thrown exception:
<add>
<add>```js
<add>const ee = new EventEmitter();
<add>ee.on('something', async (value) => {
<add> throw new Error('kaboom');
<add>});
<add>```
<add>
<add>The `captureRejections` option in the `EventEmitter` constructor or the global
<add>setting change this behavior, installing a `.then(undefined, handler)`
<add>handler on the `Promise`. This handler routes the exception
<add>asynchronously to the [`Symbol.for('nodejs.rejection')`][rejection] method
<add>if there is one, or to [`'error'`][error] event handler if there is none.
<add>
<add>```js
<add>const ee1 = new EventEmitter({ captureRejections: true });
<add>ee1.on('something', async (value) => {
<add> throw new Error('kaboom');
<add>});
<add>
<add>ee1.on('error', console.log);
<add>
<add>const ee2 = new EventEmitter({ captureRejections: true });
<add>ee2.on('something', async (value) => {
<add> throw new Error('kaboom');
<add>});
<add>
<add>ee2[Symbol.for('nodejs.rejection')] = console.log;
<add>```
<add>
<add>Setting `EventEmitter.captureRejections = true` will change the default for all
<add>new instances of `EventEmitter`.
<add>
<add>```js
<add>EventEmitter.captureRejections = true;
<add>const ee1 = new EventEmitter();
<add>ee1.on('something', async (value) => {
<add> throw new Error('kaboom');
<add>});
<add>
<add>ee1.on('error', console.log);
<add>```
<add>
<add>The `'error'` events that are generated by the `captureRejections` behavior
<add>do not have a catch handler to avoid infinite error loops: the
<add>recommendation is to **not use `async` functions as `'error'` event handlers**.
<add>
<ide> ## Class: EventEmitter
<ide> <!-- YAML
<ide> added: v0.1.26
<add>changes:
<add> - version: REPLACEME
<add> pr-url: https://github.com/nodejs/node/pull/27867
<add> description: Added captureRejections option.
<ide> -->
<ide>
<ide> The `EventEmitter` class is defined and exposed by the `events` module:
<ide> const EventEmitter = require('events');
<ide> All `EventEmitter`s emit the event `'newListener'` when new listeners are
<ide> added and `'removeListener'` when existing listeners are removed.
<ide>
<add>It supports the following option:
<add>
<add>* `captureRejections` {boolean} It enables
<add> [automatic capturing of promise rejection][capturerejections].
<add> Default: `false`.
<add>
<ide> ### Event: 'newListener'
<ide> <!-- YAML
<ide> added: v0.1.26
<ide> newListeners[0]();
<ide> emitter.emit('log');
<ide> ```
<ide>
<add>### emitter\[Symbol.for('nodejs.rejection')\](err, eventName\[, ...args\])
<add><!-- YAML
<add>added: REPLACEME
<add>-->
<add>
<add>> Stability: 1 - captureRejections is experimental.
<add>
<add>* `err` Error
<add>* `eventName` {string|symbol}
<add>* `...args` {any}
<add>
<add>The `Symbol.for('nodejs.rejection')` method is called in case a
<add>promise rejection happens when emitting an event and
<add>[`captureRejections`][capturerejections] is enabled on the emitter.
<add>It is possible to use [`events.captureRejectionSymbol`][rejectionsymbol] in
<add>place of `Symbol.for('nodejs.rejection')`.
<add>
<add>```js
<add>const { EventEmitter, captureRejectionSymbol } = require('events');
<add>
<add>class MyClass extends EventEmitter {
<add> constructor() {
<add> super({ captureRejections: true });
<add> }
<add>
<add> [captureRejectionSymbol](err, event, ...args) {
<add> console.log('rejection happened for', event, 'with', err, ...args);
<add> this.destroy(err);
<add> }
<add>
<add> destroy(err) {
<add> // Tear the resource down here.
<add> }
<add>}
<add>```
<add>
<ide> ## events.once(emitter, name)
<ide> <!-- YAML
<ide> added: v11.13.0
<ide> async function run() {
<ide> run();
<ide> ```
<ide>
<add>## events.captureRejections
<add><!-- YAML
<add>added: REPLACEME
<add>-->
<add>
<add>> Stability: 1 - captureRejections is experimental.
<add>
<add>Value: {boolean}
<add>
<add>Change the default `captureRejections` option on all new `EventEmitter` objects.
<add>
<add>## events.captureRejectionSymbol
<add><!-- YAML
<add>added: REPLACEME
<add>-->
<add>
<add>> Stability: 1 - captureRejections is experimental.
<add>
<add>Value: `Symbol.for('nodejs.rejection')`
<add>
<add>See how to write a custom [rejection handler][rejection].
<add>
<ide> [WHATWG-EventTarget]: https://dom.spec.whatwg.org/#interface-eventtarget
<ide> [`--trace-warnings`]: cli.html#cli_trace_warnings
<ide> [`EventEmitter.defaultMaxListeners`]: #events_eventemitter_defaultmaxlisteners
<ide> run();
<ide> [`net.Server`]: net.html#net_class_net_server
<ide> [`process.on('warning')`]: process.html#process_event_warning
<ide> [stream]: stream.html
<add>[capturerejections]: #events_capture_rejections_of_promises
<add>[rejection]: #events_emitter_symbol_for_nodejs_rejection_err_eventname_args
<add>[rejectionsymbol]: #events_events_capturerejectionsymbol
<add>[error]: #events_error_events
<ide><path>lib/events.js
<ide>
<ide> const {
<ide> Array,
<add> Boolean,
<ide> MathMin,
<ide> NumberIsNaN,
<ide> ObjectCreate,
<ide> const {
<ide> ReflectApply,
<ide> ReflectOwnKeys,
<ide> } = primordials;
<add>const kRejection = Symbol.for('nodejs.rejection');
<ide>
<ide> let spliceOne;
<ide>
<ide> const {
<ide> inspect
<ide> } = require('internal/util/inspect');
<ide>
<del>function EventEmitter() {
<del> EventEmitter.init.call(this);
<add>const kCapture = Symbol('kCapture');
<add>
<add>function EventEmitter(opts) {
<add> EventEmitter.init.call(this, opts);
<ide> }
<ide> module.exports = EventEmitter;
<ide> module.exports.once = once;
<ide> EventEmitter.EventEmitter = EventEmitter;
<ide>
<ide> EventEmitter.usingDomains = false;
<ide>
<add>EventEmitter.captureRejectionSymbol = kRejection;
<add>ObjectDefineProperty(EventEmitter, 'captureRejections', {
<add> get() {
<add> return EventEmitter.prototype[kCapture];
<add> },
<add> set(value) {
<add> if (typeof value !== 'boolean') {
<add> throw new ERR_INVALID_ARG_TYPE('EventEmitter.captureRejections',
<add> 'boolean', value);
<add> }
<add>
<add> EventEmitter.prototype[kCapture] = value;
<add> },
<add> enumerable: true
<add>});
<add>
<add>// The default for captureRejections is false
<add>ObjectDefineProperty(EventEmitter.prototype, kCapture, {
<add> value: false,
<add> writable: true,
<add> enumerable: false
<add>});
<add>
<ide> EventEmitter.prototype._events = undefined;
<ide> EventEmitter.prototype._eventsCount = 0;
<ide> EventEmitter.prototype._maxListeners = undefined;
<ide> ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
<ide> }
<ide> });
<ide>
<del>EventEmitter.init = function() {
<add>EventEmitter.init = function(opts) {
<ide>
<ide> if (this._events === undefined ||
<ide> this._events === ObjectGetPrototypeOf(this)._events) {
<ide> EventEmitter.init = function() {
<ide> }
<ide>
<ide> this._maxListeners = this._maxListeners || undefined;
<add>
<add>
<add> if (opts && opts.captureRejections) {
<add> if (typeof opts.captureRejections !== 'boolean') {
<add> throw new ERR_INVALID_ARG_TYPE('options.captureRejections',
<add> 'boolean', opts.captureRejections);
<add> }
<add> this[kCapture] = Boolean(opts.captureRejections);
<add> } else {
<add> // Assigning it directly a prototype lookup, as it slighly expensive
<add> // and it sits in a very sensitive hot path.
<add> this[kCapture] = EventEmitter.prototype[kCapture];
<add> }
<ide> };
<ide>
<add>function addCatch(that, promise, type, args) {
<add> if (!that[kCapture]) {
<add> return;
<add> }
<add>
<add> // Handle Promises/A+ spec, then could be a getter
<add> // that throws on second use.
<add> try {
<add> const then = promise.then;
<add>
<add> if (typeof then === 'function') {
<add> then.call(promise, undefined, function(err) {
<add> // The callback is called with nextTick to avoid a follow-up
<add> // rejection from this promise.
<add> process.nextTick(emitUnhandledRejectionOrErr, that, err, type, args);
<add> });
<add> }
<add> } catch (err) {
<add> that.emit('error', err);
<add> }
<add>}
<add>
<add>function emitUnhandledRejectionOrErr(ee, err, type, args) {
<add> if (typeof ee[kRejection] === 'function') {
<add> ee[kRejection](err, type, ...args);
<add> } else {
<add> // We have to disable the capture rejections mechanism, otherwise
<add> // we might end up in an infinite loop.
<add> const prev = ee[kCapture];
<add>
<add> // If the error handler throws, it is not catcheable and it
<add> // will end up in 'uncaughtException'. We restore the previous
<add> // value of kCapture in case the uncaughtException is present
<add> // and the exception is handled.
<add> try {
<add> ee[kCapture] = false;
<add> ee.emit('error', err);
<add> } finally {
<add> ee[kCapture] = prev;
<add> }
<add> }
<add>}
<add>
<ide> // Obviously not all Emitters should be limited to 10. This function allows
<ide> // that to be increased. Set to zero for unlimited.
<ide> EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
<ide> EventEmitter.prototype.emit = function emit(type, ...args) {
<ide> return false;
<ide>
<ide> if (typeof handler === 'function') {
<del> ReflectApply(handler, this, args);
<add> const result = ReflectApply(handler, this, args);
<add>
<add> // We check if result is undefined first because that
<add> // is the most common case so we do not pay any perf
<add> // penalty
<add> if (result !== undefined && result !== null) {
<add> addCatch(this, result, type, args);
<add> }
<ide> } else {
<ide> const len = handler.length;
<ide> const listeners = arrayClone(handler, len);
<del> for (let i = 0; i < len; ++i)
<del> ReflectApply(listeners[i], this, args);
<add> for (var i = 0; i < len; ++i) {
<add> const result = ReflectApply(listeners[i], this, args);
<add>
<add> // We check if result is undefined first because that
<add> // is the most common case so we do not pay any perf
<add> // penalty.
<add> // This code is duplicated because extracting it away
<add> // would make it non-inlineable.
<add> if (result !== undefined && result !== null) {
<add> addCatch(this, result, type, args);
<add> }
<add> }
<ide> }
<ide>
<ide> return true;
<ide><path>test/parallel/test-event-capture-rejections.js
<add>'use strict';
<add>const common = require('../common');
<add>const assert = require('assert');
<add>const { EventEmitter, captureRejectionSymbol } = require('events');
<add>const { inherits } = require('util');
<add>
<add>// Inherits from EE without a call to the
<add>// parent constructor.
<add>function NoConstructor() {
<add>}
<add>
<add>inherits(NoConstructor, EventEmitter);
<add>
<add>function captureRejections() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add> process.nextTick(captureRejectionsTwoHandlers);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function captureRejectionsTwoHandlers() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err = new Error('kaboom');
<add>
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> // throw twice
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> let count = 0;
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add> if (++count === 2) {
<add> process.nextTick(defaultValue);
<add> }
<add> }, 2));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function defaultValue() {
<add> const ee = new EventEmitter();
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> process.removeAllListeners('unhandledRejection');
<add>
<add> process.once('unhandledRejection', common.mustCall((err) => {
<add> // restore default
<add> process.on('unhandledRejection', (err) => { throw err; });
<add>
<add> assert.strictEqual(err, _err);
<add> process.nextTick(globalSetting);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function globalSetting() {
<add> assert.strictEqual(EventEmitter.captureRejections, false);
<add> EventEmitter.captureRejections = true;
<add> const ee = new EventEmitter();
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add>
<add> // restore default
<add> EventEmitter.captureRejections = false;
<add> process.nextTick(configurable);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>// We need to be able to configure this for streams, as we would
<add>// like to call destro(err) there.
<add>function configurable() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall(async (...args) => {
<add> assert.deepStrictEqual(args, [42, 'foobar']);
<add> throw _err;
<add> }));
<add>
<add> assert.strictEqual(captureRejectionSymbol, Symbol.for('nodejs.rejection'));
<add>
<add> ee[captureRejectionSymbol] = common.mustCall((err, type, ...args) => {
<add> assert.strictEqual(err, _err);
<add> assert.strictEqual(type, 'something');
<add> assert.deepStrictEqual(args, [42, 'foobar']);
<add> process.nextTick(globalSettingNoConstructor);
<add> });
<add>
<add> ee.emit('something', 42, 'foobar');
<add>}
<add>
<add>function globalSettingNoConstructor() {
<add> assert.strictEqual(EventEmitter.captureRejections, false);
<add> EventEmitter.captureRejections = true;
<add> const ee = new NoConstructor();
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add>
<add> // restore default
<add> EventEmitter.captureRejections = false;
<add> process.nextTick(thenable);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function thenable() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall((value) => {
<add> const obj = {};
<add>
<add> Object.defineProperty(obj, 'then', {
<add> get: common.mustCall(() => {
<add> return common.mustCall((resolved, rejected) => {
<add> assert.strictEqual(resolved, undefined);
<add> rejected(_err);
<add> });
<add> }, 1) // Only 1 call for Promises/A+ compat.
<add> });
<add>
<add> return obj;
<add> }));
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add> process.nextTick(avoidLoopOnRejection);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function avoidLoopOnRejection() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err1 = new Error('kaboom');
<add> const _err2 = new Error('kaboom2');
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err1;
<add> }));
<add>
<add> ee[captureRejectionSymbol] = common.mustCall(async (err) => {
<add> assert.strictEqual(err, _err1);
<add> throw _err2;
<add> });
<add>
<add> process.removeAllListeners('unhandledRejection');
<add>
<add> process.once('unhandledRejection', common.mustCall((err) => {
<add> // restore default
<add> process.on('unhandledRejection', (err) => { throw err; });
<add>
<add> assert.strictEqual(err, _err2);
<add> process.nextTick(avoidLoopOnError);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function avoidLoopOnError() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err1 = new Error('kaboom');
<add> const _err2 = new Error('kaboom2');
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw _err1;
<add> }));
<add>
<add> ee.on('error', common.mustCall(async (err) => {
<add> assert.strictEqual(err, _err1);
<add> throw _err2;
<add> }));
<add>
<add> process.removeAllListeners('unhandledRejection');
<add>
<add> process.once('unhandledRejection', common.mustCall((err) => {
<add> // restore default
<add> process.on('unhandledRejection', (err) => { throw err; });
<add>
<add> assert.strictEqual(err, _err2);
<add> process.nextTick(thenableThatThrows);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function thenableThatThrows() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> const _err = new Error('kaboom');
<add> ee.on('something', common.mustCall((value) => {
<add> const obj = {};
<add>
<add> Object.defineProperty(obj, 'then', {
<add> get: common.mustCall(() => {
<add> throw _err;
<add> }, 1) // Only 1 call for Promises/A+ compat.
<add> });
<add>
<add> return obj;
<add> }));
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add> process.nextTick(resetCaptureOnThrowInError);
<add> }));
<add>
<add> ee.emit('something');
<add>}
<add>
<add>function resetCaptureOnThrowInError() {
<add> const ee = new EventEmitter({ captureRejections: true });
<add> ee.on('something', common.mustCall(async (value) => {
<add> throw new Error('kaboom');
<add> }));
<add>
<add> ee.once('error', common.mustCall((err) => {
<add> throw err;
<add> }));
<add>
<add> process.removeAllListeners('uncaughtException');
<add>
<add> process.once('uncaughtException', common.mustCall((err) => {
<add> process.nextTick(next);
<add> }));
<add>
<add> ee.emit('something');
<add>
<add> function next() {
<add> process.on('uncaughtException', common.mustNotCall());
<add>
<add> const _err = new Error('kaboom2');
<add> ee.on('something2', common.mustCall(async (value) => {
<add> throw _err;
<add> }));
<add>
<add> ee.on('error', common.mustCall((err) => {
<add> assert.strictEqual(err, _err);
<add>
<add> process.removeAllListeners('uncaughtException');
<add>
<add> // restore default
<add> process.on('uncaughtException', (err) => { throw err; });
<add>
<add> process.nextTick(argValidation);
<add> }));
<add>
<add> ee.emit('something2');
<add> }
<add>}
<add>
<add>function argValidation() {
<add>
<add> function testType(obj) {
<add> common.expectsError(() => new EventEmitter({ captureRejections: obj }), {
<add> code: 'ERR_INVALID_ARG_TYPE',
<add> type: TypeError
<add> });
<add>
<add> common.expectsError(() => EventEmitter.captureRejections = obj, {
<add> code: 'ERR_INVALID_ARG_TYPE',
<add> type: TypeError
<add> });
<add> }
<add>
<add> testType([]);
<add> testType({ hello: 42 });
<add> testType(42);
<add>}
<add>
<add>captureRejections(); | 3 |
Python | Python | increase verbosity so we see which tests run | 7bfc0970f7e927b54a216bc82e2a56aee43b3e5b | <ide><path>integration/storage/__main__.py
<ide> if __name__ == '__main__':
<ide> loader = unittest.TestLoader()
<ide> tests = loader.discover(os.path.dirname(__file__))
<del> runner = unittest.runner.TextTestRunner()
<add> runner = unittest.runner.TextTestRunner(verbosity=3)
<ide> result = runner.run(tests)
<ide> sys.exit(len(result.errors)) | 1 |
Javascript | Javascript | replace var with let/const | f393d668817ce694466d91e8c5074fc0e123e06a | <ide><path>lib/events.js
<ide> EventEmitter.prototype.emit = function emit(type, ...args) {
<ide> } else {
<ide> const len = handler.length;
<ide> const listeners = arrayClone(handler, len);
<del> for (var i = 0; i < len; ++i) {
<add> for (let i = 0; i < len; ++i) {
<ide> const result = ReflectApply(listeners[i], this, args);
<ide>
<ide> // We check if result is undefined first because that | 1 |
Go | Go | improve jsonfilelog read benchmark | 961d32868c79d4542d1a2d892344c0ac636166e8 | <ide><path>daemon/logger/jsonfilelog/read_test.go
<ide> import (
<ide> "bytes"
<ide> "encoding/json"
<ide> "io"
<add> "path/filepath"
<ide> "testing"
<ide> "time"
<ide>
<ide> "github.com/docker/docker/daemon/logger"
<ide> "gotest.tools/v3/assert"
<del> "gotest.tools/v3/fs"
<ide> )
<ide>
<ide> func BenchmarkJSONFileLoggerReadLogs(b *testing.B) {
<del> tmp := fs.NewDir(b, "bench-jsonfilelog")
<del> defer tmp.Remove()
<add> tmp := b.TempDir()
<ide>
<ide> jsonlogger, err := New(logger.Info{
<ide> ContainerID: "a7317399f3f857173c6179d44823594f8294678dea9999662e5c625b5a1c7657",
<del> LogPath: tmp.Join("container.log"),
<add> LogPath: filepath.Join(tmp, "container.log"),
<ide> Config: map[string]string{
<ide> "labels": "first,second",
<ide> },
<ide> func BenchmarkJSONFileLoggerReadLogs(b *testing.B) {
<ide> assert.NilError(b, err)
<ide> defer jsonlogger.Close()
<ide>
<del> msg := &logger.Message{
<del> Line: []byte("Line that thinks that it is log line from docker\n"),
<del> Source: "stderr",
<del> Timestamp: time.Now().UTC(),
<add> const line = "Line that thinks that it is log line from docker\n"
<add> ts := time.Date(2007, 1, 2, 3, 4, 5, 6, time.UTC)
<add> msg := func() *logger.Message {
<add> m := logger.NewMessage()
<add> m.Line = append(m.Line, line...)
<add> m.Source = "stderr"
<add> m.Timestamp = ts
<add> return m
<ide> }
<ide>
<del> buf := bytes.NewBuffer(nil)
<del> assert.NilError(b, marshalMessage(msg, nil, buf))
<add> var buf bytes.Buffer
<add> assert.NilError(b, marshalMessage(msg(), nil, &buf))
<ide> b.SetBytes(int64(buf.Len()))
<ide>
<ide> b.ResetTimer()
<ide>
<del> chError := make(chan error, b.N+1)
<add> chError := make(chan error)
<ide> go func() {
<ide> for i := 0; i < b.N; i++ {
<del> chError <- jsonlogger.Log(msg)
<add> if err := jsonlogger.Log(msg()); err != nil {
<add> chError <- err
<add> }
<add> }
<add> if err := jsonlogger.Close(); err != nil {
<add> chError <- err
<ide> }
<del> chError <- jsonlogger.Close()
<ide> }()
<ide>
<ide> lw := jsonlogger.(*JSONFileLogger).ReadLogs(logger.ReadConfig{Follow: true})
<ide> func BenchmarkJSONFileLoggerReadLogs(b *testing.B) {
<ide> case <-lw.WatchProducerGone():
<ide> return
<ide> case err := <-chError:
<del> if err != nil {
<del> b.Fatal(err)
<del> }
<add> b.Fatal(err)
<ide> }
<ide> }
<ide> } | 1 |
Text | Text | reset `caching_with_rails.md` file | b2e9c4c4095e6735f6c5e5299c1ff12e9c88d935 | <ide><path>guides/source/caching_with_rails.md
<ide> A more complex, production Redis cache store may look something like this:
<ide> cache_servers = %w(redis://cache-01:6379/0 redis://cache-02:6379/0)
<ide> config.cache_store = :redis_cache_store, { url: cache_servers,
<ide>
<del> connect_timeout: 30, # Defaults to 20 seconds
<del> read_timeout: 0.2, # Defaults to 1 second
<del> write_timeout: 0.2, # Defaults to 1 second
<del> reconnect_attempts: 1, # Defaults to 0
<del>
<del> error_handler: -> (method:, returning:, exception:) {
<del> # Report errors to Sentry as warnings
<del> Raven.capture_exception exception, level: 'warning',
<del> tags: { method: method, returning: returning }
<del> }
<add> connect_timeout: 30, # Defaults to 20 seconds
<add> read_timeout: 0.2, # Defaults to 1 second
<add> write_timeout: 0.2, # Defaults to 1 second
<add> reconnect_attempts: 1, # Defaults to 0
<add>
<add> error_handler: -> (method:, returning:, exception:) {
<add> # Report errors to Sentry as warnings
<add> Raven.capture_exception exception, level: 'warning',
<add> tags: { method: method, returning: returning }
<add> }
<ide> }
<ide> ```
<ide>
<ide> References
<ide>
<ide> * [DHH's article on key-based expiration](https://signalvnoise.com/posts/3113-how-key-based-cache-expiration-works)
<ide> * [Ryan Bates' Railscast on cache digests](http://railscasts.com/episodes/387-cache-digests)
<add> | 1 |
PHP | PHP | fix context/plural related issues in i18n | 0c4ae66fe0401f502115da8c1b3f25ff9b4dbd91 | <ide><path>src/I18n/Formatter/IcuFormatter.php
<ide> public function format($locale, $message, array $vars)
<ide> return $this->_formatMessage($locale, $message, $vars);
<ide> }
<ide>
<del> if (isset($vars['_context'], $message['_context'])) {
<del> $message = $message['_context'][$vars['_context']];
<del> unset($vars['_context']);
<del> }
<del>
<del> // Assume first context when no context key was passed
<del> if (isset($message['_context'])) {
<del> $message = current($message['_context']);
<del> }
<del>
<ide> if (!is_string($message)) {
<ide> $count = isset($vars['_count']) ? $vars['_count'] : 0;
<ide> unset($vars['_count'], $vars['_singular']);
<ide><path>src/I18n/I18n.php
<ide>
<ide> use Aura\Intl\FormatterLocator;
<ide> use Aura\Intl\PackageLocator;
<del>use Aura\Intl\TranslatorFactory;
<ide> use Cake\Cache\Cache;
<ide> use Cake\I18n\Formatter\IcuFormatter;
<ide> use Cake\I18n\Formatter\SprintfFormatter;
<add>use Cake\I18n\TranslatorFactory;
<ide> use Locale;
<ide>
<ide> /**
<ide><path>src/I18n/Translator.php
<add><?php
<add>/**
<add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
<add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<add> *
<add> * Licensed under The MIT License
<add> * For full copyright and license information, please see the LICENSE.txt
<add> * Redistributions of files must retain the above copyright notice
<add> *
<add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<add> * @link http://cakephp.org CakePHP(tm) Project
<add> *
<add> * This file contains sections from the Aura Project
<add> * @license https://github.com/auraphp/Aura.Intl/blob/3.x/LICENSE
<add> *
<add> * The Aura Project for PHP.
<add> *
<add> * @package Aura.Intl
<add> * @license http://opensource.org/licenses/bsd-license.php BSD
<add> */
<add>namespace Cake\I18n;
<add>
<add>use Aura\Intl\TranslatorInterface;
<add>use Aura\Intl\FormatterInterface;
<add>
<add>/**
<add> * Provides missing message behavior for CakePHP internal message formats.
<add> *
<add> * @internal
<add> */
<add>class Translator implements TranslatorInterface
<add>{
<add> /**
<add> * A fallback translator.
<add> *
<add> * @var \Aura\Intl\TranslatorInterface
<add> */
<add> protected $fallback;
<add>
<add> /**
<add> * The formatter to use when translating messages.
<add> *
<add> * @var \Aura\Intl\FormatterInterface
<add> */
<add> protected $formatter;
<add>
<add> /**
<add> * The locale being used for translations.
<add> *
<add> * @var string
<add> */
<add> protected $locale;
<add>
<add> /**
<add> * The message keys and translations.
<add> *
<add> * @var array
<add> */
<add> protected $messages = [];
<add>
<add> /**
<add> * Constructor
<add> *
<add> * @param string $locale The locale being used.
<add> * @param array $messages The message keys and translations.
<add> * @param \Aura\Intl\FormatterInterface $formatter A message formatter.
<add> * @param \Aura\Intl\TranslatorInterface $fallback A fallback translator.
<add> */
<add> public function __construct(
<add> $locale,
<add> array $messages,
<add> FormatterInterface $formatter,
<add> TranslatorInterface $fallback = null
<add> ) {
<add> $this->locale = $locale;
<add> $this->messages = $messages;
<add> $this->formatter = $formatter;
<add> $this->fallback = $fallback;
<add> }
<add>
<add> /**
<add> * Gets the message translation by its key.
<add> *
<add> * @param string $key The message key.
<add> * @return mixed The message translation string, or false if not found.
<add> */
<add> protected function getMessage($key)
<add> {
<add> if (isset($this->messages[$key])) {
<add> return $this->messages[$key];
<add> }
<add>
<add> if ($this->fallback) {
<add> // get the message from the fallback translator
<add> $message = $this->fallback->getMessage($key);
<add> // speed optimization: retain locally
<add> $this->messages[$key] = $message;
<add> // done!
<add> return $message;
<add> }
<add>
<add> // no local message, no fallback
<add> return false;
<add> }
<add>
<add> /**
<add> * Translates the message formatting any placeholders
<add> *
<add> *
<add> * @param string $key The message key.
<add> * @param array $tokensValues Token values to interpolate into the
<add> * message.
<add> * @return string The translated message with tokens replaced.
<add> */
<add> public function translate($key, array $tokensValues = [])
<add> {
<add> $message = $this->getMessage($key);
<add>
<add> if (!$message) {
<add> // Fallback to the message key
<add> $message = $key;
<add> }
<add>
<add> // Check for missing/invalid context
<add> if (isset($message['_context'])) {
<add> $context = isset($tokensValues['_context']) ? $tokensValues['_context'] : null;
<add> unset($tokensValues['_context']);
<add>
<add> // No or missing context, fallback to the key/first message
<add> if ($context === null) {
<add> $message = current($message['_context']);
<add> } elseif(!isset($message['_context'][$context])) {
<add> $message = $key;
<add> } elseif (!isset($message['_context'][$context])) {
<add> $message = $key;
<add> } else {
<add> $message = $message['_context'][$context];
<add> }
<add> }
<add>
<add> if (!$tokensValues) {
<add> // Fallback for plurals that were using the singular key
<add> if (is_array($message)) {
<add> return array_values($message + [''])[0];
<add> }
<add> return $message;
<add> }
<add>
<add> return $this->formatter->format($this->locale, $message, $tokensValues);
<add> }
<add>}
<ide><path>src/I18n/TranslatorFactory.php
<add><?php
<add>/**
<add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
<add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<add> *
<add> * Licensed under The MIT License
<add> * For full copyright and license information, please see the LICENSE.txt
<add> * Redistributions of files must retain the above copyright notice.
<add> *
<add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<add> * @link http://cakephp.org CakePHP(tm) Project
<add> * @since 3.3.12
<add> * @license http://www.opensource.org/licenses/mit-license.php MIT License
<add> */
<add>namespace Cake\I18n;
<add>
<add>use Aura\Intl\TranslatorFactory as BaseTranslatorFactory;
<add>
<add>use Aura\Intl\TranslatorInterface;
<add>use Aura\Intl\FormatterInterface;
<add>
<add>/**
<add> * Factory to create translators
<add> *
<add> * @internal
<add> */
<add>class TranslatorFactory extends BaseTranslatorFactory
<add>{
<add> /**
<add> * The class to use for new instances.
<add> *
<add> * @var string
<add> */
<add> protected $class = 'Cake\I18n\Translator';
<add>}
<ide><path>tests/TestCase/I18n/Formatter/IcuFormatterTest.php
<ide> public function testBadMessageFormat()
<ide> $formatter->format('en_US', '{crazy format', ['some', 'vars']);
<ide> }
<ide>
<del> /**
<del> * Tests that strings stored inside context namespaces can also be formatted
<del> *
<del> * @return void
<del> */
<del> public function testFormatWithContext()
<del> {
<del> $messages = [
<del> 'simple' => [
<del> '_context' => [
<del> 'context a' => 'Text "a" {0}',
<del> 'context b' => 'Text "b" {0}'
<del> ]
<del> ],
<del> 'complex' => [
<del> '_context' => [
<del> 'context b' => [
<del> 0 => 'Only one',
<del> 1 => 'there are {0}'
<del> ]
<del> ]
<del> ]
<del> ];
<del>
<del> $formatter = new IcuFormatter();
<del> $this->assertEquals(
<del> 'Text "a" is good',
<del> $formatter->format('en', $messages['simple'], ['_context' => 'context a', 'is good'])
<del> );
<del> $this->assertEquals(
<del> 'Text "b" is good',
<del> $formatter->format('en', $messages['simple'], ['_context' => 'context b', 'is good'])
<del> );
<del> $this->assertEquals(
<del> 'Text "a" is good',
<del> $formatter->format('en', $messages['simple'], ['is good'])
<del> );
<del>
<del> $this->assertEquals(
<del> 'Only one',
<del> $formatter->format('en', $messages['complex'], ['_context' => 'context b', '_count' => 1])
<del> );
<del>
<del> $this->assertEquals(
<del> 'there are 2',
<del> $formatter->format('en', $messages['complex'], ['_context' => 'context b', '_count' => 2, 2])
<del> );
<del> }
<del>
<ide> /**
<ide> * Tests that it is possible to provide a singular fallback when passing a string message.
<ide> * This is useful for getting quick feedback on the code during development instead of
<ide><path>tests/TestCase/I18n/I18nTest.php
<ide> public function tearDown()
<ide> public function testDefaultTranslator()
<ide> {
<ide> $translator = I18n::translator();
<del> $this->assertInstanceOf('Aura\Intl\Translator', $translator);
<add> $this->assertInstanceOf('Aura\Intl\TranslatorInterface', $translator);
<ide> $this->assertEquals('%d is 1 (po translated)', $translator->translate('%d = 1'));
<ide> }
<ide>
<ide> public function testBasicTranslateFunction()
<ide> $this->assertEquals('1 is 1 (po translated)', __('%d = 1', 1));
<ide> }
<ide>
<add> /**
<add> * Tests the __() function on a plural key
<add> *
<add> * @return void
<add> */
<add> public function testBasicTranslateFunctionPluralData()
<add> {
<add> I18n::defaultFormatter('sprintf');
<add> $this->assertEquals('%d is 1 (po translated)', __('%d = 0 or > 1'));
<add> }
<add>
<ide> /**
<ide> * Tests the __n() function
<ide> *
<ide> public function testBasicContextFunctionNoString()
<ide> $this->assertEquals('', __x('character', 'letter'));
<ide> }
<ide>
<add> /**
<add> * Tests the __x() function with an invalid context
<add> *
<add> * @return void
<add> */
<add> public function testBasicContextFunctionInvalidContext()
<add> {
<add> I18n::translator('default', 'en_US', function () {
<add> $package = new Package('default');
<add> $package->setMessages([
<add> 'letter' => [
<add> '_context' => [
<add> 'noun' => 'a paper letter',
<add> ]
<add> ]
<add> ]);
<add>
<add> return $package;
<add> });
<add>
<add> $this->assertEquals('letter', __x('garbage', 'letter'));
<add> $this->assertEquals('a paper letter', __('letter'));
<add> }
<add>
<ide> /**
<ide> * Tests the __xn() function
<ide> * | 6 |
Python | Python | set version to v3.0.0a35 | 1a500f9717bd92b2d376bde6aec387e3dfd92878 | <ide><path>spacy/about.py
<ide> # fmt: off
<ide> __title__ = "spacy-nightly"
<del>__version__ = "3.0.0a34"
<add>__version__ = "3.0.0a35"
<ide> __download_url__ = "https://github.com/explosion/spacy-models/releases/download"
<ide> __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
<ide> __projects__ = "https://github.com/explosion/projects" | 1 |
Javascript | Javascript | use getbrowserbodytext for hmr test | 6e4f0d8e700d95ac792f409a4a8c66ea4e74751e | <ide><path>test/integration/basic/test/hmr.js
<ide> import webdriver from 'next-webdriver'
<ide> import { readFileSync, writeFileSync, renameSync, existsSync } from 'fs'
<ide> import { join } from 'path'
<del>import { waitFor, check } from 'next-test-utils'
<add>import { waitFor, check, getBrowserBodyText } from 'next-test-utils'
<ide> import cheerio from 'cheerio'
<ide>
<ide> export default (context, renderViaHTTP) => {
<ide> export default (context, renderViaHTTP) => {
<ide> renameSync(contactPagePath, newContactPagePath)
<ide>
<ide> await check(
<del> () => browser.elementByCss('body').text(),
<add> () => getBrowserBodyText(browser),
<ide> /This page could not be found/
<ide> )
<ide>
<ide> export default (context, renderViaHTTP) => {
<ide>
<ide> // wait until the page comes back
<ide> await check(
<del> () => browser.elementByCss('body').text(),
<add> () => getBrowserBodyText(browser),
<ide> /This is the contact page/
<ide> )
<ide> } finally {
<ide> export default (context, renderViaHTTP) => {
<ide> writeFileSync(aboutPagePath, editedContent, 'utf8')
<ide>
<ide> await check(
<del> () => browser.elementByCss('body').text(),
<add> () => getBrowserBodyText(browser),
<ide> /COOL page/
<ide> )
<ide>
<ide> // add the original content
<ide> writeFileSync(aboutPagePath, originalContent, 'utf8')
<ide>
<ide> await check(
<del> () => browser.elementByCss('body').text(),
<add> () => getBrowserBodyText(browser),
<ide> /This is the about page/
<ide> )
<ide> } finally {
<ide><path>test/integration/export/test/browser.js
<ide> /* global describe, it, expect */
<ide> import webdriver from 'next-webdriver'
<del>import { check } from 'next-test-utils'
<add>import { check, getBrowserBodyText } from 'next-test-utils'
<ide>
<ide> export default function (context) {
<ide> describe('Render via browser', () => {
<ide> export default function (context) {
<ide> describe('pages in the nested level: level1', () => {
<ide> it('should render the home page', async () => {
<ide> const browser = await webdriver(context.port, '/')
<del> const text = await browser
<del> .elementByCss('#level1-home-page').click()
<del> .waitForElementByCss('#level1-home-page')
<del> .elementByCss('#level1-home-page p').text()
<ide>
<del> expect(text).toBe('This is the Level1 home page')
<add> await browser.eval('document.getElementById("level1-home-page").click()')
<add>
<add> await check(() => getBrowserBodyText(browser), /This is the Level1 home page/)
<add>
<ide> browser.close()
<ide> })
<ide>
<ide> it('should render the about page', async () => {
<ide> const browser = await webdriver(context.port, '/')
<del> const text = await browser
<del> .elementByCss('#level1-about-page').click()
<del> .waitForElementByCss('#level1-about-page')
<del> .elementByCss('#level1-about-page p').text()
<ide>
<del> expect(text).toBe('This is the Level1 about page')
<add> await browser.eval('document.getElementById("level1-about-page").click()')
<add>
<add> await check(() => getBrowserBodyText(browser), /This is the Level1 about page/)
<add>
<ide> browser.close()
<ide> })
<ide> })
<ide><path>test/integration/export/test/dev.js
<ide> /* global describe, it, expect */
<ide> import webdriver from 'next-webdriver'
<del>import { renderViaHTTP } from 'next-test-utils'
<add>import { renderViaHTTP, getBrowserBodyText, check } from 'next-test-utils'
<ide> import cheerio from 'cheerio'
<ide>
<ide> const loadJSONInPage = pageContent => {
<ide> export default function (context) {
<ide> describe('Render in development mode', () => {
<ide> it('should render the home page', async () => {
<ide> const browser = await webdriver(context.port, '/')
<del> const text = await browser
<del> .elementByCss('#home-page p').text()
<ide>
<del> expect(text).toBe('This is the home page')
<del> browser.close()
<add> await check(() => getBrowserBodyText(browser), /This is the home page/)
<ide> })
<ide>
<ide> it('should render pages only existent in exportPathMap page', async () => { | 3 |
Python | Python | pass image object to node constructor | 5da76d6fe9a230a71c1b185bc41ba4aa8d5a890d | <ide><path>libcloud/container/drivers/kubernetes.py
<ide> def _to_node(self, data):
<ide> cpu = data["status"].get("capacity", {}).get("cpu", 1)
<ide> if not isinstance(cpu, int):
<ide> cpu = int(cpu.rstrip("m"))
<del> extra_size = {"cpus": cpu}
<add> # TODO: Find image
<add> image_name = "undefined"
<add> image = NodeImage(image_name, image_name, driver)
<ide> size_name = f"{cpu} vCPUs, {memory}MB Ram"
<ide> size_id = hashlib.md5(size_name.encode("utf-8")).hexdigest()
<add> extra_size = {"cpus": cpu}
<ide> size = NodeSize(
<ide> id=size_id,
<ide> name=size_name,
<ide> def _to_node(self, data):
<ide> public_ips=public_ips,
<ide> private_ips=private_ips,
<ide> driver=driver,
<add> image=image,
<ide> size=size,
<ide> extra=extra,
<ide> created_at=created_at, | 1 |
Javascript | Javascript | escape double quotes in error displays | 1429a71474a3b70a16cba0b82bf23c4f73b63efc | <ide><path>docs/src/ngdoc.js
<ide> Doc.prototype = {
<ide> minerrMsg = lookupMinerrMsg(self);
<ide> dom.tag('pre', {
<ide> class:'minerr-errmsg',
<del> 'error-display': minerrMsg
<add> 'error-display': minerrMsg.replace(/"/g, '"')
<ide> }, minerrMsg);
<ide> }
<ide> if (self.ngdoc != 'overview') { | 1 |
Javascript | Javascript | update emberarray invoke docs to use native class | fe400156e6ece41739e6dfbb6992fd35b3179a1d | <ide><path>packages/@ember/-internals/runtime/lib/mixins/array.js
<ide> const ArrayMixin = Mixin.create(Enumerable, {
<ide> Prototype 1.6.
<ide>
<ide> ```javascript
<del> const Person = EmberObject.extend({
<del> name: null,
<add> class Person {
<add> name = null;
<add>
<add> constructor(name) {
<add> this.name = name;
<add> }
<add>
<ide> greet(prefix='Hello') {
<ide> return `${prefix} ${this.name}`;
<del> },
<del>
<del> });
<del> let people = [Person.create('Joe'), Person.create('Matt')];
<add> }
<add> }
<add>
<add> let people = [new Person('Joe'), new Person('Matt')];
<ide>
<ide> people.invoke('greet'); // ['Hello Joe', 'Hello Matt']
<ide> people.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt'] | 1 |
Python | Python | fix normalization tests | c98633cd7c0922800bc63656a2d899aa768362e7 | <ide><path>tests/keras/layers/test_normalization.py
<ide> def test_batchnorm_shapes():
<ide> Test batch normalization with various input shapes
<ide> """
<ide> for inp in input_shapes:
<del> norm_m0 = normalization.BatchNormalization(input_shape=inp.shape, mode=0)
<add> norm_m0 = normalization.BatchNormalization(batch_input_shape=inp.shape, mode=0)
<ide> norm_m0.input = K.variable(inp)
<del> out = (norm_m0.get_output(train=True) - norm_m0.beta) / norm_m0.gamma
<add> out = norm_m0.get_output(train=True)
<add> K.eval(out)
<ide>
<del> norm_m1 = normalization.BatchNormalization(input_shape=inp.shape, mode=1)
<add> norm_m1 = normalization.BatchNormalization(batch_input_shape=inp.shape, mode=1)
<ide> norm_m1.input = K.variable(inp)
<del> out = (norm_m1.get_output(train=True) - norm_m1.beta) / norm_m1.gamma
<add> out = norm_m1.get_output(train=True)
<add> K.eval(out)
<ide>
<ide>
<ide> def test_batchnorm_weight_init(): | 1 |
Javascript | Javascript | accept relative --transformer paths everywhere | 588f01e9982775f0699c7bfd56623d4ed3949810 | <ide><path>local-cli/bundle/buildBundle.js
<ide>
<ide> const log = require('../util/log').out('bundle');
<ide> const outputBundle = require('./output/bundle');
<add>const path = require('path');
<ide> const Promise = require('promise');
<ide> const saveAssets = require('./saveAssets');
<ide> const Server = require('../../packager/react-packager/src/Server');
<ide> function buildBundle(args, config, output = outputBundle, packagerInstance) {
<ide> assetRoots: config.getAssetRoots(),
<ide> blacklistRE: config.getBlacklistRE(args.platform),
<ide> getTransformOptionsModulePath: config.getTransformOptionsModulePath,
<del> transformModulePath: args.transformer,
<add> transformModulePath: path.resolve(args.transformer),
<ide> extraNodeModules: config.extraNodeModules,
<ide> nonPersistent: true,
<ide> resetCache: args['reset-cache'],
<ide><path>local-cli/bundle/bundleCommandLineArgs.js
<ide> module.exports = [
<ide> type: 'string',
<ide> }, {
<ide> command: 'transformer',
<del> description: 'Specify a custom transformer to be used (absolute path)',
<add> description: 'Specify a custom transformer to be used',
<ide> type: 'string',
<ide> default: require.resolve('../../packager/transformer'),
<ide> }, {
<ide><path>local-cli/dependencies/dependencies.js
<ide> function _dependencies(argv, config, resolve, reject, packagerInstance) {
<ide> command: 'transformer',
<ide> type: 'string',
<ide> default: require.resolve('../../packager/transformer'),
<del> description: 'Specify a custom transformer to be used (absolute path)'
<add> description: 'Specify a custom transformer to be used'
<ide> }, {
<ide> command: 'verbose',
<ide> description: 'Enables logging',
<ide> function _dependencies(argv, config, resolve, reject, packagerInstance) {
<ide> assetRoots: config.getAssetRoots(),
<ide> blacklistRE: config.getBlacklistRE(args.platform),
<ide> getTransformOptionsModulePath: config.getTransformOptionsModulePath,
<del> transformModulePath: args.transformer,
<add> transformModulePath: path.resolve(args.transformer),
<ide> extraNodeModules: config.extraNodeModules,
<ide> verbose: config.verbose,
<ide> };
<ide><path>local-cli/server/runServer.js
<ide> const connect = require('connect');
<ide> const cpuProfilerMiddleware = require('./middleware/cpuProfilerMiddleware');
<ide> const getDevToolsMiddleware = require('./middleware/getDevToolsMiddleware');
<ide> const http = require('http');
<del>const isAbsolutePath = require('absolute-path');
<ide> const loadRawBodyMiddleware = require('./middleware/loadRawBodyMiddleware');
<ide> const messageSocket = require('./util/messageSocket.js');
<ide> const openStackFrameInEditorMiddleware = require('./middleware/openStackFrameInEditorMiddleware');
<ide> function runServer(args, config, readyCallback) {
<ide> }
<ide>
<ide> function getPackagerServer(args, config) {
<del> let transformerPath = args.transformer;
<del> if (!isAbsolutePath(transformerPath)) {
<del> transformerPath = path.resolve(process.cwd(), transformerPath);
<del> }
<del>
<ide> return ReactPackager.createServer({
<ide> nonPersistent: args.nonPersistent,
<ide> projectRoots: args.projectRoots,
<ide> blacklistRE: config.getBlacklistRE(),
<ide> cacheVersion: '3',
<ide> getTransformOptionsModulePath: config.getTransformOptionsModulePath,
<del> transformModulePath: transformerPath,
<add> transformModulePath: path.resolve(args.transformer),
<ide> extraNodeModules: config.extraNodeModules,
<ide> assetRoots: args.assetRoots,
<ide> assetExts: [
<ide><path>local-cli/server/server.js
<ide> function _server(argv, config, resolve, reject) {
<ide> command: 'transformer',
<ide> type: 'string',
<ide> default: require.resolve('../../packager/transformer'),
<del> description: 'Specify a custom transformer to be used (absolute path)'
<add> description: 'Specify a custom transformer to be used'
<ide> }, {
<ide> command: 'resetCache',
<ide> description: 'Removes cached files', | 5 |
Javascript | Javascript | use a callback ref in the real world example | c18266e1f7ef876adca194637da046e87c45a7c1 | <ide><path>examples/real-world/src/components/Explore.js
<ide> export default class Explore extends Component {
<ide> }
<ide>
<ide> getInputValue = () => {
<del> return this.refs.input.value
<add> return this.input.value
<ide> }
<ide>
<ide> setInputValue = (val) => {
<ide> // Generally mutating DOM is a bad idea in React components,
<ide> // but doing this for a single uncontrolled field is less fuss
<ide> // than making it controlled and maintaining a state for it.
<del> this.refs.input.value = val
<add> this.input.value = val
<ide> }
<ide>
<ide> handleKeyUp = (e) => {
<ide> export default class Explore extends Component {
<ide> <div>
<ide> <p>Type a username or repo full name and hit 'Go':</p>
<ide> <input size="45"
<del> ref="input"
<add> ref={(input) => this.input = input}
<ide> defaultValue={this.props.value}
<ide> onKeyUp={this.handleKeyUp} />
<ide> <button onClick={this.handleGoClick}> | 1 |
PHP | PHP | use end to get last element of array | 42765659c16f5327c1d5c826b82b71a3c3cef4ee | <ide><path>src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php
<ide> public function getForeignKeyName()
<ide> {
<ide> $segments = explode('.', $this->getQualifiedForeignKeyName());
<ide>
<del> return $segments[count($segments) - 1];
<add> return end($segments);
<ide> }
<ide>
<ide> /** | 1 |
Javascript | Javascript | remove default callback context | 76084372c29a59b3fa790ea4d2687f0767514999 | <ide><path>build/tasks/build.js
<ide> module.exports = function( grunt ) {
<ide> baseUrl: "src",
<ide> name: "jquery",
<ide>
<add> // Allow strict mode
<add> useStrict: true,
<add>
<ide> // We have multiple minify steps
<ide> optimize: "none",
<ide>
<ide><path>src/deferred.js
<ide> define( [
<ide> "./callbacks"
<ide> ], function( jQuery, slice ) {
<ide>
<add>"use strict";
<add>
<ide> function Identity( v ) {
<ide> return v;
<ide> }
<ide> jQuery.extend( {
<ide> .fail( newDefer.reject );
<ide> } else {
<ide> newDefer[ tuple[ 0 ] + "With" ](
<del> this === promise ? newDefer.promise() : this,
<add> this,
<ide> fn ? [ returned ] : arguments
<ide> );
<ide> }
<ide> jQuery.extend( {
<ide> var maxDepth = 0;
<ide> function resolve( depth, deferred, handler, special ) {
<ide> return function() {
<del> var that = this === promise ? undefined : this,
<add> var that = this,
<ide> args = arguments,
<ide> mightThrow = function() {
<ide> var returned, then;
<ide> jQuery.extend( {
<ide>
<ide> // Process the value(s)
<ide> // Default process is resolve
<del> ( special || deferred.resolveWith )(
<del> that || deferred.promise(), args );
<add> ( special || deferred.resolveWith )( that, args );
<ide> }
<ide> },
<ide>
<ide> jQuery.extend( {
<ide> args = [ e ];
<ide> }
<ide>
<del> deferred.rejectWith( that || deferred.promise(),
<del> args );
<add> deferred.rejectWith( that, args );
<ide> }
<ide> }
<ide> };
<ide> jQuery.extend( {
<ide> // deferred.resolve = function() { deferred.resolveWith(...) }
<ide> // deferred.reject = function() { deferred.rejectWith(...) }
<ide> deferred[ tuple[ 0 ] ] = function() {
<del> deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
<add> deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
<ide> return this;
<ide> };
<ide>
<ide><path>src/wrapper.js
<ide> // Pass this if window is not defined yet
<ide> }( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
<ide>
<del>// Support: Firefox 18+
<del>// Can't be in strict mode, several libs including ASP.NET trace
<del>// the stack via arguments.caller.callee and Firefox dies if
<del>// you try to trace through "use strict" call chains. (#13335)
<del>//"use strict";
<add>// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
<add>// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
<add>// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
<add>// enough that all such attempts are guarded in a try block.
<add>"use strict";
<ide>
<ide> // @CODE
<ide> // build.js inserts compiled jQuery here
<ide><path>test/unit/deferred.js
<ide> jQuery.each( [ "", " - new operator" ], function( _, withNew ) {
<ide>
<ide> assert.ok( jQuery.isFunction( defer.pipe ), "defer.pipe is a function" );
<ide>
<del> createDeferred().resolve().done( function() {
<add> defer.resolve().done( function() {
<ide> assert.ok( true, "Success on resolve" );
<del> assert.strictEqual( this.state(), "resolved", "Deferred is resolved (state)" );
<add> assert.strictEqual( defer.state(), "resolved", "Deferred is resolved (state)" );
<ide> } ).fail( function() {
<ide> assert.ok( false, "Error on resolve" );
<ide> } ).always( function() {
<ide> assert.ok( true, "Always callback on resolve" );
<ide> } );
<ide>
<del> createDeferred().reject().done( function() {
<add> defer = createDeferred();
<add> defer.reject().done( function() {
<ide> assert.ok( false, "Success on reject" );
<ide> } ).fail( function() {
<ide> assert.ok( true, "Error on reject" );
<del> assert.strictEqual( this.state(), "rejected", "Deferred is rejected (state)" );
<add> assert.strictEqual( defer.state(), "rejected", "Deferred is rejected (state)" );
<ide> } ).always( function() {
<ide> assert.ok( true, "Always callback on reject" );
<ide> } );
<ide> QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - deferred (progress)", function(
<ide>
<ide> QUnit.test( "jQuery.Deferred.then - context", function( assert ) {
<ide>
<del> assert.expect( 7 );
<add> assert.expect( 11 );
<ide>
<ide> var defer, piped, defer2, piped2,
<del> context = {},
<del> done = jQuery.map( new Array( 4 ), function() { return assert.async(); } );
<add> context = { custom: true },
<add> done = jQuery.map( new Array( 5 ), function() { return assert.async(); } );
<ide>
<ide> jQuery.Deferred().resolveWith( context, [ 2 ] ).then( function( value ) {
<add> assert.strictEqual( this, context, "custom context received by .then handler" );
<ide> return value * 3;
<ide> } ).done( function( value ) {
<del> assert.notStrictEqual( this, context, "custom context not propagated through .then" );
<add> assert.notStrictEqual( this, context,
<add> "custom context not propagated through .then handler" );
<ide> assert.strictEqual( value, 6, "proper value received" );
<ide> done.pop().call();
<ide> } );
<ide>
<add> jQuery.Deferred().resolveWith( context, [ 2 ] ).then().done( function( value ) {
<add> assert.strictEqual( this, context,
<add> "custom context propagated through .then without handler" );
<add> assert.strictEqual( value, 2, "proper value received" );
<add> done.pop().call();
<add> } );
<add>
<ide> jQuery.Deferred().resolve().then( function() {
<add> assert.strictEqual( this, window, "default context in .then handler" );
<ide> return jQuery.Deferred().resolveWith( context );
<ide> } ).done( function() {
<ide> assert.strictEqual( this, context,
<ide> QUnit.test( "jQuery.Deferred.then - context", function( assert ) {
<ide> defer.resolve( 2 );
<ide>
<ide> piped.done( function( value ) {
<del> assert.strictEqual( this, piped,
<del> "default context gets updated to latest promise in the chain" );
<add> assert.strictEqual( this, window, ".then handler does not introduce context" );
<ide> assert.strictEqual( value, 6, "proper value received" );
<ide> done.pop().call();
<ide> } );
<ide> QUnit.test( "jQuery.Deferred.then - context", function( assert ) {
<ide> defer2.resolve( 2 );
<ide>
<ide> piped2.done( function( value ) {
<del> assert.strictEqual( this, piped2,
<del> "default context updated to latest promise in the chain (without passing function)" );
<add> assert.strictEqual( this, window, ".then without handler does not introduce context" );
<ide> assert.strictEqual( value, 2, "proper value received (without passing function)" );
<ide> done.pop().call();
<ide> } );
<ide> } );
<ide>
<ide> QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - context", function( assert ) {
<ide>
<del> assert.expect( 7 );
<add> assert.expect( 11 );
<ide>
<ide> var defer, piped, defer2, piped2,
<del> context = {},
<del> done = jQuery.map( new Array( 4 ), function() { return assert.async(); } );
<add> context = { custom: true },
<add> done = jQuery.map( new Array( 5 ), function() { return assert.async(); } );
<ide>
<ide> jQuery.Deferred().resolveWith( context, [ 2 ] ).pipe( function( value ) {
<add> assert.strictEqual( this, context, "custom context received by .pipe handler" );
<ide> return value * 3;
<ide> } ).done( function( value ) {
<del> assert.strictEqual( this, context, "[PIPE ONLY] custom context correctly propagated" );
<add> assert.strictEqual( this, context,
<add> "[PIPE ONLY] custom context propagated through .pipe handler" );
<ide> assert.strictEqual( value, 6, "proper value received" );
<ide> done.pop().call();
<ide> } );
<ide>
<add> jQuery.Deferred().resolveWith( context, [ 2 ] ).pipe().done( function( value ) {
<add> assert.strictEqual( this, context,
<add> "[PIPE ONLY] custom context propagated through .pipe without handler" );
<add> assert.strictEqual( value, 2, "proper value received" );
<add> done.pop().call();
<add> } );
<add>
<ide> jQuery.Deferred().resolve().pipe( function() {
<add> assert.strictEqual( this, window, "default context in .pipe handler" );
<ide> return jQuery.Deferred().resolveWith( context );
<ide> } ).done( function() {
<ide> assert.strictEqual( this, context,
<ide> QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - context", function( assert ) {
<ide> defer.resolve( 2 );
<ide>
<ide> piped.done( function( value ) {
<del> assert.strictEqual( this, piped,
<del> "default context gets updated to latest promise in the chain" );
<add> assert.strictEqual( this, window, ".pipe handler does not introduce context" );
<ide> assert.strictEqual( value, 6, "proper value received" );
<ide> done.pop().call();
<ide> } );
<ide> QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - context", function( assert ) {
<ide> defer2.resolve( 2 );
<ide>
<ide> piped2.done( function( value ) {
<del> assert.strictEqual( this, piped2,
<del> "default context updated to latest promise in the chain (without passing function)" );
<add> assert.strictEqual( this, window, ".pipe without handler does not introduce context" );
<ide> assert.strictEqual( value, 2, "proper value received (without passing function)" );
<ide> done.pop().call();
<ide> } );
<ide> QUnit.test( "jQuery.when - joined", function( assert ) {
<ide> eventuallyRejected: true,
<ide> rejectedStandardPromise: true
<ide> },
<del> counter = 49;
<add> counter = 49,
<add> expectedContext = (function() { "use strict"; return this; })();
<ide>
<ide> QUnit.stop();
<ide>
<ide> QUnit.test( "jQuery.when - joined", function( assert ) {
<ide> var shouldResolve = willSucceed[ id1 ] && willSucceed[ id2 ],
<ide> shouldError = willError[ id1 ] || willError[ id2 ],
<ide> expected = shouldResolve ? [ 1, 1 ] : [ 0, undefined ],
<del> code = "jQuery.when( " + id1 + ", " + id2 + " )",
<del> context1 = defer1 && jQuery.isFunction( defer1.promise ) ? defer1.promise() : window,
<del> context2 = defer2 && jQuery.isFunction( defer2.promise ) ? defer2.promise() : window;
<add> code = "jQuery.when( " + id1 + ", " + id2 + " )";
<ide>
<ide> jQuery.when( defer1, defer2 ).done( function( a, b ) {
<ide> if ( shouldResolve ) {
<ide> assert.deepEqual( [ a, b ], expected, code + " => resolve" );
<del> assert.strictEqual( this[ 0 ], context1, code + " => first context OK" );
<del> assert.strictEqual( this[ 1 ], context2, code + " => second context OK" );
<add> assert.strictEqual( this[ 0 ], expectedContext, code + " => context[0] OK" );
<add> assert.strictEqual( this[ 1 ], expectedContext, code + " => context[1] OK" );
<ide> } else {
<ide> assert.ok( false, code + " => resolve" );
<ide> } | 4 |
Ruby | Ruby | use nullable `id` column instead of a primary key | 5409e5e31b00f05d4e706d2086a3205974a25886 | <ide><path>activerecord/test/schema/schema.rb
<ide> t.index :id, unique: true
<ide> end
<ide>
<del> create_table :subscribers, force: true do |t|
<add> create_table :subscribers, id: false, force: true do |t|
<ide> t.string :nick, null: false
<ide> t.string :name
<add> t.integer :id
<ide> t.integer :books_count, null: false, default: 0
<ide> t.integer :update_count, null: false, default: 0
<ide> t.index :nick, unique: true | 1 |
Python | Python | replace assert with assert_ | 33ba9bea35467837de0dedd46ee4b78a17bd8211 | <ide><path>numpy/core/tests/test_regression.py
<ide> def test_endian_bool_indexing(self,level=rlevel):
<ide> yb = ((b>2) & (b<6))
<ide> assert_array_almost_equal(xa,ya.nonzero())
<ide> assert_array_almost_equal(xb,yb.nonzero())
<del> assert(np.all(a[ya] > 0.5))
<del> assert(np.all(b[yb] > 0.5))
<add> assert_(np.all(a[ya] > 0.5))
<add> assert_(np.all(b[yb] > 0.5))
<ide>
<ide> def test_mem_dot(self,level=rlevel):
<ide> """Ticket #106"""
<ide> def test_arange_endian(self,level=rlevel):
<ide> # """Ticket #112"""
<ide> # if np.longfloat(0).itemsize > 8:
<ide> # a = np.exp(np.array([1000],dtype=np.longfloat))
<del># assert(str(a)[1:9] == str(a[0])[:8])
<add># assert_(str(a)[1:9] == str(a[0])[:8])
<ide>
<ide> def test_argmax(self,level=rlevel):
<ide> """Ticket #119"""
<ide> def test_squeeze_type(self,level=rlevel):
<ide> """Ticket #133"""
<ide> a = np.array([3])
<ide> b = np.array(3)
<del> assert(type(a.squeeze()) is np.ndarray)
<del> assert(type(b.squeeze()) is np.ndarray)
<add> assert_(type(a.squeeze()) is np.ndarray)
<add> assert_(type(b.squeeze()) is np.ndarray)
<ide>
<ide> def test_add_identity(self,level=rlevel):
<ide> """Ticket #143"""
<ide> def test_void_copyswap(self, level=rlevel):
<ide> dt = np.dtype([('one', '<i4'),('two', '<i4')])
<ide> x = np.array((1,2), dtype=dt)
<ide> x = x.byteswap()
<del> assert(x['one'] > 1 and x['two'] > 2)
<add> assert_(x['one'] > 1 and x['two'] > 2)
<ide>
<ide> def test_method_args(self, level=rlevel):
<ide> # Make sure methods and functions have same default axis
<ide> def test_recarray_fields(self, level=rlevel):
<ide> np.rec.array([(1,2),(3,4)]),
<ide> np.rec.fromarrays([(1,2),(3,4)],"i4,i4"),
<ide> np.rec.fromarrays([(1,2),(3,4)])]:
<del> assert(a.dtype in [dt0,dt1])
<add> assert_(a.dtype in [dt0,dt1])
<ide>
<ide> def test_random_shuffle(self, level=rlevel):
<ide> """Ticket #374"""
<ide> def test_recarray_tolist(self, level=rlevel):
<ide> buf = np.zeros(40, dtype=np.int8)
<ide> a = np.recarray(2, formats="i4,f8,f8", names="id,x,y", buf=buf)
<ide> b = a.tolist()
<del> assert( a[0].tolist() == b[0])
<del> assert( a[1].tolist() == b[1])
<add> assert_( a[0].tolist() == b[0])
<add> assert_( a[1].tolist() == b[1])
<ide>
<ide> def test_char_array_creation(self, level=rlevel):
<ide> a = np.array('123', dtype='c')
<ide><path>numpy/lib/tests/test__datasource.py
<ide> def tearDown(self):
<ide> del self.ds
<ide>
<ide> def test_ValidHTTP(self):
<del> assert self.ds.exists(valid_httpurl())
<add> assert_(self.ds.exists(valid_httpurl()))
<ide>
<ide> def test_InvalidHTTP(self):
<ide> self.assertEqual(self.ds.exists(invalid_httpurl()), False)
<ide>
<ide> def test_ValidFile(self):
<ide> # Test valid file in destpath
<ide> tmpfile = valid_textfile(self.tmpdir)
<del> assert self.ds.exists(tmpfile)
<add> assert_(self.ds.exists(tmpfile))
<ide> # Test valid local file not in destpath
<ide> localdir = mkdtemp()
<ide> tmpfile = valid_textfile(localdir)
<del> assert self.ds.exists(tmpfile)
<add> assert_(self.ds.exists(tmpfile))
<ide> rmtree(localdir)
<ide>
<ide> def test_InvalidFile(self):
<ide> def test_sandboxing(self):
<ide>
<ide> tmp_path = lambda x: os.path.abspath(self.ds.abspath(x))
<ide>
<del> assert tmp_path(valid_httpurl()).startswith(self.tmpdir)
<del> assert tmp_path(invalid_httpurl()).startswith(self.tmpdir)
<del> assert tmp_path(tmpfile).startswith(self.tmpdir)
<del> assert tmp_path(tmpfilename).startswith(self.tmpdir)
<add> assert_(tmp_path(valid_httpurl()).startswith(self.tmpdir))
<add> assert_(tmp_path(invalid_httpurl()).startswith(self.tmpdir))
<add> assert_(tmp_path(tmpfile).startswith(self.tmpdir))
<add> assert_(tmp_path(tmpfilename).startswith(self.tmpdir))
<ide> for fn in malicious_files:
<del> assert tmp_path(http_path+fn).startswith(self.tmpdir)
<del> assert tmp_path(fn).startswith(self.tmpdir)
<add> assert_(tmp_path(http_path+fn).startswith(self.tmpdir))
<add> assert_(tmp_path(fn).startswith(self.tmpdir))
<ide>
<ide> def test_windows_os_sep(self):
<ide> orig_os_sep = os.sep
<ide> def test_ValidHTTP(self):
<ide>
<ide> def test_sandboxing(self):
<ide> tmp_path = lambda x: os.path.abspath(self.repos.abspath(x))
<del> assert tmp_path(valid_httpfile()).startswith(self.tmpdir)
<add> assert_(tmp_path(valid_httpfile()).startswith(self.tmpdir))
<ide> for fn in malicious_files:
<del> assert tmp_path(http_path+fn).startswith(self.tmpdir)
<del> assert tmp_path(fn).startswith(self.tmpdir)
<add> assert_(tmp_path(http_path+fn).startswith(self.tmpdir))
<add> assert_(tmp_path(fn).startswith(self.tmpdir))
<ide>
<ide> def test_windows_os_sep(self):
<ide> orig_os_sep = os.sep
<ide> def tearDown(self):
<ide> def test_ValidFile(self):
<ide> # Create local temp file
<ide> tmpfile = valid_textfile(self.tmpdir)
<del> assert self.repos.exists(tmpfile)
<add> assert_(self.repos.exists(tmpfile))
<ide>
<ide> def test_InvalidFile(self):
<ide> tmpfile = invalid_textfile(self.tmpdir)
<ide> self.assertEqual(self.repos.exists(tmpfile), False)
<ide>
<ide> def test_RemoveHTTPFile(self):
<del> assert self.repos.exists(valid_httpurl())
<add> assert_(self.repos.exists(valid_httpurl()))
<ide>
<ide> def test_CachedHTTPFile(self):
<ide> localfile = valid_httpurl()
<ide> def test_CachedHTTPFile(self):
<ide> local_path = os.path.join(self.repos._destpath, netloc)
<ide> os.mkdir(local_path, 0700)
<ide> tmpfile = valid_textfile(local_path)
<del> assert self.repos.exists(tmpfile)
<add> assert_(self.repos.exists(tmpfile))
<ide>
<ide> class TestOpenFunc(TestCase):
<ide> def setUp(self): | 2 |
Python | Python | fix meta serialization in train | 27a1cd3c630055802513a20c1e75d0b37943cc39 | <ide><path>spacy/cli/train.py
<ide> def train(
<ide> with nlp.use_params(optimizer.averages):
<ide> final_model_path = output_path / "model-final"
<ide> nlp.to_disk(final_model_path)
<add> srsly.write_json(final_model_path / "meta.json", meta)
<add>
<ide> meta_loc = output_path / "model-final" / "meta.json"
<ide> final_meta = srsly.read_json(meta_loc)
<ide> final_meta.setdefault("accuracy", {}) | 1 |
Text | Text | add missing date to 4.10.0-beta.2 in changelog | c5d614ad7c1a7b62b797d55b8e5ea2d089dae9e7 | <ide><path>CHANGELOG.md
<ide>
<ide> - [#20284](https://github.com/emberjs/ember.js/pull/20284) [BUGFIX] remove incorrect types for deprecation functions
<ide>
<del>## v4.10.0-beta.2
<add>## v4.10.0-beta.2 (November 30, 2022)
<ide>
<ide> - [#20283](https://github.com/emberjs/ember.js/pull/20283) [BUGFIX] revert TS `compilerOptions.target` to ES2017
<ide> - [#20284](https://github.com/emberjs/ember.js/pull/20284) [BUGFIX] remove incorrect types for deprecation functions | 1 |
Python | Python | add test for quadraticequation() | 7cf3db184320a454e545882408b8c2f561ef0cdb | <ide><path>maths/quadratic_equations_complex_numbers.py
<del>import math
<add>from math import sqrt
<add>from typing import Tuple
<ide>
<del>def QuadraticEquation(a,b,c):
<add>
<add>def QuadraticEquation(a: int, b: int, c: int) -> Tuple[str, str]:
<add> """
<add> Given the numerical coefficients a, b and c,
<add> prints the solutions for a quadratic equation, for a*x*x + b*x + c.
<add>
<add> >>> QuadraticEquation(a=1, b=3, c=-4)
<add> ('1.0', '-4.0')
<add> >>> QuadraticEquation(5, 6, 1)
<add> ('-0.2', '-1.0')
<ide> """
<del> Prints the solutions for a quadratic equation, given the numerical coefficients a, b and c,
<del> for a*x*x + b*x + c.
<del> Ex.: a = 1, b = 3, c = -4
<del> Solution1 = 1 and Solution2 = -4
<add> if a == 0:
<add> raise ValueError("Coefficient 'a' must not be zero for quadratic equations.")
<add> delta = b * b - 4 * a * c
<add> if delta >= 0:
<add> return str((-b + sqrt(delta)) / (2 * a)), str((-b - sqrt(delta)) / (2 * a))
<ide> """
<del> Delta = b*b - 4*a*c
<del> if a != 0:
<del> if Delta >= 0:
<del> Solution1 = (-b + math.sqrt(Delta))/(2*a)
<del> Solution2 = (-b - math.sqrt(Delta))/(2*a)
<del> print("The equation solutions are: ", Solution1," and ", Solution2)
<del> else:
<del> """
<del> Treats cases of Complexes Solutions(i = imaginary unit)
<del> Ex.: a = 5, b = 2, c = 1
<del> Solution1 = (- 2 + 4.0 *i)/2 and Solution2 = (- 2 + 4.0 *i)/ 10
<del> """
<del> if b > 0:
<del> print("The equation solutions are: (-",b,"+",math.sqrt(-Delta),"*i)/2 and (-",b,"+",math.sqrt(-Delta),"*i)/", 2*a)
<del> if b < 0:
<del> print("The equation solutions are: (",b,"+",math.sqrt(-Delta),"*i)/2 and (",b,"+",math.sqrt(-Delta),"*i/",2*a)
<del> if b == 0:
<del> print("The equation solutions are: (",math.sqrt(-Delta),"*i)/2 and ",math.sqrt(-Delta),"*i)/", 2*a)
<del> else:
<del> print("Error. Please, coeficient 'a' must not be zero for quadratic equations.")
<del>def main():
<del> a = 5
<del> b = 6
<del> c = 1
<add> Treats cases of Complexes Solutions(i = imaginary unit)
<add> Ex.: a = 5, b = 2, c = 1
<add> Solution1 = (- 2 + 4.0 *i)/2 and Solution2 = (- 2 + 4.0 *i)/ 10
<add> """
<add> snd = sqrt(-delta)
<add> if b == 0:
<add> return f"({snd} * i) / 2", f"({snd} * i) / {2 * a}"
<add> b = -abs(b)
<add> return f"({b}+{snd} * i) / 2", f"({b}+{snd} * i) / {2 * a}"
<add>
<ide>
<del> QuadraticEquation(a,b,c) # The equation solutions are: -0.2 and -1.0
<add>def main():
<add> solutions = QuadraticEquation(a=5, b=6, c=1)
<add> print("The equation solutions are: {} and {}".format(*solutions))
<add> # The equation solutions are: -0.2 and -1.0
<ide>
<ide>
<del>if __name__ == '__main__':
<add>if __name__ == "__main__":
<ide> main() | 1 |
Text | Text | add list of todos | d6651387549688df188a930e1d24f9df39b6ee35 | <ide><path>_randomgen/TODO.md
<add># TODO
<add>0. Use inheritance to simplify CorePRNG structure. The natural base is
<add> xoroshiro128.
<add>1. Add PCG64
<add>2. Add dSFMT
<add>3. Add xorshift2014
<add>4. Augment state to include has_gauss and gauss
<add>5. Augment state to have binomial structure
<add>6. Port over 0 parameter distributions
<add> * standard exponential float
<add> * standard exponential ziggurat
<add> * standard exponential ziggurat float
<add> * standard normal
<add> * standard normal float
<add> * standard normal ziggurat
<add> * standard normal ziggurat float
<add> * standard gamma
<add> * standard gamma float
<add>7. Remove SplitMix64 as an external generator
<add>8. Restore ability to use `out` in core distributions | 1 |
Javascript | Javascript | add form "acceptcharset" to htmldompropertyconfig | 70a7506bb9fdb597ea064474ac74a8d084674b96 | <ide><path>src/browser/ui/dom/HTMLDOMPropertyConfig.js
<ide> var HTMLDOMPropertyConfig = {
<ide> * Standard Properties
<ide> */
<ide> accept: null,
<add> acceptCharset: null,
<ide> accessKey: null,
<ide> action: null,
<ide> allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
<ide> var HTMLDOMPropertyConfig = {
<ide> property: null // Supports OG in meta tags
<ide> },
<ide> DOMAttributeNames: {
<add> acceptCharset: 'accept-charset',
<ide> className: 'class',
<ide> htmlFor: 'for',
<ide> httpEquiv: 'http-equiv' | 1 |
Ruby | Ruby | add an option to skip jbuilder | f5c5d21681616c6b9240792092e656d3d1af385b | <ide><path>railties/lib/rails/generators/app_base.rb
<ide> def self.add_shared_options_for(name)
<ide> class_option :skip_sprockets, type: :boolean, aliases: '-S', default: false,
<ide> desc: 'Skip Sprockets files'
<ide>
<add> class_option :skip_jbuilder, type: :boolean, default: false,
<add> desc: "Don't include jbuilder in the Gemfile"
<add>
<ide> class_option :database, type: :string, aliases: '-d', default: 'sqlite3',
<ide> desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})"
<ide>
<ide> def assets_gemfile_entry
<ide> end
<ide>
<ide> def jbuilder_gemfile_entry
<add> return [] if options[:skip_jbuilder]
<ide> comment = 'Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder'
<ide> GemfileEntry.version('jbuilder', '~> 1.2', comment)
<ide> end | 1 |
PHP | PHP | update urlhelper to use asset class | 8d9609313d8d20f199c442e789754639836f821f | <ide><path>src/Routing/Asset.php
<ide> public static function url(string $path, array $options = []): string
<ide> $path .= $options['ext'];
<ide> }
<ide>
<add> // Check again if path has protocol as `pathPrefix` could be for CDNs.
<ide> if (preg_match('|^([a-z0-9]+:)?//|', $path)) {
<ide> return Router::url($path);
<ide> }
<ide><path>src/View/Helper/UrlHelper.php
<ide> */
<ide> namespace Cake\View\Helper;
<ide>
<del>use Cake\Core\Configure;
<del>use Cake\Core\Plugin;
<add>use Cake\Routing\Asset;
<ide> use Cake\Routing\Router;
<del>use Cake\Utility\Inflector;
<ide> use Cake\View\Helper;
<ide>
<ide> /**
<ide> public function build($url = null, array $options = []): string
<ide> */
<ide> public function image(string $path, array $options = []): string
<ide> {
<del> $pathPrefix = Configure::read('App.imageBaseUrl');
<add> $options += ['theme' => $this->_View->getTheme()];
<ide>
<del> return $this->assetUrl($path, $options + compact('pathPrefix'));
<add> return h(Asset::image($path, $options));
<ide> }
<ide>
<ide> /**
<ide> public function image(string $path, array $options = []): string
<ide> */
<ide> public function css(string $path, array $options = []): string
<ide> {
<del> $pathPrefix = Configure::read('App.cssBaseUrl');
<del> $ext = '.css';
<add> $options += ['theme' => $this->_View->getTheme()];
<ide>
<del> return $this->assetUrl($path, $options + compact('pathPrefix', 'ext'));
<add> return h(Asset::css($path, $options));
<ide> }
<ide>
<ide> /**
<ide> public function css(string $path, array $options = []): string
<ide> */
<ide> public function script(string $path, array $options = []): string
<ide> {
<del> $pathPrefix = Configure::read('App.jsBaseUrl');
<del> $ext = '.js';
<add> $options += ['theme' => $this->_View->getTheme()];
<ide>
<del> return $this->assetUrl($path, $options + compact('pathPrefix', 'ext'));
<add> return h(Asset::script($path, $options));
<ide> }
<ide>
<ide> /**
<ide> public function script(string $path, array $options = []): string
<ide> */
<ide> public function assetUrl(string $path, array $options = []): string
<ide> {
<del> // data URIs only require HTML escaping
<del> if (preg_match('/^data:[a-z]+\/[a-z]+;/', $path)) {
<del> return h($path);
<del> }
<del> if (strpos($path, '://') !== false || preg_match('/^[a-z]+:/i', $path)) {
<del> return ltrim($this->build($path), '/');
<del> }
<del> if (!array_key_exists('plugin', $options) || $options['plugin'] !== false) {
<del> [$plugin, $path] = $this->_View->pluginSplit($path, false);
<del> }
<del> if (!empty($options['pathPrefix']) && $path[0] !== '/') {
<del> $path = $options['pathPrefix'] . $path;
<del> }
<del> if (!empty($options['ext']) &&
<del> strpos($path, '?') === false &&
<del> substr($path, -strlen($options['ext'])) !== $options['ext']
<del> ) {
<del> $path .= $options['ext'];
<del> }
<del> if (preg_match('|^([a-z0-9]+:)?//|', $path)) {
<del> return $this->build($path);
<del> }
<del> if (isset($plugin)) {
<del> $path = Inflector::underscore($plugin) . '/' . $path;
<del> }
<del>
<del> $optionTimestamp = null;
<del> if (array_key_exists('timestamp', $options)) {
<del> $optionTimestamp = $options['timestamp'];
<del> }
<del> $webPath = $this->assetTimestamp($this->webroot($path), $optionTimestamp);
<del>
<del> $path = $this->_encodeUrl($webPath);
<del>
<del> if (!empty($options['fullBase'])) {
<del> $fullBaseUrl = is_string($options['fullBase']) ? $options['fullBase'] : Router::fullBaseUrl();
<del> $path = rtrim($fullBaseUrl, '/') . '/' . ltrim($path, '/');
<del> }
<del>
<del> return $path;
<del> }
<del>
<del> /**
<del> * Encodes a URL for use in HTML attributes.
<del> *
<del> * @param string $url The URL to encode.
<del> * @return string The URL encoded for both URL & HTML contexts.
<del> */
<del> protected function _encodeUrl(string $url): string
<del> {
<del> $path = parse_url($url, PHP_URL_PATH);
<del> $parts = array_map('rawurldecode', explode('/', $path));
<del> $parts = array_map('rawurlencode', $parts);
<del> $encoded = implode('/', $parts);
<add> $options += ['theme' => $this->_View->getTheme()];
<ide>
<del> /** @var string $url */
<del> $url = h(str_replace($path, $encoded, $url));
<del>
<del> return $url;
<add> return h(Asset::url($path, $options));
<ide> }
<ide>
<ide> /**
<ide> protected function _encodeUrl(string $url): string
<ide> */
<ide> public function assetTimestamp(string $path, $timestamp = null): string
<ide> {
<del> if (strpos($path, '?') !== false) {
<del> return $path;
<del> }
<del>
<del> if ($timestamp === null) {
<del> $timestamp = Configure::read('Asset.timestamp');
<del> }
<del> $timestampEnabled = $timestamp === 'force' || ($timestamp === true && Configure::read('debug'));
<del> if ($timestampEnabled) {
<del> $filepath = preg_replace(
<del> '/^' . preg_quote($this->_View->getRequest()->getAttribute('webroot'), '/') . '/',
<del> '',
<del> urldecode($path)
<del> );
<del> $webrootPath = Configure::read('App.wwwRoot') . str_replace('/', DIRECTORY_SEPARATOR, $filepath);
<del> if (file_exists($webrootPath)) {
<del> return $path . '?' . filemtime($webrootPath);
<del> }
<del> $segments = explode('/', ltrim($filepath, '/'));
<del> $plugin = Inflector::camelize($segments[0]);
<del> if (Plugin::isLoaded($plugin)) {
<del> unset($segments[0]);
<del> $pluginPath = Plugin::path($plugin)
<del> . 'webroot'
<del> . DIRECTORY_SEPARATOR
<del> . implode(DIRECTORY_SEPARATOR, $segments);
<del> if (file_exists($pluginPath)) {
<del> return $path . '?' . filemtime($pluginPath);
<del> }
<del> }
<del> }
<del>
<del> return $path;
<add> return h(Asset::assetTimestamp($path, $timestamp));
<ide> }
<ide>
<ide> /**
<ide> public function assetTimestamp(string $path, $timestamp = null): string
<ide> */
<ide> public function webroot(string $file): string
<ide> {
<del> $request = $this->_View->getRequest();
<del>
<del> $asset = explode('?', $file);
<del> $asset[1] = isset($asset[1]) ? '?' . $asset[1] : '';
<del> $webPath = $request->getAttribute('webroot') . $asset[0];
<del> $file = $asset[0];
<del>
<del> $themeName = $this->_View->getTheme();
<del> if (!empty($themeName)) {
<del> $file = trim($file, '/');
<del> $theme = $this->_inflectThemeName($themeName) . '/';
<del>
<del> if (DIRECTORY_SEPARATOR === '\\') {
<del> $file = str_replace('/', '\\', $file);
<del> }
<add> $options = ['theme' => $this->_View->getTheme()];
<ide>
<del> if (file_exists(Configure::read('App.wwwRoot') . $theme . $file)) {
<del> $webPath = $request->getAttribute('webroot') . $theme . $asset[0];
<del> } else {
<del> $themePath = Plugin::path($themeName);
<del> $path = $themePath . 'webroot/' . $file;
<del> if (file_exists($path)) {
<del> $webPath = $request->getAttribute('webroot') . $theme . $asset[0];
<del> }
<del> }
<del> }
<del> if (strpos($webPath, '//') !== false) {
<del> return str_replace('//', '/', $webPath . $asset[1]);
<del> }
<del>
<del> return $webPath . $asset[1];
<del> }
<del>
<del> /**
<del> * Inflect the theme name to its underscored version.
<del> *
<del> * @param string $name Name of the theme which should be inflected.
<del> * @return string Inflected name of the theme
<del> */
<del> protected function _inflectThemeName(string $name): string
<del> {
<del> return Inflector::underscore($name);
<add> return h(Asset::webroot($file, $options));
<ide> }
<ide>
<ide> /**
<ide><path>tests/TestCase/View/Helper/FormHelperTest.php
<ide> public function setUp(): void
<ide> 'params' => [
<ide> 'controller' => 'articles',
<ide> 'action' => 'add',
<add> 'plugin' => null,
<ide> ],
<ide> ]);
<ide> $this->View = new View($request);
<add> Router::reload();
<add> Router::pushRequest($request);
<ide>
<ide> $this->Form = new FormHelper($this->View);
<ide>
<ide><path>tests/TestCase/View/Helper/HtmlHelperTest.php
<ide> public function setUp(): void
<ide> $request = new ServerRequest([
<ide> 'webroot' => '',
<ide> ]);
<add> Router::reload();
<add> Router::pushRequest($request);
<add>
<ide> $this->View = $this->getMockBuilder('Cake\View\View')
<ide> ->setMethods(['append'])
<ide> ->setConstructorArgs([$request])
<ide> public function testLink()
<ide> $this->assertHtml($expected, $result);
<ide>
<ide> Router::reload();
<add> Router::pushRequest(new ServerRequest());
<ide> Router::connect('/:controller', ['action' => 'index']);
<ide> Router::connect('/:controller/:action/*');
<ide>
<ide> public function testImageWithFullBase()
<ide> $expected = ['img' => ['src' => $here . 'img/sub/test.gif', 'alt' => '']];
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()
<add> $request = Router::getRequest()
<ide> ->withAttribute('webroot', '/myproject/')
<del> ->withAttribute('base', '/myproject'));
<add> ->withAttribute('base', '/myproject');
<add> Router::pushRequest($request);
<ide>
<ide> $result = $this->Html->image('sub/test.gif', ['fullBase' => true]);
<del> $here = $this->Html->Url->build('/', ['fullBase' => true]);
<del> $expected = ['img' => ['src' => $here . 'myproject/img/sub/test.gif', 'alt' => '']];
<add> $expected = ['img' => ['src' => 'http://localhost/myproject/img/sub/test.gif', 'alt' => '']];
<ide> $this->assertHtml($expected, $result);
<ide> }
<ide>
<ide> public function testImageWithTimestampping()
<ide> {
<ide> Configure::write('Asset.timestamp', 'force');
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->image('cake.icon.png');
<ide> $expected = ['img' => ['src' => 'preg:/\/img\/cake\.icon\.png\?\d+/', 'alt' => '']];
<ide> $this->assertHtml($expected, $result);
<ide> public function testImageWithTimestampping()
<ide> $expected = ['img' => ['src' => 'preg:/\/img\/cake\.icon\.png\?\d+/', 'alt' => '']];
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/longer/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/longer/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->image('cake.icon.png');
<ide> $expected = [
<ide> 'img' => ['src' => 'preg:/\/testing\/longer\/img\/cake\.icon\.png\?[0-9]+/', 'alt' => ''],
<ide> public function testImageTagWithTheme()
<ide> Configure::write('Asset.timestamp', true);
<ide> Configure::write('debug', true);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/');
<add> Router::pushRequest($request);
<ide> $this->Html->Url->getView()->setTheme('TestTheme');
<ide> $result = $this->Html->image('__cake_test_image.gif');
<ide> $expected = [
<ide> public function testImageTagWithTheme()
<ide> ];
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->image('__cake_test_image.gif');
<ide> $expected = [
<ide> 'img' => [
<ide> public function testCssTimestamping()
<ide> $expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/';
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->css('cake.generic', ['once' => false]);
<ide> $expected['link']['href'] = 'preg:/\/testing\/css\/cake\.generic\.css\?[0-9]+/';
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/longer/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/longer/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->css('cake.generic', ['once' => false]);
<ide> $expected['link']['href'] = 'preg:/\/testing\/longer\/css\/cake\.generic\.css\?[0-9]+/';
<ide> $this->assertHtml($expected, $result);
<ide> public function testPluginCssTimestamping()
<ide> $expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
<ide> $expected['link']['href'] = 'preg:/\/testing\/test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/longer/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/longer/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
<ide> $expected['link']['href'] = 'preg:/\/testing\/longer\/test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
<ide> $this->assertHtml($expected, $result);
<ide> public function testScriptInTheme()
<ide> $testfile = WWW_ROOT . '/test_theme/js/__test_js.js';
<ide> $File = new File($testfile, true);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/');
<add> Router::pushRequest($request);
<ide> $this->Html->Url->getView()->setTheme('TestTheme');
<ide> $result = $this->Html->script('__test_js.js');
<ide> $expected = [
<ide> public function testMetaIcon()
<ide> ];
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->meta('icon');
<ide> $expected = [
<ide> 'link' => ['href' => '/testing/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'icon'],
<ide> public function testMetaIconWithTheme()
<ide> ];
<ide> $this->assertHtml($expected, $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/testing/'));
<add> $request = Router::getRequest()->withAttribute('webroot', '/testing/');
<add> Router::pushRequest($request);
<ide> $result = $this->Html->meta('icon');
<ide> $expected = [
<ide> 'link' => ['href' => '/testing/test_theme/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'icon'],
<ide><path>tests/TestCase/View/Helper/UrlHelperTest.php
<ide> public function setUp(): void
<ide> parent::setUp();
<ide>
<ide> Router::reload();
<del> $this->View = new View(new ServerRequest());
<add> $request = new ServerRequest();
<add> Router::pushRequest($request);
<add>
<add> $this->View = new View($request);
<ide> $this->Helper = new UrlHelper($this->View);
<ide>
<ide> static::setAppNamespace();
<ide> public function testAssetTimestamp()
<ide> $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css?someparam');
<ide> $this->assertEquals(Configure::read('App.cssBaseUrl') . 'cake.generic.css?someparam', $result);
<ide>
<del> $this->View->setRequest($this->View->getRequest()->withAttribute('webroot', '/some/dir/'));
<add> $request = $this->View->getRequest()->withAttribute('webroot', '/some/dir/');
<add> $this->View->setRequest($request);
<add> Router::pushRequest($request);
<ide> $result = $this->Helper->assetTimestamp('/some/dir/' . Configure::read('App.cssBaseUrl') . 'cake.generic.css');
<ide> $this->assertRegExp('/' . preg_quote(Configure::read('App.cssBaseUrl') . 'cake.generic.css?', '/') . '[0-9]+/', $result);
<ide> }
<ide> public function testAssetUrlDataUri()
<ide> */
<ide> public function testAssetUrlNoRewrite()
<ide> {
<del> $this->View->setRequest($this->View->getRequest()
<add> $request = Router::getRequest()
<ide> ->withAttribute('base', '/cake_dev/index.php')
<ide> ->withAttribute('webroot', '/cake_dev/app/webroot/')
<del> ->withRequestTarget('/cake_dev/index.php/tasks'));
<add> ->withRequestTarget('/cake_dev/index.php/tasks');
<add> Router::pushRequest($request);
<add>
<ide> $result = $this->Helper->assetUrl('img/cake.icon.png', ['fullBase' => true]);
<ide> $expected = Configure::read('App.fullBaseUrl') . '/cake_dev/app/webroot/img/cake.icon.png';
<ide> $this->assertEquals($expected, $result);
<ide> public function testCssTimestampConfigureOverride()
<ide> */
<ide> public function testWebrootPaths()
<ide> {
<add> $request = $this->View->getRequest()->withAttribute('webroot', '/');
<ide> $this->View->setRequest(
<del> $this->View->getRequest()->withAttribute('webroot', '/')
<add> $request
<ide> );
<add> Router::pushRequest($request);
<ide> $result = $this->Helper->webroot('/img/cake.power.gif');
<ide> $expected = '/img/cake.power.gif';
<ide> $this->assertEquals($expected, $result); | 5 |
Python | Python | move batch norm between dense and activation | 859b92b8f8a288fcadeafa93314ea77192a7aca1 | <ide><path>research/object_detection/meta_architectures/context_rcnn_lib_tf2.py
<ide> def __init__(self, projection_dimension, **kwargs):
<ide> momentum=0.97,
<ide> trainable=True)
<ide> self.projection = tf.keras.layers.Dense(units=projection_dimension,
<del> activation=tf.nn.relu6,
<ide> use_bias=True)
<ide> self.projection_dimension = projection_dimension
<ide> super(ContextProjection, self).__init__(**kwargs)
<ide> def build(self, input_shape):
<ide> self.batch_norm.build(input_shape[:1] + [self.projection_dimension])
<ide>
<ide> def call(self, input_features, is_training=False):
<del> return self.batch_norm(self.projection(input_features), is_training)
<add> return tf.nn.relu6(self.batch_norm(self.projection(input_features),
<add> is_training))
<ide>
<ide>
<ide> class AttentionBlock(tf.keras.layers.Layer): | 1 |
PHP | PHP | simplify facade to use swap method only | b3079f35c0470e4615a2aa3abd9a50fff412c3c5 | <ide><path>src/Illuminate/Support/Facades/Date.php
<ide>
<ide> namespace Illuminate\Support\Facades;
<ide>
<del>use DateTimeInterface;
<ide> use ReflectionException;
<del>use InvalidArgumentException;
<ide> use Illuminate\Support\Carbon;
<ide>
<ide> /**
<ide> */
<ide> class Date extends Facade
<ide> {
<del> /**
<del> * Date instance class name.
<del> *
<del> * @var string
<del> */
<del> protected static $className = Carbon::class;
<del>
<del> /**
<del> * Date interceptor.
<del> *
<del> * @var callable
<del> */
<del> protected static $interceptor;
<del>
<ide> /**
<ide> * Get the registered name of the component.
<ide> *
<ide> protected static function getFacadeAccessor()
<ide> return 'date';
<ide> }
<ide>
<del> /**
<del> * Change the class to use for date instances.
<del> *
<del> * @param string $className
<del> */
<del> public static function use(string $className)
<del> {
<del> if (! (class_exists($className) && (in_array(DateTimeInterface::class, class_implements($className)) || method_exists($className, 'instance')))) {
<del> throw new InvalidArgumentException(
<del> 'Date class must implement a public static instance(DateTimeInterface $date) method or implements DateTimeInterface.'
<del> );
<del> }
<del>
<del> static::$className = $className;
<del> }
<del>
<del> /**
<del> * Set an interceptor for each date (Carbon instance).
<del> *
<del> * @param callable $interceptor
<del> */
<del> public static function intercept(callable $interceptor)
<del> {
<del> static::$interceptor = $interceptor;
<del> }
<del>
<ide> /**
<ide> * Handle dynamic, static calls to the object.
<ide> *
<ide> public static function intercept(callable $interceptor)
<ide> */
<ide> public static function __callStatic($method, $args)
<ide> {
<add> $root = null;
<add>
<ide> try {
<del> if (static::getFacadeRoot()) {
<del> return parent::__callStatic($method, $args);
<del> }
<add> $root = static::getFacadeRoot();
<ide> } catch (ReflectionException $exception) {
<ide> // continue
<ide> }
<ide>
<del> if (method_exists(static::$className, $method)) {
<del> $date = static::$className::$method(...$args);
<del> } else {
<add> if (! $root) {
<add> Date::swap($root = Carbon::class);
<add> }
<add>
<add> if (is_callable($root)) {
<add> return $root(Carbon::$method(...$args));
<add> }
<add>
<add> if (is_string($root)) {
<add> if (method_exists($root, $method)) {
<add> return $root::$method(...$args);
<add> }
<ide> /** @var Carbon $date */
<ide> $date = Carbon::$method(...$args);
<del> if (method_exists(static::$className, 'instance')) {
<del> $date = static::$className::instance($date);
<del> } else {
<del> $date = new static::$className($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
<add> if (method_exists($root, 'instance')) {
<add> return $root::instance($date);
<ide> }
<del> }
<ide>
<del> if (static::$interceptor) {
<del> return call_user_func(static::$interceptor, $date);
<add> return new $root($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
<ide> }
<ide>
<del> return $date;
<add> return parent::__callStatic($method, $args);
<ide> }
<ide> }
<ide><path>tests/Support/DateFacadeTest.php
<ide> class DateFacadeTest extends TestCase
<ide> protected function tearDown()
<ide> {
<ide> parent::tearDown();
<del> Date::use(Carbon::class);
<del> Date::intercept(function ($date) {
<add> Date::swap(Carbon::class);
<add> Date::swap(function ($date) {
<ide> return $date;
<ide> });
<ide> }
<ide> protected static function assertBetweenStartAndNow($start, $actual)
<ide> );
<ide> }
<ide>
<del> public function testIntercept()
<add> public function testSwapClosure()
<ide> {
<ide> $start = Carbon::now()->getTimestamp();
<ide> $this->assertSame(Carbon::class, get_class(Date::now()));
<ide> $this->assertBetweenStartAndNow($start, Date::now()->getTimestamp());
<del> Date::intercept(function (Carbon $date) {
<add> Date::swap(function (Carbon $date) {
<ide> return new DateTime($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
<ide> });
<ide> $start = Carbon::now()->getTimestamp();
<ide> $this->assertSame(DateTime::class, get_class(Date::now()));
<ide> $this->assertBetweenStartAndNow($start, Date::now()->getTimestamp());
<ide> }
<ide>
<del> public function testUse()
<add> public function testSwapClassName()
<ide> {
<ide> $start = Carbon::now()->getTimestamp();
<ide> $this->assertSame(Carbon::class, get_class(Date::now()));
<ide> $this->assertBetweenStartAndNow($start, Date::now()->getTimestamp());
<del> Date::use(DateTime::class);
<add> Date::swap(DateTime::class);
<ide> $start = Carbon::now()->getTimestamp();
<ide> $this->assertSame(DateTime::class, get_class(Date::now()));
<ide> $this->assertBetweenStartAndNow($start, Date::now()->getTimestamp());
<ide> }
<ide>
<del> /**
<del> * @expectedException \InvalidArgumentException
<del> * @expectedExceptionMessage Date class must implement a public static instance(DateTimeInterface $date) method or implements DateTimeInterface.
<del> */
<del> public function testUseWrongClass()
<del> {
<del> Date::use(Date::class);
<del> }
<del>
<del> /**
<del> * @expectedException \InvalidArgumentException
<del> * @expectedExceptionMessage Date class must implement a public static instance(DateTimeInterface $date) method or implements DateTimeInterface.
<del> */
<del> public function testUseWrongString()
<del> {
<del> Date::use('not-a-class');
<del> }
<del>
<ide> public function testCarbonImmutable()
<ide> {
<ide> if (! class_exists(CarbonImmutable::class)) {
<ide> $this->markTestSkipped('Test for Carbon 2 only');
<ide> }
<ide>
<del> Date::use(CarbonImmutable::class);
<add> Date::swap(CarbonImmutable::class);
<ide> $this->assertSame(CarbonImmutable::class, get_class(Date::now()));
<del> Date::use(Carbon::class);
<add> Date::swap(Carbon::class);
<ide> $this->assertSame(Carbon::class, get_class(Date::now()));
<del> Date::intercept(function (Carbon $date) {
<add> Date::swap(function (Carbon $date) {
<ide> return $date->toImmutable();
<ide> });
<ide> $this->assertSame(CarbonImmutable::class, get_class(Date::now()));
<del> Date::intercept(function ($date) {
<add> Date::swap(function ($date) {
<ide> return $date;
<ide> });
<ide> $this->assertSame(Carbon::class, get_class(Date::now()));
<ide> public function testCarbonImmutable()
<ide> Date::swap(null);
<ide> $this->assertSame('en', Date::now()->locale);
<ide> include_once __DIR__.'/fixtures/CustomDateClass.php';
<del> Date::use(\CustomDateClass::class);
<add> Date::swap(\CustomDateClass::class);
<ide> $this->assertInstanceOf(\CustomDateClass::class, Date::now());
<ide> $this->assertInstanceOf(Carbon::class, Date::now()->getOriginal());
<del> Date::use(Carbon::class);
<add> Date::swap(Carbon::class);
<ide> }
<ide> } | 2 |
Ruby | Ruby | add preferred_perl to built_on | 91ab5fe0cec459978d9809b22e86095797df833d | <ide><path>Library/Homebrew/extend/os/mac/development_tools.rb
<ide> def custom_installation_instructions
<ide>
<ide> def build_system_info
<ide> build_info = {
<del> "xcode" => MacOS::Xcode.version.to_s.presence,
<del> "clt" => MacOS::CLT.version.to_s.presence,
<add> "xcode" => MacOS::Xcode.version.to_s.presence,
<add> "clt" => MacOS::CLT.version.to_s.presence,
<add> "preferred_perl" => MacOS.preferred_perl_version,
<ide> }
<ide> generic_build_system_info.merge build_info
<ide> end | 1 |
Javascript | Javascript | move color helpers to helpers.color | 4a737729d5ca1718510796d1391b8a8991968efd | <ide><path>src/helpers/helpers.color.js
<add>import colorLib from '@kurkle/color';
<add>
<add>/**
<add> * @param {string | CanvasGradient | CanvasPattern} value
<add> */
<add>const isPatternOrGradient = (value) => value instanceof CanvasGradient || value instanceof CanvasPattern;
<add>
<add>/**
<add> * @param {string|CanvasGradient|CanvasPattern} value
<add> * @return {CanvasGradient|CanvasPattern|colorLib}
<add> */
<add>export function color(value) {
<add> return isPatternOrGradient(value) ? value : colorLib(value);
<add>}
<add>
<add>/**
<add> * @param {string|CanvasGradient|CanvasPattern} value
<add> * @return {string|CanvasGradient|CanvasPattern}
<add> */
<add>export function getHoverColor(value) {
<add> return isPatternOrGradient(value)
<add> ? value
<add> : colorLib(value).saturate(0.5).darken(0.1).hexString();
<add>}
<ide><path>src/helpers/index.js
<ide> /* eslint-disable import/no-namespace */
<ide>
<del>import color from '@kurkle/color';
<del>
<ide> import * as coreHelpers from './helpers.core';
<ide> import * as canvas from './helpers.canvas';
<ide> import * as curve from './helpers.curve';
<ide> import * as options from './helpers.options';
<ide> import * as math from './helpers.math';
<ide> import * as rtl from './helpers.rtl';
<ide>
<del>const colorHelper =
<del> function(value) {
<del> if (value instanceof CanvasGradient || value instanceof CanvasPattern) {
<del> // TODO: figure out what this should be. Previously returned
<del> // the default color
<del> return value;
<del> }
<del>
<del> return color(value);
<del> };
<add>import {color, getHoverColor} from './helpers.color';
<ide>
<ide> export default {
<ide> ...coreHelpers,
<ide> export default {
<ide> fontString(pixelSize, fontStyle, fontFamily) {
<ide> return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
<ide> },
<del> color: colorHelper,
<del> getHoverColor(colorValue) {
<del> return (colorValue instanceof CanvasPattern || colorValue instanceof CanvasGradient) ?
<del> colorValue :
<del> colorHelper(colorValue).saturate(0.5).darken(0.1).hexString();
<del> }
<add> color,
<add> getHoverColor
<ide> }; | 2 |
PHP | PHP | apply fixes from styleci | f31557f76ac5a790d66b717e074537031c48085e | <ide><path>src/Illuminate/Testing/TestResponse.php
<ide> public function assertJson($value, $strict = false)
<ide> }
<ide> }
<ide>
<del>
<ide> return $this;
<ide> }
<ide> | 1 |
PHP | PHP | add api docs for encryptedcookiemiddleware | 437cc514422dd31f4e21478a3813d3f70b4a6cb1 | <ide><path>src/Http/Middleware/EncryptedCookieMiddleware.php
<ide> use Psr\Http\Message\ServerRequestInterface;
<ide>
<ide> /**
<del> * Encrypt/Decrypt cookie data.
<add> * Middlware for encrypting & decrypting cookies.
<ide> *
<ide> * This middleware layer will encrypt/decrypt the named cookies with the given key
<ide> * and cipher type. To support multiple keys/cipher types use this middleware multiple
<ide> class EncryptedCookieMiddleware
<ide> {
<ide> use CookieCryptTrait;
<ide>
<add> /**
<add> * The list of cookies to encrypt/decrypt
<add> * @var array
<add> */
<ide> protected $cookieNames;
<add>
<add> /**
<add> * Encrpytion key to use.
<add> *
<add> * @var string
<add> */
<ide> protected $key;
<add>
<add> /**
<add> * Encryption type.
<add> *
<add> * @var string
<add> */
<ide> protected $cipherType;
<ide>
<add> /**
<add> * Constructor
<add> *
<add> * @param array $cookieNames The list of cookie names that should have their values encrypted.
<add> * @param string $key The encryption key to use.
<add> * @param string $cipherType The cipher type to use. Defaults to 'aes', but can also be 'rijndael' for
<add> * backwards compatibility.
<add> */
<ide> public function __construct(array $cookieNames = [], $key, $cipherType = 'aes')
<ide> {
<ide> $this->cookieNames = $cookieNames;
<ide> public function __construct(array $cookieNames = [], $key, $cipherType = 'aes')
<ide> }
<ide>
<ide> /**
<add> * Apply cookie encryption/decryption.
<add> *
<ide> * @param \Psr\Http\Message\ServerRequestInterface $request The request.
<ide> * @param \Psr\Http\Message\ResponseInterface $response The response.
<ide> * @param callable $next The next middleware to call.
<ide> public function __invoke(ServerRequestInterface $request, ResponseInterface $res
<ide> return $response;
<ide> }
<ide>
<add> /**
<add> * Fetch the cookie encryption key.
<add> *
<add> * Part of the CookieCryptTrait implementation.
<add> *
<add> * @return string
<add> */
<ide> protected function _getCookieEncryptionKey()
<ide> {
<ide> return $this->key;
<ide> }
<ide>
<add> /**
<add> * Decode cookies from the request.
<add> *
<add> * @param \Psr\Http\Message\ServerRequestInterface $request The request to decode cookies from.
<add> * @return \Psr\Http\Message\ServerRequestInterface Updated request with decoded cookies.
<add> */
<ide> protected function decodeCookies(ServerRequestInterface $request)
<ide> {
<ide> $cookies = $request->getCookieParams();
<ide> protected function decodeCookies(ServerRequestInterface $request)
<ide> return $request->withCookieParams($cookies);
<ide> }
<ide>
<add> /**
<add> * Encode cookies from a response's CookieCollection.
<add> *
<add> * @param \Psr\Http\Message\ResponseInterface $respons The response to encode cookies in.
<add> * @return \Psr\Http\Message\ResponseInterface Updated response with encoded cookies.
<add> */
<ide> protected function encodeCookies(Response $response)
<ide> {
<ide> $cookies = $response->getCookieCollection();
<ide> protected function encodeCookies(Response $response)
<ide> return $response;
<ide> }
<ide>
<add> /**
<add> * Encode cookies from a response's Set-Cookie header
<add> *
<add> * @param \Psr\Http\Message\ResponseInterface $respons The response to encode cookies in.
<add> * @return \Psr\Http\Message\ResponseInterface Updated response with encoded cookies.
<add> */
<ide> protected function encodeSetCookieHeader(ResponseInterface $response)
<ide> {
<ide> $cookies = CookieCollection::createFromHeader($response->getHeader('Set-Cookie')); | 1 |
Text | Text | remove useless code block in docs | 6468b6c9bf929bb2bd8177b491d642ebfc7e5f03 | <ide><path>packages/next/README.md
<ide> Please see our [contributing.md](/contributing.md).
<ide> - Tony Kovanen ([@tonykovanen](https://twitter.com/tonykovanen)) – [ZEIT](https://zeit.co)
<ide> - Guillermo Rauch ([@rauchg](https://twitter.com/rauchg)) – [ZEIT](https://zeit.co)
<ide> - Dan Zajdband ([@impronunciable](https://twitter.com/impronunciable)) – Knight-Mozilla / Coral Project
<del>
<del>```
<del>
<del>``` | 1 |
Python | Python | fix numpy.distutils to find atlas blas on ubuntu | 3f45eaa310b0ead7270d56697018173dc4b7daad | <ide><path>numpy/distutils/system_info.py
<ide> def _check_libs(self, lib_dirs, libs, opt_libs, exts):
<ide> found_libs, found_dirs = [], []
<ide> for dir_ in lib_dirs:
<ide> found_libs1 = self._lib_list(dir_, libs, exts)
<del> if found_libs1:
<del> found_libs.extend(found_libs1)
<del> found_dirs.append(dir_)
<add> # It's possible that we'll find the same library in multiple
<add> # directories. It's also possible that we'll find some
<add> # libraries on in directory, and some in another. So the
<add> # obvious thing would be to use a set instead of a list, but I
<add> # don't know if preserving order matters (does it?).
<add> for found_lib in found_libs1:
<add> if found_lib not in found_libs:
<add> found_libs.append(found_lib)
<add> if dir_ not in found_dirs:
<add> found_dirs.append(dir_)
<ide> else:
<ide> found_libs = self._lib_list(lib_dirs, libs, exts)
<ide> found_dirs = [lib_dirs] | 1 |
Ruby | Ruby | allow custom endpoints for s3 | 4dd44bc5e894d5a6e7f40881f318fa67e9aa1a77 | <ide><path>lib/active_storage/service/s3_service.rb
<ide> class ActiveStorage::Service::S3Service < ActiveStorage::Service
<ide> attr_reader :client, :bucket
<ide>
<del> def initialize(access_key_id:, secret_access_key:, region:, bucket:)
<del> @client = Aws::S3::Resource.new(access_key_id: access_key_id, secret_access_key: secret_access_key, region: region)
<add> def initialize(access_key_id:, secret_access_key:, region:, bucket:, endpoint: nil)
<add> @client = if endpoint
<add> Aws::S3::Resource.new(
<add> access_key_id: access_key_id,
<add> secret_access_key: secret_access_key,
<add> region: region,
<add> bucket: bucket
<add> )
<add> else
<add> Aws::S3::Resource.new(
<add> access_key_id: access_key_id,
<add> secret_access_key: secret_access_key,
<add> region: region,
<add> bucket: bucket,
<add> endpoint: endpoint
<add> )
<add> end
<add>
<ide> @bucket = @client.bucket(bucket)
<ide> end
<ide> | 1 |
Go | Go | skip testauthapi if no network is available | 2fae3d2693648d1c0f5cc079f37aaba5116ba5f9 | <ide><path>integration-cli/docker_api_auth_test.go
<ide> import (
<ide>
<ide> // Test case for #22244
<ide> func (s *DockerSuite) TestAuthApi(c *check.C) {
<add> testRequires(c, Network)
<ide> config := types.AuthConfig{
<ide> Username: "no-user",
<ide> Password: "no-password", | 1 |
Javascript | Javascript | add test for 18253 | bd7f49282a489663cccdb7a2a948a60c62a51f29 | <ide><path>packages/@ember/-internals/glimmer/tests/integration/components/tracked-test.js
<ide> if (EMBER_METAL_TRACKED_PROPERTIES) {
<ide> runTask(() => this.$('button').click());
<ide>
<ide> this.assertText('1');
<add>
<add> runTask(() => this.$('button').click());
<add>
<add> this.assertText('2');
<ide> }
<ide>
<ide> '@test nested getters update when dependent properties are invalidated'() { | 1 |
Mixed | Ruby | add upcase_first method | 7047e5562118d23c66c390b004f74ed35b90ab14 | <ide><path>activesupport/CHANGELOG.md
<add>* Add `String#upcase_first` method.
<add>
<add> *Glauco Custódio*
<add>
<ide> ## Rails 5.0.0.beta3 (February 24, 2016) ##
<ide>
<ide> * Deprecate arguments on `assert_nothing_raised`.
<ide><path>activesupport/lib/active_support/core_ext/string/inflections.rb
<ide> def humanize(options = {})
<ide> ActiveSupport::Inflector.humanize(self, options)
<ide> end
<ide>
<add> # Converts just the first character to uppercase.
<add> #
<add> # 'what a Lovely Day'.upcase_first # => "What a Lovely Day"
<add> def upcase_first
<add> ActiveSupport::Inflector.upcase_first(self)
<add> end
<add>
<ide> # Creates a foreign key name from a class name.
<ide> # +separate_class_name_and_id_with_underscore+ sets whether
<ide> # the method should put '_' between the name and 'id'.
<ide><path>activesupport/lib/active_support/inflector/methods.rb
<ide> def humanize(lower_case_and_underscored_word, options = {})
<ide> result
<ide> end
<ide>
<add> # Converts just the first character to uppercase.
<add> #
<add> # 'what a Lovely Day'.upcase_first # => "What a Lovely Day"
<add> def upcase_first(string)
<add> string[0].upcase.concat(string[1..-1])
<add> end
<add>
<ide> # Capitalizes all the words and replaces some characters in the string to
<ide> # create a nicer looking title. +titleize+ is meant for creating pretty
<ide> # output. It is not used in the Rails internals.
<ide><path>activesupport/test/core_ext/string_ext_test.rb
<ide> def test_titleize
<ide> end
<ide> end
<ide>
<add> def test_upcase_first
<add> assert_equal "What a Lovely Day", "what a Lovely Day".upcase_first
<add> end
<add>
<ide> def test_camelize
<ide> CamelToUnderscore.each do |camel, underscore|
<ide> assert_equal(camel, underscore.camelize) | 4 |
Javascript | Javascript | remove obsolete locale files | 6382e21fb28541a2484ac1a241d41cf9fbbe9d2c | <ide><path>src/ngLocale/angular-locale_chr.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["ᎤᏃᎸᏔᏅ","ᎧᎦᎵ","ᎠᏅᏱ","ᎧᏬᏂ","ᎠᏂᏍᎬᏘ","ᏕᎭᎷᏱ","ᎫᏰᏉᏂ","ᎦᎶᏂ","ᏚᎵᏍᏗ","ᏚᏂᏅᏗ","ᏅᏓᏕᏆ","ᎤᏍᎩᏱ"],"SHORTMONTH":["ᎤᏃ","ᎧᎦ","ᎠᏅ","ᎧᏬ","ᎠᏂ","ᏕᎭ","ᎫᏰ","ᎦᎶ","ᏚᎵ","ᏚᏂ","ᏅᏓ","ᎤᏍ"],"DAY":["ᎤᎾᏙᏓᏆᏍᎬ","ᎤᎾᏙᏓᏉᏅᎯ","ᏔᎵᏁᎢᎦ","ᏦᎢᏁᎢᎦ","ᏅᎩᏁᎢᎦ","ᏧᎾᎩᎶᏍᏗ","ᎤᎾᏙᏓᏈᏕᎾ"],"SHORTDAY":["ᏆᏍᎬ","ᏉᏅᎯ","ᏔᎵᏁ","ᏦᎢᏁ","ᏅᎩᏁ","ᏧᎾᎩ","ᏈᏕᎾ"],"AMPMS":["ᏌᎾᎴ","ᏒᎯᏱᎢᏗᏢ"],"medium":"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a","fullDate":"EEEE, MMMM d, y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"id":"chr"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_cy.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffenaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],"SHORTMONTH":["Ion","Chwef","Mawrth","Ebrill","Mai","Meh","Gorff","Awst","Medi","Hyd","Tach","Rhag"],"DAY":["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"],"SHORTDAY":["Sul","Llun","Maw","Mer","Iau","Gwen","Sad"],"AMPMS":["AM","PM"],"medium":"d MMM y HH:mm:ss","short":"dd/MM/yyyy HH:mm","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"dd/MM/yyyy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"id":"cy"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_el-polyton.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":",","GROUP_SEP":".","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"€"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],"SHORTMONTH":["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],"DAY":["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],"SHORTDAY":["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],"AMPMS":["π.μ.","μ.μ."],"medium":"d MMM y h:mm:ss a","short":"d/M/yy h:mm a","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"d/M/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"id":"el-polyton"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_en-zz.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4","posSuf":"","negPre":"(\u00A4","negSuf":")","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"$"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["January","February","March","April","May","June","July","August","September","October","November","December"],"SHORTMONTH":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"DAY":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"SHORTDAY":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"AMPMS":["AM","PM"],"medium":"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a","fullDate":"EEEE, MMMM d, y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"id":"en-zz"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_fr-rw.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "dimanche",
<del> "1": "lundi",
<del> "2": "mardi",
<del> "3": "mercredi",
<del> "4": "jeudi",
<del> "5": "vendredi",
<del> "6": "samedi"
<del> },
<del> "MONTH": {
<del> "0": "janvier",
<del> "1": "f\u00e9vrier",
<del> "2": "mars",
<del> "3": "avril",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juillet",
<del> "7": "ao\u00fbt",
<del> "8": "septembre",
<del> "9": "octobre",
<del> "10": "novembre",
<del> "11": "d\u00e9cembre"
<del> },
<del> "SHORTDAY": {
<del> "0": "dim.",
<del> "1": "lun.",
<del> "2": "mar.",
<del> "3": "mer.",
<del> "4": "jeu.",
<del> "5": "ven.",
<del> "6": "sam."
<del> },
<del> "SHORTMONTH": {
<del> "0": "janv.",
<del> "1": "f\u00e9vr.",
<del> "2": "mars",
<del> "3": "avr.",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juil.",
<del> "7": "ao\u00fbt",
<del> "8": "sept.",
<del> "9": "oct.",
<del> "10": "nov.",
<del> "11": "d\u00e9c."
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "\u20ac",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": "\u00a0",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(",
<del> "negSuf": "\u00a0\u00a4)",
<del> "posPre": "",
<del> "posSuf": "\u00a0\u00a4"
<del> }
<del> }
<del> },
<del> "id": "fr-rw",
<del> "pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_fr-sn.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "dimanche",
<del> "1": "lundi",
<del> "2": "mardi",
<del> "3": "mercredi",
<del> "4": "jeudi",
<del> "5": "vendredi",
<del> "6": "samedi"
<del> },
<del> "MONTH": {
<del> "0": "janvier",
<del> "1": "f\u00e9vrier",
<del> "2": "mars",
<del> "3": "avril",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juillet",
<del> "7": "ao\u00fbt",
<del> "8": "septembre",
<del> "9": "octobre",
<del> "10": "novembre",
<del> "11": "d\u00e9cembre"
<del> },
<del> "SHORTDAY": {
<del> "0": "dim.",
<del> "1": "lun.",
<del> "2": "mar.",
<del> "3": "mer.",
<del> "4": "jeu.",
<del> "5": "ven.",
<del> "6": "sam."
<del> },
<del> "SHORTMONTH": {
<del> "0": "janv.",
<del> "1": "f\u00e9vr.",
<del> "2": "mars",
<del> "3": "avr.",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juil.",
<del> "7": "ao\u00fbt",
<del> "8": "sept.",
<del> "9": "oct.",
<del> "10": "nov.",
<del> "11": "d\u00e9c."
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "\u20ac",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": "\u00a0",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(",
<del> "negSuf": "\u00a0\u00a4)",
<del> "posPre": "",
<del> "posSuf": "\u00a0\u00a4"
<del> }
<del> }
<del> },
<del> "id": "fr-sn",
<del> "pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_fr-td.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "dimanche",
<del> "1": "lundi",
<del> "2": "mardi",
<del> "3": "mercredi",
<del> "4": "jeudi",
<del> "5": "vendredi",
<del> "6": "samedi"
<del> },
<del> "MONTH": {
<del> "0": "janvier",
<del> "1": "f\u00e9vrier",
<del> "2": "mars",
<del> "3": "avril",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juillet",
<del> "7": "ao\u00fbt",
<del> "8": "septembre",
<del> "9": "octobre",
<del> "10": "novembre",
<del> "11": "d\u00e9cembre"
<del> },
<del> "SHORTDAY": {
<del> "0": "dim.",
<del> "1": "lun.",
<del> "2": "mar.",
<del> "3": "mer.",
<del> "4": "jeu.",
<del> "5": "ven.",
<del> "6": "sam."
<del> },
<del> "SHORTMONTH": {
<del> "0": "janv.",
<del> "1": "f\u00e9vr.",
<del> "2": "mars",
<del> "3": "avr.",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juil.",
<del> "7": "ao\u00fbt",
<del> "8": "sept.",
<del> "9": "oct.",
<del> "10": "nov.",
<del> "11": "d\u00e9c."
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "\u20ac",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": "\u00a0",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(",
<del> "negSuf": "\u00a0\u00a4)",
<del> "posPre": "",
<del> "posSuf": "\u00a0\u00a4"
<del> }
<del> }
<del> },
<del> "id": "fr-td",
<del> "pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_fr-tg.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "dimanche",
<del> "1": "lundi",
<del> "2": "mardi",
<del> "3": "mercredi",
<del> "4": "jeudi",
<del> "5": "vendredi",
<del> "6": "samedi"
<del> },
<del> "MONTH": {
<del> "0": "janvier",
<del> "1": "février",
<del> "2": "mars",
<del> "3": "avril",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juillet",
<del> "7": "août",
<del> "8": "septembre",
<del> "9": "octobre",
<del> "10": "novembre",
<del> "11": "décembre"
<del> },
<del> "SHORTDAY": {
<del> "0": "dim.",
<del> "1": "lun.",
<del> "2": "mar.",
<del> "3": "mer.",
<del> "4": "jeu.",
<del> "5": "ven.",
<del> "6": "sam."
<del> },
<del> "SHORTMONTH": {
<del> "0": "janv.",
<del> "1": "févr.",
<del> "2": "mars",
<del> "3": "avr.",
<del> "4": "mai",
<del> "5": "juin",
<del> "6": "juil.",
<del> "7": "août",
<del> "8": "sept.",
<del> "9": "oct.",
<del> "10": "nov.",
<del> "11": "déc."
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "€",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": " ",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(",
<del> "negSuf": " \u00A4)",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "fr-tg",
<del> "pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_haw.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["Ianuali","Pepeluali","Malaki","ʻApelila","Mei","Iune","Iulai","ʻAukake","Kepakemapa","ʻOkakopa","Nowemapa","Kekemapa"],"SHORTMONTH":["Ian.","Pep.","Mal.","ʻAp.","Mei","Iun.","Iul.","ʻAu.","Kep.","ʻOk.","Now.","Kek."],"DAY":["Lāpule","Poʻakahi","Poʻalua","Poʻakolu","Poʻahā","Poʻalima","Poʻaono"],"SHORTDAY":["LP","P1","P2","P3","P4","P5","P6"],"AMPMS":["AM","PM"],"medium":"d MMM y h:mm:ss a","short":"d/M/yy h:mm a","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"d/M/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"id":"haw"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_it-ch.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "m.",
<del> "1": "p."
<del> },
<del> "DAY": {
<del> "0": "domenica",
<del> "1": "lunedì",
<del> "2": "martedì",
<del> "3": "mercoledì",
<del> "4": "giovedì",
<del> "5": "venerdì",
<del> "6": "sabato"
<del> },
<del> "MONTH": {
<del> "0": "gennaio",
<del> "1": "febbraio",
<del> "2": "marzo",
<del> "3": "aprile",
<del> "4": "maggio",
<del> "5": "giugno",
<del> "6": "luglio",
<del> "7": "agosto",
<del> "8": "settembre",
<del> "9": "ottobre",
<del> "10": "novembre",
<del> "11": "dicembre"
<del> },
<del> "SHORTDAY": {
<del> "0": "dom",
<del> "1": "lun",
<del> "2": "mar",
<del> "3": "mer",
<del> "4": "gio",
<del> "5": "ven",
<del> "6": "sab"
<del> },
<del> "SHORTMONTH": {
<del> "0": "gen",
<del> "1": "feb",
<del> "2": "mar",
<del> "3": "apr",
<del> "4": "mag",
<del> "5": "giu",
<del> "6": "lug",
<del> "7": "ago",
<del> "8": "set",
<del> "9": "ott",
<del> "10": "nov",
<del> "11": "dic"
<del> },
<del> "fullDate": "EEEE, d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d-MMM-y HH:mm:ss",
<del> "mediumDate": "d-MMM-y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd.MM.yy HH:mm",
<del> "shortDate": "dd.MM.yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "€",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "\u00A4 -",
<del> "negSuf": "",
<del> "posPre": "\u00A4 ",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "it-ch",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ln-cg.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "ntɔ́ngɔ́",
<del> "1": "mpókwa"
<del> },
<del> "DAY": {
<del> "0": "eyenga",
<del> "1": "mokɔlɔ mwa yambo",
<del> "2": "mokɔlɔ mwa míbalé",
<del> "3": "mokɔlɔ mwa mísáto",
<del> "4": "mokɔlɔ ya mínéi",
<del> "5": "mokɔlɔ ya mítáno",
<del> "6": "mpɔ́sɔ"
<del> },
<del> "MONTH": {
<del> "0": "sánzá ya yambo",
<del> "1": "sánzá ya míbalé",
<del> "2": "sánzá ya mísáto",
<del> "3": "sánzá ya mínei",
<del> "4": "sánzá ya mítáno",
<del> "5": "sánzá ya motóbá",
<del> "6": "sánzá ya nsambo",
<del> "7": "sánzá ya mwambe",
<del> "8": "sánzá ya libwa",
<del> "9": "sánzá ya zómi",
<del> "10": "sánzá ya zómi na mɔ̌kɔ́",
<del> "11": "sánzá ya zómi na míbalé"
<del> },
<del> "SHORTDAY": {
<del> "0": "eye",
<del> "1": "ybo",
<del> "2": "mbl",
<del> "3": "mst",
<del> "4": "min",
<del> "5": "mtn",
<del> "6": "mps"
<del> },
<del> "SHORTMONTH": {
<del> "0": "yan",
<del> "1": "fbl",
<del> "2": "msi",
<del> "3": "apl",
<del> "4": "mai",
<del> "5": "yun",
<del> "6": "yul",
<del> "7": "agt",
<del> "8": "stb",
<del> "9": "ɔtb",
<del> "10": "nvb",
<del> "11": "dsb"
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "d/M/yyyy HH:mm",
<del> "shortDate": "d/M/yyyy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "FrCD",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "ln-cg",
<del> "pluralCat": function (n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_mo.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],"SHORTMONTH":["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],"DAY":["duminică","luni","marți","miercuri","joi","vineri","sâmbătă"],"SHORTDAY":["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],"AMPMS":["AM","PM"],"medium":"dd.MM.yyyy HH:mm:ss","short":"dd.MM.yyyy HH:mm","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"dd.MM.yyyy","shortDate":"dd.MM.yyyy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"NUMBER_FORMATS":{"DECIMAL_SEP":",","GROUP_SEP":".","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"MDL"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 0 || n != 1 && (n % 100) >= 1 && (n % 100) <= 19 && n == Math.floor(n)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;},"id":"mo"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ms-bn.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "PG",
<del> "1": "PTG"
<del> },
<del> "DAY": {
<del> "0": "Ahad",
<del> "1": "Isnin",
<del> "2": "Selasa",
<del> "3": "Rabu",
<del> "4": "Khamis",
<del> "5": "Jumaat",
<del> "6": "Sabtu"
<del> },
<del> "MONTH": {
<del> "0": "Januari",
<del> "1": "Februari",
<del> "2": "Mac",
<del> "3": "April",
<del> "4": "Mei",
<del> "5": "Jun",
<del> "6": "Julai",
<del> "7": "Ogos",
<del> "8": "September",
<del> "9": "Oktober",
<del> "10": "November",
<del> "11": "Disember"
<del> },
<del> "SHORTDAY": {
<del> "0": "Ahd",
<del> "1": "Isn",
<del> "2": "Sel",
<del> "3": "Rab",
<del> "4": "Kha",
<del> "5": "Jum",
<del> "6": "Sab"
<del> },
<del> "SHORTMONTH": {
<del> "0": "Jan",
<del> "1": "Feb",
<del> "2": "Mac",
<del> "3": "Apr",
<del> "4": "Mei",
<del> "5": "Jun",
<del> "6": "Jul",
<del> "7": "Ogos",
<del> "8": "Sep",
<del> "9": "Okt",
<del> "10": "Nov",
<del> "11": "Dis"
<del> },
<del> "fullDate": "dd MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "dd/MM/yyyy h:mm:ss a",
<del> "mediumDate": "dd/MM/yyyy",
<del> "mediumTime": "h:mm:ss a",
<del> "short": "d/MM/yy h:mm a",
<del> "shortDate": "d/MM/yy",
<del> "shortTime": "h:mm a"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "RM",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "ms-bn",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_nl-aw.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "zondag",
<del> "1": "maandag",
<del> "2": "dinsdag",
<del> "3": "woensdag",
<del> "4": "donderdag",
<del> "5": "vrijdag",
<del> "6": "zaterdag"
<del> },
<del> "MONTH": {
<del> "0": "januari",
<del> "1": "februari",
<del> "2": "maart",
<del> "3": "april",
<del> "4": "mei",
<del> "5": "juni",
<del> "6": "juli",
<del> "7": "augustus",
<del> "8": "september",
<del> "9": "oktober",
<del> "10": "november",
<del> "11": "december"
<del> },
<del> "SHORTDAY": {
<del> "0": "zo",
<del> "1": "ma",
<del> "2": "di",
<del> "3": "wo",
<del> "4": "do",
<del> "5": "vr",
<del> "6": "za"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan.",
<del> "1": "feb.",
<del> "2": "mrt.",
<del> "3": "apr.",
<del> "4": "mei",
<del> "5": "jun.",
<del> "6": "jul.",
<del> "7": "aug.",
<del> "8": "sep.",
<del> "9": "okt.",
<del> "10": "nov.",
<del> "11": "dec."
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd-MM-yy HH:mm",
<del> "shortDate": "dd-MM-yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "€",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "\u00A4 ",
<del> "negSuf": "-",
<del> "posPre": "\u00A4 ",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "nl-aw",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_nl-be.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "zondag",
<del> "1": "maandag",
<del> "2": "dinsdag",
<del> "3": "woensdag",
<del> "4": "donderdag",
<del> "5": "vrijdag",
<del> "6": "zaterdag"
<del> },
<del> "MONTH": {
<del> "0": "januari",
<del> "1": "februari",
<del> "2": "maart",
<del> "3": "april",
<del> "4": "mei",
<del> "5": "juni",
<del> "6": "juli",
<del> "7": "augustus",
<del> "8": "september",
<del> "9": "oktober",
<del> "10": "november",
<del> "11": "december"
<del> },
<del> "SHORTDAY": {
<del> "0": "zo",
<del> "1": "ma",
<del> "2": "di",
<del> "3": "wo",
<del> "4": "do",
<del> "5": "vr",
<del> "6": "za"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan.",
<del> "1": "feb.",
<del> "2": "mrt.",
<del> "3": "apr.",
<del> "4": "mei",
<del> "5": "jun.",
<del> "6": "jul.",
<del> "7": "aug.",
<del> "8": "sep.",
<del> "9": "okt.",
<del> "10": "nov.",
<del> "11": "dec."
<del> },
<del> "fullDate": "EEEE d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d-MMM-y HH:mm:ss",
<del> "mediumDate": "d-MMM-y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "d/MM/yy HH:mm",
<del> "shortDate": "d/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "€",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "\u00A4 ",
<del> "negSuf": "-",
<del> "posPre": "\u00A4 ",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "nl-be",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_pt-ao.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "domingo",
<del> "1": "segunda-feira",
<del> "2": "terça-feira",
<del> "3": "quarta-feira",
<del> "4": "quinta-feira",
<del> "5": "sexta-feira",
<del> "6": "sábado"
<del> },
<del> "MONTH": {
<del> "0": "janeiro",
<del> "1": "fevereiro",
<del> "2": "março",
<del> "3": "abril",
<del> "4": "maio",
<del> "5": "junho",
<del> "6": "julho",
<del> "7": "agosto",
<del> "8": "setembro",
<del> "9": "outubro",
<del> "10": "novembro",
<del> "11": "dezembro"
<del> },
<del> "SHORTDAY": {
<del> "0": "dom",
<del> "1": "seg",
<del> "2": "ter",
<del> "3": "qua",
<del> "4": "qui",
<del> "5": "sex",
<del> "6": "sáb"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "fev",
<del> "2": "mar",
<del> "3": "abr",
<del> "4": "mai",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "ago",
<del> "8": "set",
<del> "9": "out",
<del> "10": "nov",
<del> "11": "dez"
<del> },
<del> "fullDate": "EEEE, d 'de' MMMM 'de' y",
<del> "longDate": "d 'de' MMMM 'de' y",
<del> "medium": "dd/MM/yyyy HH:mm:ss",
<del> "mediumDate": "dd/MM/yyyy",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "R$",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "pt-ao",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_pt-gw.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "domingo",
<del> "1": "segunda-feira",
<del> "2": "terça-feira",
<del> "3": "quarta-feira",
<del> "4": "quinta-feira",
<del> "5": "sexta-feira",
<del> "6": "sábado"
<del> },
<del> "MONTH": {
<del> "0": "janeiro",
<del> "1": "fevereiro",
<del> "2": "março",
<del> "3": "abril",
<del> "4": "maio",
<del> "5": "junho",
<del> "6": "julho",
<del> "7": "agosto",
<del> "8": "setembro",
<del> "9": "outubro",
<del> "10": "novembro",
<del> "11": "dezembro"
<del> },
<del> "SHORTDAY": {
<del> "0": "dom",
<del> "1": "seg",
<del> "2": "ter",
<del> "3": "qua",
<del> "4": "qui",
<del> "5": "sex",
<del> "6": "sáb"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "fev",
<del> "2": "mar",
<del> "3": "abr",
<del> "4": "mai",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "ago",
<del> "8": "set",
<del> "9": "out",
<del> "10": "nov",
<del> "11": "dez"
<del> },
<del> "fullDate": "EEEE, d 'de' MMMM 'de' y",
<del> "longDate": "d 'de' MMMM 'de' y",
<del> "medium": "dd/MM/yyyy HH:mm:ss",
<del> "mediumDate": "dd/MM/yyyy",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "R$",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "pt-gw",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_pt-mz.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "domingo",
<del> "1": "segunda-feira",
<del> "2": "terça-feira",
<del> "3": "quarta-feira",
<del> "4": "quinta-feira",
<del> "5": "sexta-feira",
<del> "6": "sábado"
<del> },
<del> "MONTH": {
<del> "0": "janeiro",
<del> "1": "fevereiro",
<del> "2": "março",
<del> "3": "abril",
<del> "4": "maio",
<del> "5": "junho",
<del> "6": "julho",
<del> "7": "agosto",
<del> "8": "setembro",
<del> "9": "outubro",
<del> "10": "novembro",
<del> "11": "dezembro"
<del> },
<del> "SHORTDAY": {
<del> "0": "dom",
<del> "1": "seg",
<del> "2": "ter",
<del> "3": "qua",
<del> "4": "qui",
<del> "5": "sex",
<del> "6": "sáb"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "fev",
<del> "2": "mar",
<del> "3": "abr",
<del> "4": "mai",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "ago",
<del> "8": "set",
<del> "9": "out",
<del> "10": "nov",
<del> "11": "dez"
<del> },
<del> "fullDate": "EEEE, d 'de' MMMM 'de' y",
<del> "longDate": "d 'de' MMMM 'de' y",
<del> "medium": "dd/MM/yyyy HH:mm:ss",
<del> "mediumDate": "dd/MM/yyyy",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "R$",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "pt-mz",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_pt-st.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "domingo",
<del> "1": "segunda-feira",
<del> "2": "terça-feira",
<del> "3": "quarta-feira",
<del> "4": "quinta-feira",
<del> "5": "sexta-feira",
<del> "6": "sábado"
<del> },
<del> "MONTH": {
<del> "0": "janeiro",
<del> "1": "fevereiro",
<del> "2": "março",
<del> "3": "abril",
<del> "4": "maio",
<del> "5": "junho",
<del> "6": "julho",
<del> "7": "agosto",
<del> "8": "setembro",
<del> "9": "outubro",
<del> "10": "novembro",
<del> "11": "dezembro"
<del> },
<del> "SHORTDAY": {
<del> "0": "dom",
<del> "1": "seg",
<del> "2": "ter",
<del> "3": "qua",
<del> "4": "qui",
<del> "5": "sex",
<del> "6": "sáb"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "fev",
<del> "2": "mar",
<del> "3": "abr",
<del> "4": "mai",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "ago",
<del> "8": "set",
<del> "9": "out",
<del> "10": "nov",
<del> "11": "dez"
<del> },
<del> "fullDate": "EEEE, d 'de' MMMM 'de' y",
<del> "longDate": "d 'de' MMMM 'de' y",
<del> "medium": "dd/MM/yyyy HH:mm:ss",
<del> "mediumDate": "dd/MM/yyyy",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd/MM/yy HH:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "R$",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "pt-st",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ro-md.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "AM",
<del> "1": "PM"
<del> },
<del> "DAY": {
<del> "0": "duminică",
<del> "1": "luni",
<del> "2": "marți",
<del> "3": "miercuri",
<del> "4": "joi",
<del> "5": "vineri",
<del> "6": "sâmbătă"
<del> },
<del> "MONTH": {
<del> "0": "ianuarie",
<del> "1": "februarie",
<del> "2": "martie",
<del> "3": "aprilie",
<del> "4": "mai",
<del> "5": "iunie",
<del> "6": "iulie",
<del> "7": "august",
<del> "8": "septembrie",
<del> "9": "octombrie",
<del> "10": "noiembrie",
<del> "11": "decembrie"
<del> },
<del> "SHORTDAY": {
<del> "0": "Du",
<del> "1": "Lu",
<del> "2": "Ma",
<del> "3": "Mi",
<del> "4": "Jo",
<del> "5": "Vi",
<del> "6": "Sâ"
<del> },
<del> "SHORTMONTH": {
<del> "0": "ian.",
<del> "1": "feb.",
<del> "2": "mar.",
<del> "3": "apr.",
<del> "4": "mai",
<del> "5": "iun.",
<del> "6": "iul.",
<del> "7": "aug.",
<del> "8": "sept.",
<del> "9": "oct.",
<del> "10": "nov.",
<del> "11": "dec."
<del> },
<del> "fullDate": "EEEE, d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "dd.MM.yyyy HH:mm:ss",
<del> "mediumDate": "dd.MM.yyyy",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd.MM.yyyy HH:mm",
<del> "shortDate": "dd.MM.yyyy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "RON",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "ro-md",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 0 || n != 1 && n == (n | 0) && n % 100 >= 1 && n % 100 <= 19) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ru-md.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "до полудня",
<del> "1": "после полудня"
<del> },
<del> "DAY": {
<del> "0": "воскресенье",
<del> "1": "понедельник",
<del> "2": "вторник",
<del> "3": "среда",
<del> "4": "четверг",
<del> "5": "пятница",
<del> "6": "суббота"
<del> },
<del> "MONTH": {
<del> "0": "января",
<del> "1": "февраля",
<del> "2": "марта",
<del> "3": "апреля",
<del> "4": "мая",
<del> "5": "июня",
<del> "6": "июля",
<del> "7": "августа",
<del> "8": "сентября",
<del> "9": "октября",
<del> "10": "ноября",
<del> "11": "декабря"
<del> },
<del> "SHORTDAY": {
<del> "0": "вс",
<del> "1": "пн",
<del> "2": "вт",
<del> "3": "ср",
<del> "4": "чт",
<del> "5": "пт",
<del> "6": "сб"
<del> },
<del> "SHORTMONTH": {
<del> "0": "янв.",
<del> "1": "февр.",
<del> "2": "марта",
<del> "3": "апр.",
<del> "4": "мая",
<del> "5": "июня",
<del> "6": "июля",
<del> "7": "авг.",
<del> "8": "сент.",
<del> "9": "окт.",
<del> "10": "нояб.",
<del> "11": "дек."
<del> },
<del> "fullDate": "EEEE, d MMMM y 'г'.",
<del> "longDate": "d MMMM y 'г'.",
<del> "medium": "dd.MM.yyyy H:mm:ss",
<del> "mediumDate": "dd.MM.yyyy",
<del> "mediumTime": "H:mm:ss",
<del> "short": "dd.MM.yy H:mm",
<del> "shortDate": "dd.MM.yy",
<del> "shortTime": "H:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "руб.",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": " ",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "ru-md",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ru-ua.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "до полудня",
<del> "1": "после полудня"
<del> },
<del> "DAY": {
<del> "0": "воскресенье",
<del> "1": "понедельник",
<del> "2": "вторник",
<del> "3": "среда",
<del> "4": "четверг",
<del> "5": "пятница",
<del> "6": "суббота"
<del> },
<del> "MONTH": {
<del> "0": "января",
<del> "1": "февраля",
<del> "2": "марта",
<del> "3": "апреля",
<del> "4": "мая",
<del> "5": "июня",
<del> "6": "июля",
<del> "7": "августа",
<del> "8": "сентября",
<del> "9": "октября",
<del> "10": "ноября",
<del> "11": "декабря"
<del> },
<del> "SHORTDAY": {
<del> "0": "вс",
<del> "1": "пн",
<del> "2": "вт",
<del> "3": "ср",
<del> "4": "чт",
<del> "5": "пт",
<del> "6": "сб"
<del> },
<del> "SHORTMONTH": {
<del> "0": "янв.",
<del> "1": "февр.",
<del> "2": "марта",
<del> "3": "апр.",
<del> "4": "мая",
<del> "5": "июня",
<del> "6": "июля",
<del> "7": "авг.",
<del> "8": "сент.",
<del> "9": "окт.",
<del> "10": "нояб.",
<del> "11": "дек."
<del> },
<del> "fullDate": "EEEE, d MMMM y 'г'.",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "dd.MM.yy HH:mm",
<del> "shortDate": "dd.MM.yy",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "руб.",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": " ",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "ru-ua",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-cyrl-ba.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "пре подне",
<del> "1": "поподне"
<del> },
<del> "DAY": {
<del> "0": "недеља",
<del> "1": "понедељак",
<del> "2": "уторак",
<del> "3": "сриједа",
<del> "4": "четвртак",
<del> "5": "петак",
<del> "6": "субота"
<del> },
<del> "MONTH": {
<del> "0": "јануар",
<del> "1": "фебруар",
<del> "2": "март",
<del> "3": "април",
<del> "4": "мај",
<del> "5": "јуни",
<del> "6": "јули",
<del> "7": "август",
<del> "8": "септембар",
<del> "9": "октобар",
<del> "10": "новембар",
<del> "11": "децембар"
<del> },
<del> "SHORTDAY": {
<del> "0": "нед",
<del> "1": "пон",
<del> "2": "уто",
<del> "3": "сри",
<del> "4": "чет",
<del> "5": "пет",
<del> "6": "суб"
<del> },
<del> "SHORTMONTH": {
<del> "0": "јан",
<del> "1": "феб",
<del> "2": "мар",
<del> "3": "апр",
<del> "4": "мај",
<del> "5": "јун",
<del> "6": "јул",
<del> "7": "авг",
<del> "8": "сеп",
<del> "9": "окт",
<del> "10": "нов",
<del> "11": "дец"
<del> },
<del> "fullDate": "EEEE, dd. MMMM y.",
<del> "longDate": "dd. MMMM y.",
<del> "medium": "yyyy-MM-dd HH:mm:ss",
<del> "mediumDate": "yyyy-MM-dd",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "yy-MM-dd HH:mm",
<del> "shortDate": "yy-MM-dd",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "din",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sr-cyrl-ba",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-cyrl-me.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "пре подне",
<del> "1": "поподне"
<del> },
<del> "DAY": {
<del> "0": "недеља",
<del> "1": "понедељак",
<del> "2": "уторак",
<del> "3": "среда",
<del> "4": "четвртак",
<del> "5": "петак",
<del> "6": "субота"
<del> },
<del> "MONTH": {
<del> "0": "јануар",
<del> "1": "фебруар",
<del> "2": "март",
<del> "3": "април",
<del> "4": "мај",
<del> "5": "јун",
<del> "6": "јул",
<del> "7": "август",
<del> "8": "септембар",
<del> "9": "октобар",
<del> "10": "новембар",
<del> "11": "децембар"
<del> },
<del> "SHORTDAY": {
<del> "0": "нед",
<del> "1": "пон",
<del> "2": "уто",
<del> "3": "сре",
<del> "4": "чет",
<del> "5": "пет",
<del> "6": "суб"
<del> },
<del> "SHORTMONTH": {
<del> "0": "јан",
<del> "1": "феб",
<del> "2": "мар",
<del> "3": "апр",
<del> "4": "мај",
<del> "5": "јун",
<del> "6": "јул",
<del> "7": "авг",
<del> "8": "сеп",
<del> "9": "окт",
<del> "10": "нов",
<del> "11": "дец"
<del> },
<del> "fullDate": "EEEE, dd. MMMM y.",
<del> "longDate": "dd. MMMM y.",
<del> "medium": "dd.MM.y. HH.mm.ss",
<del> "mediumDate": "dd.MM.y.",
<del> "mediumTime": "HH.mm.ss",
<del> "short": "d.M.yy. HH.mm",
<del> "shortDate": "d.M.yy.",
<del> "shortTime": "HH.mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "din",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sr-cyrl-me",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-cyrl.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "пре подне",
<del> "1": "поподне"
<del> },
<del> "DAY": {
<del> "0": "недеља",
<del> "1": "понедељак",
<del> "2": "уторак",
<del> "3": "среда",
<del> "4": "четвртак",
<del> "5": "петак",
<del> "6": "субота"
<del> },
<del> "MONTH": {
<del> "0": "јануар",
<del> "1": "фебруар",
<del> "2": "март",
<del> "3": "април",
<del> "4": "мај",
<del> "5": "јун",
<del> "6": "јул",
<del> "7": "август",
<del> "8": "септембар",
<del> "9": "октобар",
<del> "10": "новембар",
<del> "11": "децембар"
<del> },
<del> "SHORTDAY": {
<del> "0": "нед",
<del> "1": "пон",
<del> "2": "уто",
<del> "3": "сре",
<del> "4": "чет",
<del> "5": "пет",
<del> "6": "суб"
<del> },
<del> "SHORTMONTH": {
<del> "0": "јан",
<del> "1": "феб",
<del> "2": "мар",
<del> "3": "апр",
<del> "4": "мај",
<del> "5": "јун",
<del> "6": "јул",
<del> "7": "авг",
<del> "8": "сеп",
<del> "9": "окт",
<del> "10": "нов",
<del> "11": "дец"
<del> },
<del> "fullDate": "EEEE, dd. MMMM y.",
<del> "longDate": "dd. MMMM y.",
<del> "medium": "dd.MM.y. HH.mm.ss",
<del> "mediumDate": "dd.MM.y.",
<del> "mediumTime": "HH.mm.ss",
<del> "short": "d.M.yy. HH.mm",
<del> "shortDate": "d.M.yy.",
<del> "shortTime": "HH.mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "din",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sr-cyrl",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-latn-ba.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "pre podne",
<del> "1": "popodne"
<del> },
<del> "DAY": {
<del> "0": "nedelja",
<del> "1": "ponedeljak",
<del> "2": "utorak",
<del> "3": "sreda",
<del> "4": "četvrtak",
<del> "5": "petak",
<del> "6": "subota"
<del> },
<del> "MONTH": {
<del> "0": "januar",
<del> "1": "februar",
<del> "2": "mart",
<del> "3": "april",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "avgust",
<del> "8": "septembar",
<del> "9": "oktobar",
<del> "10": "novembar",
<del> "11": "decembar"
<del> },
<del> "SHORTDAY": {
<del> "0": "ned",
<del> "1": "pon",
<del> "2": "uto",
<del> "3": "sre",
<del> "4": "čet",
<del> "5": "pet",
<del> "6": "sub"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "feb",
<del> "2": "mar",
<del> "3": "apr",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "avg",
<del> "8": "sep",
<del> "9": "okt",
<del> "10": "nov",
<del> "11": "dec"
<del> },
<del> "fullDate": "EEEE, dd. MMMM y.",
<del> "longDate": "dd. MMMM y.",
<del> "medium": "dd.MM.y. HH.mm.ss",
<del> "mediumDate": "dd.MM.y.",
<del> "mediumTime": "HH.mm.ss",
<del> "short": "d.M.yy. HH.mm",
<del> "shortDate": "d.M.yy.",
<del> "shortTime": "HH.mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "din",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sr-latn-ba",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-latn-me.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "pre podne",
<del> "1": "popodne"
<del> },
<del> "DAY": {
<del> "0": "nedelja",
<del> "1": "ponedeljak",
<del> "2": "utorak",
<del> "3": "sreda",
<del> "4": "četvrtak",
<del> "5": "petak",
<del> "6": "subota"
<del> },
<del> "MONTH": {
<del> "0": "januar",
<del> "1": "februar",
<del> "2": "mart",
<del> "3": "april",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "avgust",
<del> "8": "septembar",
<del> "9": "oktobar",
<del> "10": "novembar",
<del> "11": "decembar"
<del> },
<del> "SHORTDAY": {
<del> "0": "ned",
<del> "1": "pon",
<del> "2": "uto",
<del> "3": "sre",
<del> "4": "čet",
<del> "5": "pet",
<del> "6": "sub"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "feb",
<del> "2": "mar",
<del> "3": "apr",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "avg",
<del> "8": "sep",
<del> "9": "okt",
<del> "10": "nov",
<del> "11": "dec"
<del> },
<del> "fullDate": "EEEE, dd. MMMM y.",
<del> "longDate": "d.MM.yyyy.",
<del> "medium": "dd.MM.y. HH.mm.ss",
<del> "mediumDate": "dd.MM.y.",
<del> "mediumTime": "HH.mm.ss",
<del> "short": "d.M.yy. HH.mm",
<del> "shortDate": "d.M.yy.",
<del> "shortTime": "HH.mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "din",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sr-latn-me",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-latn.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "pre podne",
<del> "1": "popodne"
<del> },
<del> "DAY": {
<del> "0": "nedelja",
<del> "1": "ponedeljak",
<del> "2": "utorak",
<del> "3": "sreda",
<del> "4": "četvrtak",
<del> "5": "petak",
<del> "6": "subota"
<del> },
<del> "MONTH": {
<del> "0": "januar",
<del> "1": "februar",
<del> "2": "mart",
<del> "3": "april",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "avgust",
<del> "8": "septembar",
<del> "9": "oktobar",
<del> "10": "novembar",
<del> "11": "decembar"
<del> },
<del> "SHORTDAY": {
<del> "0": "ned",
<del> "1": "pon",
<del> "2": "uto",
<del> "3": "sre",
<del> "4": "čet",
<del> "5": "pet",
<del> "6": "sub"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "feb",
<del> "2": "mar",
<del> "3": "apr",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "avg",
<del> "8": "sep",
<del> "9": "okt",
<del> "10": "nov",
<del> "11": "dec"
<del> },
<del> "fullDate": "EEEE, dd. MMMM y.",
<del> "longDate": "dd. MMMM y.",
<del> "medium": "dd.MM.y. HH.mm.ss",
<del> "mediumDate": "dd.MM.y.",
<del> "mediumTime": "HH.mm.ss",
<del> "short": "d.M.yy. HH.mm",
<del> "shortDate": "d.M.yy.",
<del> "shortTime": "HH.mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "din",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": ".",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sr-latn",
<del> "pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sr-rs.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"РСД"},"pluralCat":function (n) { if ((n % 10) == 1 && (n % 100) != 11) { return PLURAL_CATEGORY.ONE; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return PLURAL_CATEGORY.FEW; } if ((n % 10) == 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],"SHORTMONTH":["јан","феб","мар","апр","мај","јун","јул","авг","сеп","окт","нов","дец"],"DAY":["недеља","понедељак","уторак","среда","четвртак","петак","субота"],"SHORTDAY":["нед","пон","уто","сре","чет","пет","суб"],"AMPMS":["пре подне","поподне"],"medium":"dd.MM.y. HH.mm.ss","short":"d.M.yy. HH.mm","fullDate":"EEEE, dd. MMMM y.","longDate":"dd. MMMM y.","mediumDate":"dd.MM.y.","shortDate":"d.M.yy.","mediumTime":"HH.mm.ss","shortTime":"HH.mm"},"id":"sr-rs"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sv-fi.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "fm",
<del> "1": "em"
<del> },
<del> "DAY": {
<del> "0": "söndag",
<del> "1": "måndag",
<del> "2": "tisdag",
<del> "3": "onsdag",
<del> "4": "torsdag",
<del> "5": "fredag",
<del> "6": "lördag"
<del> },
<del> "MONTH": {
<del> "0": "januari",
<del> "1": "februari",
<del> "2": "mars",
<del> "3": "april",
<del> "4": "maj",
<del> "5": "juni",
<del> "6": "juli",
<del> "7": "augusti",
<del> "8": "september",
<del> "9": "oktober",
<del> "10": "november",
<del> "11": "december"
<del> },
<del> "SHORTDAY": {
<del> "0": "sön",
<del> "1": "mån",
<del> "2": "tis",
<del> "3": "ons",
<del> "4": "tors",
<del> "5": "fre",
<del> "6": "lör"
<del> },
<del> "SHORTMONTH": {
<del> "0": "jan",
<del> "1": "feb",
<del> "2": "mar",
<del> "3": "apr",
<del> "4": "maj",
<del> "5": "jun",
<del> "6": "jul",
<del> "7": "aug",
<del> "8": "sep",
<del> "9": "okt",
<del> "10": "nov",
<del> "11": "dec"
<del> },
<del> "fullDate": "EEEE'en' 'den' d:'e' MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y HH:mm:ss",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "HH:mm:ss",
<del> "short": "yyyy-MM-dd HH:mm",
<del> "shortDate": "yyyy-MM-dd",
<del> "shortTime": "HH:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "kr",
<del> "DECIMAL_SEP": ",",
<del> "GROUP_SEP": " ",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": " \u00A4",
<del> "posPre": "",
<del> "posSuf": " \u00A4"
<del> }
<del> }
<del> },
<del> "id": "sv-fi",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_sw-ke.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "asubuhi",
<del> "1": "alasiri"
<del> },
<del> "DAY": {
<del> "0": "Jumapili",
<del> "1": "Jumatatu",
<del> "2": "Jumanne",
<del> "3": "Jumatano",
<del> "4": "Alhamisi",
<del> "5": "Ijumaa",
<del> "6": "Jumamosi"
<del> },
<del> "MONTH": {
<del> "0": "Januari",
<del> "1": "Februari",
<del> "2": "Machi",
<del> "3": "Aprili",
<del> "4": "Mei",
<del> "5": "Juni",
<del> "6": "Julai",
<del> "7": "Agosti",
<del> "8": "Septemba",
<del> "9": "Oktoba",
<del> "10": "Novemba",
<del> "11": "Desemba"
<del> },
<del> "SHORTDAY": {
<del> "0": "J2",
<del> "1": "J3",
<del> "2": "J4",
<del> "3": "J5",
<del> "4": "Alh",
<del> "5": "Ij",
<del> "6": "J1"
<del> },
<del> "SHORTMONTH": {
<del> "0": "Jan",
<del> "1": "Feb",
<del> "2": "Mac",
<del> "3": "Apr",
<del> "4": "Mei",
<del> "5": "Jun",
<del> "6": "Jul",
<del> "7": "Ago",
<del> "8": "Sep",
<del> "9": "Okt",
<del> "10": "Nov",
<del> "11": "Des"
<del> },
<del> "fullDate": "EEEE, d MMMM y",
<del> "longDate": "d MMMM y",
<del> "medium": "d MMM y h:mm:ss a",
<del> "mediumDate": "d MMM y",
<del> "mediumTime": "h:mm:ss a",
<del> "short": "dd/MM/yyyy h:mm a",
<del> "shortDate": "dd/MM/yyyy",
<del> "shortTime": "h:mm a"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "TSh",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "sw-ke",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ta-lk.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "am",
<del> "1": "pm"
<del> },
<del> "DAY": {
<del> "0": "ஞாயிறு",
<del> "1": "திங்கள்",
<del> "2": "செவ்வாய்",
<del> "3": "புதன்",
<del> "4": "வியாழன்",
<del> "5": "வெள்ளி",
<del> "6": "சனி"
<del> },
<del> "MONTH": {
<del> "0": "ஜனவரி",
<del> "1": "பிப்ரவரி",
<del> "2": "மார்ச்",
<del> "3": "ஏப்ரல்",
<del> "4": "மே",
<del> "5": "ஜூன்",
<del> "6": "ஜூலை",
<del> "7": "ஆகஸ்ட்",
<del> "8": "செப்டம்பர்",
<del> "9": "அக்டோபர்",
<del> "10": "நவம்பர்",
<del> "11": "டிசம்பர்"
<del> },
<del> "SHORTDAY": {
<del> "0": "ஞா",
<del> "1": "தி",
<del> "2": "செ",
<del> "3": "பு",
<del> "4": "வி",
<del> "5": "வெ",
<del> "6": "ச"
<del> },
<del> "SHORTMONTH": {
<del> "0": "ஜன.",
<del> "1": "பிப்.",
<del> "2": "மார்.",
<del> "3": "ஏப்.",
<del> "4": "மே",
<del> "5": "ஜூன்",
<del> "6": "ஜூலை",
<del> "7": "ஆக.",
<del> "8": "செப்.",
<del> "9": "அக்.",
<del> "10": "நவ.",
<del> "11": "டிச."
<del> },
<del> "fullDate": "EEEE, d MMMM, y",
<del> "longDate": "d MMMM, y",
<del> "medium": "d MMM, y h:mm:ss a",
<del> "mediumDate": "d MMM, y",
<del> "mediumTime": "h:mm:ss a",
<del> "short": "d-M-yy h:mm a",
<del> "shortDate": "d-M-yy",
<del> "shortTime": "h:mm a"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "₹",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 2,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 2,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "\u00A4 -",
<del> "negSuf": "",
<del> "posPre": "\u00A4 ",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "ta-lk",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_tl-ph.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4 ","posSuf":"","negPre":"\u00A4 -","negSuf":"","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"P"},"pluralCat":function (n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["Enero","Pebrero","Marso","Abril","Mayo","Hunyo","Hulyo","Agosto","Setyembre","Oktubre","Nobyembre","Disyembre"],"SHORTMONTH":["Ene","Peb","Mar","Abr","May","Hun","Hul","Ago","Set","Okt","Nob","Dis"],"DAY":["Linggo","Lunes","Martes","Miyerkules","Huwebes","Biyernes","Sabado"],"SHORTDAY":["Lin","Lun","Mar","Mye","Huw","Bye","Sab"],"AMPMS":["AM","PM"],"medium":"MMM d, y HH:mm:ss","short":"M/d/yy HH:mm","fullDate":"EEEE, MMMM dd y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"id":"tl-ph"});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_ur-in.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "دن",
<del> "1": "رات"
<del> },
<del> "DAY": {
<del> "0": "اتوار",
<del> "1": "پير",
<del> "2": "منگل",
<del> "3": "بده",
<del> "4": "جمعرات",
<del> "5": "جمعہ",
<del> "6": "ہفتہ"
<del> },
<del> "MONTH": {
<del> "0": "جنوری",
<del> "1": "فروری",
<del> "2": "مارچ",
<del> "3": "اپريل",
<del> "4": "مئ",
<del> "5": "جون",
<del> "6": "جولائ",
<del> "7": "اگست",
<del> "8": "ستمبر",
<del> "9": "اکتوبر",
<del> "10": "نومبر",
<del> "11": "دسمبر"
<del> },
<del> "SHORTDAY": {
<del> "0": "اتوار",
<del> "1": "پير",
<del> "2": "منگل",
<del> "3": "بده",
<del> "4": "جمعرات",
<del> "5": "جمعہ",
<del> "6": "ہفتہ"
<del> },
<del> "SHORTMONTH": {
<del> "0": "جنوری",
<del> "1": "فروری",
<del> "2": "مارچ",
<del> "3": "اپريل",
<del> "4": "مئ",
<del> "5": "جون",
<del> "6": "جولائ",
<del> "7": "اگست",
<del> "8": "ستمبر",
<del> "9": "اکتوبر",
<del> "10": "نومبر",
<del> "11": "دسمبر"
<del> },
<del> "fullDate": "EEEE؍ d؍ MMMM y",
<del> "longDate": "d؍ MMMM y",
<del> "medium": "d؍ MMM y h:mm:ss a",
<del> "mediumDate": "d؍ MMM y",
<del> "mediumTime": "h:mm:ss a",
<del> "short": "d/M/yy h:mm a",
<del> "shortDate": "d/M/yy",
<del> "shortTime": "h:mm a"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "Rs",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "\u00A4-",
<del> "negSuf": "",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "ur-in",
<del> "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hans-hk.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "一月",
<del> "1": "二月",
<del> "2": "三月",
<del> "3": "四月",
<del> "4": "五月",
<del> "5": "六月",
<del> "6": "七月",
<del> "7": "八月",
<del> "8": "九月",
<del> "9": "十月",
<del> "10": "十一月",
<del> "11": "十二月"
<del> },
<del> "SHORTDAY": {
<del> "0": "周日",
<del> "1": "周一",
<del> "2": "周二",
<del> "3": "周三",
<del> "4": "周四",
<del> "5": "周五",
<del> "6": "周六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "y年M月d日 ah:mm:ss",
<del> "mediumDate": "y年M月d日",
<del> "mediumTime": "ah:mm:ss",
<del> "short": "d/M/yy ah:mm",
<del> "shortDate": "d/M/yy",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hans-hk",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hans-mo.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "一月",
<del> "1": "二月",
<del> "2": "三月",
<del> "3": "四月",
<del> "4": "五月",
<del> "5": "六月",
<del> "6": "七月",
<del> "7": "八月",
<del> "8": "九月",
<del> "9": "十月",
<del> "10": "十一月",
<del> "11": "十二月"
<del> },
<del> "SHORTDAY": {
<del> "0": "周日",
<del> "1": "周一",
<del> "2": "周二",
<del> "3": "周三",
<del> "4": "周四",
<del> "5": "周五",
<del> "6": "周六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "y年M月d日 ah:mm:ss",
<del> "mediumDate": "y年M月d日",
<del> "mediumTime": "ah:mm:ss",
<del> "short": "d/M/yy ah:mm",
<del> "shortDate": "d/M/yy",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hans-mo",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hans-sg.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "一月",
<del> "1": "二月",
<del> "2": "三月",
<del> "3": "四月",
<del> "4": "五月",
<del> "5": "六月",
<del> "6": "七月",
<del> "7": "八月",
<del> "8": "九月",
<del> "9": "十月",
<del> "10": "十一月",
<del> "11": "十二月"
<del> },
<del> "SHORTDAY": {
<del> "0": "周日",
<del> "1": "周一",
<del> "2": "周二",
<del> "3": "周三",
<del> "4": "周四",
<del> "5": "周五",
<del> "6": "周六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "y年M月d日 ah:mm:ss",
<del> "mediumDate": "y年M月d日",
<del> "mediumTime": "ah:mm:ss",
<del> "short": "dd/MM/yy ahh:mm",
<del> "shortDate": "dd/MM/yy",
<del> "shortTime": "ahh:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hans-sg",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hans.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "SHORTDAY": {
<del> "0": "周日",
<del> "1": "周一",
<del> "2": "周二",
<del> "3": "周三",
<del> "4": "周四",
<del> "5": "周五",
<del> "6": "周六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "yyyy-M-d ah:mm:ss",
<del> "mediumDate": "yyyy-M-d",
<del> "mediumTime": "ah:mm:ss",
<del> "short": "yy-M-d ah:mm",
<del> "shortDate": "yy-M-d",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hans",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hant-hk.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "SHORTDAY": {
<del> "0": "週日",
<del> "1": "週一",
<del> "2": "週二",
<del> "3": "週三",
<del> "4": "週四",
<del> "5": "週五",
<del> "6": "週六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "y年M月d日 ahh:mm:ss",
<del> "mediumDate": "y年M月d日",
<del> "mediumTime": "ahh:mm:ss",
<del> "short": "yy年M月d日 ah:mm",
<del> "shortDate": "yy年M月d日",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hant-hk",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hant-mo.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "SHORTDAY": {
<del> "0": "週日",
<del> "1": "週一",
<del> "2": "週二",
<del> "3": "週三",
<del> "4": "週四",
<del> "5": "週五",
<del> "6": "週六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年MM月dd日EEEE",
<del> "longDate": "y年MM月dd日",
<del> "medium": "y年M月d日 ahh:mm:ss",
<del> "mediumDate": "y年M月d日",
<del> "mediumTime": "ahh:mm:ss",
<del> "short": "yy年M月d日 ah:mm",
<del> "shortDate": "yy年M月d日",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hant-mo",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hant-tw.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "SHORTDAY": {
<del> "0": "週日",
<del> "1": "週一",
<del> "2": "週二",
<del> "3": "週三",
<del> "4": "週四",
<del> "5": "週五",
<del> "6": "週六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "yyyy/M/d ah:mm:ss",
<del> "mediumDate": "yyyy/M/d",
<del> "mediumTime": "ah:mm:ss",
<del> "short": "y/M/d ah:mm",
<del> "shortDate": "y/M/d",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hant-tw",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file
<ide><path>src/ngLocale/angular-locale_zh-hant.js
<del>angular.module("ngLocale", [], ["$provide", function($provide) {
<del>var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
<del>$provide.value("$locale", {
<del> "DATETIME_FORMATS": {
<del> "AMPMS": {
<del> "0": "上午",
<del> "1": "下午"
<del> },
<del> "DAY": {
<del> "0": "星期日",
<del> "1": "星期一",
<del> "2": "星期二",
<del> "3": "星期三",
<del> "4": "星期四",
<del> "5": "星期五",
<del> "6": "星期六"
<del> },
<del> "MONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "SHORTDAY": {
<del> "0": "週日",
<del> "1": "週一",
<del> "2": "週二",
<del> "3": "週三",
<del> "4": "週四",
<del> "5": "週五",
<del> "6": "週六"
<del> },
<del> "SHORTMONTH": {
<del> "0": "1月",
<del> "1": "2月",
<del> "2": "3月",
<del> "3": "4月",
<del> "4": "5月",
<del> "5": "6月",
<del> "6": "7月",
<del> "7": "8月",
<del> "8": "9月",
<del> "9": "10月",
<del> "10": "11月",
<del> "11": "12月"
<del> },
<del> "fullDate": "y年M月d日EEEE",
<del> "longDate": "y年M月d日",
<del> "medium": "yyyy/M/d ah:mm:ss",
<del> "mediumDate": "yyyy/M/d",
<del> "mediumTime": "ah:mm:ss",
<del> "short": "y/M/d ah:mm",
<del> "shortDate": "y/M/d",
<del> "shortTime": "ah:mm"
<del> },
<del> "NUMBER_FORMATS": {
<del> "CURRENCY_SYM": "¥",
<del> "DECIMAL_SEP": ".",
<del> "GROUP_SEP": ",",
<del> "PATTERNS": {
<del> "0": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 3,
<del> "minFrac": 0,
<del> "minInt": 1,
<del> "negPre": "-",
<del> "negSuf": "",
<del> "posPre": "",
<del> "posSuf": ""
<del> },
<del> "1": {
<del> "gSize": 3,
<del> "lgSize": 3,
<del> "macFrac": 0,
<del> "maxFrac": 2,
<del> "minFrac": 2,
<del> "minInt": 1,
<del> "negPre": "(\u00A4",
<del> "negSuf": ")",
<del> "posPre": "\u00A4",
<del> "posSuf": ""
<del> }
<del> }
<del> },
<del> "id": "zh-hant",
<del> "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
<del>});
<del>}]);
<ide>\ No newline at end of file | 42 |
Javascript | Javascript | remove console log | faf0d78f3e58cb19a89e63788121df79507cf7f9 | <ide><path>src/atom-environment.js
<ide> class AtomEnvironment {
<ide> this.config.resetUserSettings(userSettings)
<ide>
<ide> if (projectSettings != null && projectSettings.config != null) {
<del> console.log(projectSettings)
<ide> this.project.replace(projectSettings)
<ide> }
<ide> | 1 |
Javascript | Javascript | perform hasownproperty check in relay flight | 12627f93b5357032881412abcc014da53a0b70f8 | <ide><path>packages/react-transport-dom-relay/src/ReactFlightDOMRelayServerHostConfig.js
<ide> export function processErrorChunk(
<ide> ];
<ide> }
<ide>
<add>const hasOwnProperty = Object.prototype.hasOwnProperty;
<add>
<ide> function convertModelToJSON(
<ide> request: Request,
<ide> parent: {+[key: string]: ReactModel} | $ReadOnlyArray<ReactModel>,
<ide> function convertModelToJSON(
<ide> } else {
<ide> const jsonObj: {[key: string]: JSONValue} = {};
<ide> for (const nextKey in json) {
<del> jsonObj[nextKey] = convertModelToJSON(
<del> request,
<del> json,
<del> nextKey,
<del> json[nextKey],
<del> );
<add> if (hasOwnProperty.call(json, nextKey)) {
<add> jsonObj[nextKey] = convertModelToJSON(
<add> request,
<add> json,
<add> nextKey,
<add> json[nextKey],
<add> );
<add> }
<ide> }
<ide> return jsonObj;
<ide> }
<ide><path>packages/react-transport-dom-relay/src/__tests__/ReactFlightDOMRelay-test.internal.js
<ide> describe('ReactFlightDOMRelay', () => {
<ide> const model = readThrough(transport);
<ide> expect(model).toEqual(14);
<ide> });
<add>
<add> it('should warn in DEV if a class instance polyfill is passed to a host component', () => {
<add> function Bar() {}
<add>
<add> function Foo() {}
<add> Foo.prototype = Object.create(Bar.prototype);
<add> // This is enumerable which some polyfills do.
<add> Foo.prototype.constructor = Foo;
<add> Foo.prototype.method = function() {};
<add>
<add> expect(() => {
<add> const transport = [];
<add> ReactDOMFlightRelayServer.render(<input value={new Foo()} />, transport);
<add> readThrough(transport);
<add> }).toErrorDev(
<add> 'Only plain objects can be passed to client components from server components. ',
<add> {withoutStack: true},
<add> );
<add> });
<ide> });
<ide><path>packages/react-transport-native-relay/src/ReactFlightNativeRelayServerHostConfig.js
<ide> export function processErrorChunk(
<ide> ];
<ide> }
<ide>
<add>const hasOwnProperty = Object.prototype.hasOwnProperty;
<add>
<ide> function convertModelToJSON(
<ide> request: Request,
<ide> parent: {+[key: string]: ReactModel} | $ReadOnlyArray<ReactModel>,
<ide> function convertModelToJSON(
<ide> } else {
<ide> const jsonObj: {[key: string]: JSONValue} = {};
<ide> for (const nextKey in json) {
<del> jsonObj[nextKey] = convertModelToJSON(
<del> request,
<del> json,
<del> nextKey,
<del> json[nextKey],
<del> );
<add> if (hasOwnProperty.call(json, nextKey)) {
<add> jsonObj[nextKey] = convertModelToJSON(
<add> request,
<add> json,
<add> nextKey,
<add> json[nextKey],
<add> );
<add> }
<ide> }
<ide> return jsonObj;
<ide> }
<ide><path>packages/react-transport-native-relay/src/__tests__/ReactFlightNativeRelay-test.internal.js
<ide> describe('ReactFlightNativeRelay', () => {
<ide> nativeFabricUIManager.__dumpHierarchyForJestTestsOnly(),
<ide> ).toMatchSnapshot();
<ide> });
<add>
<add> it('should warn in DEV if a class instance polyfill is passed to a host component', () => {
<add> function Bar() {}
<add>
<add> function Foo() {}
<add> Foo.prototype = Object.create(Bar.prototype);
<add> // This is enumerable which some polyfills do.
<add> Foo.prototype.constructor = Foo;
<add> Foo.prototype.method = function() {};
<add>
<add> expect(() => {
<add> const transport = [];
<add> ReactNativeFlightRelayServer.render(
<add> <input value={new Foo()} />,
<add> transport,
<add> );
<add> readThrough(transport);
<add> }).toErrorDev(
<add> 'Only plain objects can be passed to client components from server components. ',
<add> {withoutStack: true},
<add> );
<add> });
<ide> }); | 4 |
Javascript | Javascript | use result of geturl() | 9a9e35891161d111f5de5d5adc4c3bad620db07e | <ide><path>packages/next-server/lib/router/router.js
<ide> export default class Router {
<ide> if (typeof window !== 'undefined') {
<ide> // in order for `e.state` to work on the `onpopstate` event
<ide> // we have to register the initial route upon initialization
<del> this.changeState('replaceState', format({ pathname, query }), getURL())
<add> this.changeState('replaceState', format({ pathname, query }), as)
<ide>
<ide> window.addEventListener('popstate', this.onPopState)
<ide> } | 1 |
Text | Text | add waffle.io badge | 2eb3ac41a658b86bed79b9712c1c89d7cdacdf11 | <ide><path>README.md
<add>[![Stories in Ready](https://badge.waffle.io/FreeCodeCamp/freecodecamp.png?label=ready&title=Ready)](https://waffle.io/FreeCodeCamp/freecodecamp)
<ide> <img src="https://s3.amazonaws.com/freecodecamp/logo4.0LG.png">
<ide>
<ide> Free Code Camp! | 1 |
Java | Java | avoid synthesizing annotations unnecessarily | 8265db0ae1d83a1e204e602fa96e542c2677977f | <ide><path>spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java
<ide> final class AnnotationTypeMapping {
<ide>
<ide> private final Map<Method, List<Method>> aliasedBy;
<ide>
<add> private final boolean synthesizable;
<add>
<ide> private final Set<Method> claimedAliases = new HashSet<>();
<ide>
<ide>
<ide> final class AnnotationTypeMapping {
<ide> processAliases();
<ide> addConventionMappings();
<ide> addConventionAnnotationValues();
<add> this.synthesizable = computeSynthesizableFlag();
<ide> }
<ide>
<ide>
<ide> private boolean isBetterConventionAnnotationValue(int index, boolean isValueAttr
<ide> return !isValueAttribute && existingDistance > mapping.distance;
<ide> }
<ide>
<add> @SuppressWarnings("unchecked")
<add> private boolean computeSynthesizableFlag() {
<add> // Uses @AliasFor for local aliases?
<add> for (int index : this.aliasMappings) {
<add> if (index != -1) {
<add> return true;
<add> }
<add> }
<add>
<add> // Uses @AliasFor for attribute overrides in meta-annotations?
<add> if (!this.aliasedBy.isEmpty()) {
<add> return true;
<add> }
<add>
<add> // Uses convention-based attribute overrides in meta-annotations?
<add> for (int index : this.conventionMappings) {
<add> if (index != -1) {
<add> return true;
<add> }
<add> }
<add>
<add> // Has nested annotations or arrays of annotations that are synthesizable?
<add> if (getAttributes().hasNestedAnnotation()) {
<add> AttributeMethods attributeMethods = getAttributes();
<add> for (int i = 0; i < attributeMethods.size(); i++) {
<add> Method method = attributeMethods.get(i);
<add> Class<?> type = method.getReturnType();
<add> if (type.isAnnotation() || (type.isArray() && type.getComponentType().isAnnotation())) {
<add> Class<? extends Annotation> annotationType =
<add> (Class<? extends Annotation>) (type.isAnnotation() ? type : type.getComponentType());
<add> AnnotationTypeMapping mapping = AnnotationTypeMappings.forAnnotationType(annotationType).get(0);
<add> if (mapping.isSynthesizable()) {
<add> return true;
<add> }
<add> }
<add> }
<add> }
<add>
<add> return false;
<add> }
<add>
<ide> /**
<ide> * Method called after all mappings have been set. At this point no further
<ide> * lookups from child mappings will occur.
<ide> MirrorSets getMirrorSets() {
<ide> return this.mirrorSets;
<ide> }
<ide>
<add> /**
<add> * Determine if the mapped annotation is <em>synthesizable</em>.
<add> * <p>Consult the documentation for {@link MergedAnnotation#synthesize()}
<add> * for an explanation of what is considered synthesizable.
<add> * @return {@code true} if the mapped annotation is synthesizable
<add> * @since 5.2.6
<add> */
<add> boolean isSynthesizable() {
<add> return this.synthesizable;
<add> }
<add>
<ide>
<ide> private static int[] filledIntArray(int size) {
<ide> int[] array = new int[size];
<ide><path>spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotation.java
<ide> /*
<del> * Copyright 2002-2019 the original author or authors.
<add> * Copyright 2002-2020 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> <T extends Annotation> MergedAnnotation<T>[] getAnnotationArray(String attribute
<ide> <T extends Map<String, Object>> T asMap(Function<MergedAnnotation<?>, T> factory, Adapt... adaptations);
<ide>
<ide> /**
<del> * Create a type-safe synthesized version of this annotation that can be
<del> * used directly in code.
<add> * Create a type-safe synthesized version of this merged annotation that can
<add> * be used directly in code.
<ide> * <p>The result is synthesized using a JDK {@link Proxy} and as a result may
<ide> * incur a computational cost when first invoked.
<del> * @return a synthesized version of the annotation.
<add> * <p>If this merged annotation was created {@linkplain #from(Annotation) from}
<add> * an annotation instance, that annotation will be returned unmodified if it is
<add> * not <em>synthesizable</em>. An annotation is considered synthesizable if
<add> * one of the following is true.
<add> * <ul>
<add> * <li>The annotation declares attributes annotated with {@link AliasFor @AliasFor}.</li>
<add> * <li>The annotation is a composed annotation that relies on convention-based
<add> * annotation attribute overrides in meta-annotations.</li>
<add> * <li>The annotation declares attributes that are annotations or arrays of
<add> * annotations that are themselves synthesizable.</li>
<add> * </ul>
<add> * @return a synthesized version of the annotation or the original annotation
<add> * unmodified
<ide> * @throws NoSuchElementException on a missing annotation
<ide> */
<ide> A synthesize() throws NoSuchElementException;
<ide> <T extends Annotation> MergedAnnotation<T>[] getAnnotationArray(String attribute
<ide> * on a condition predicate.
<ide> * <p>The result is synthesized using a JDK {@link Proxy} and as a result may
<ide> * incur a computational cost when first invoked.
<add> * <p>Consult the documentation for {@link #synthesize()} for an explanation
<add> * of what is considered synthesizable.
<ide> * @param condition the test to determine if the annotation can be synthesized
<del> * @return a optional containing the synthesized version of the annotation or
<add> * @return an optional containing the synthesized version of the annotation or
<ide> * an empty optional if the condition doesn't match
<ide> * @throws NoSuchElementException on a missing annotation
<ide> * @see MergedAnnotationPredicates
<ide><path>spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java
<ide> private <T extends Map<String, Object>> Object adaptValueForMapOptions(Method at
<ide> @Override
<ide> @SuppressWarnings("unchecked")
<ide> protected A createSynthesized() {
<del> if (this.rootAttributes instanceof Annotation) {
<del> // Nothing to synthesize?
<del> if (this.resolvedRootMirrors.length == 0 && this.resolvedMirrors.length == 0) {
<del> return (A) this.rootAttributes;
<del> }
<del> // Already synthesized?
<del> if (this.rootAttributes instanceof SynthesizedAnnotation) {
<del> return (A) this.rootAttributes;
<del> }
<add> if (getType().isInstance(this.rootAttributes) && !isSynthesizable()) {
<add> return (A) this.rootAttributes;
<ide> }
<ide> return SynthesizedMergedAnnotationInvocationHandler.createProxy(this, getType());
<ide> }
<ide>
<add> private boolean isSynthesizable() {
<add> // Already synthesized?
<add> if (this.rootAttributes instanceof SynthesizedAnnotation) {
<add> return false;
<add> }
<add> return this.mapping.isSynthesizable();
<add> }
<add>
<ide> @Override
<ide> public String toString() {
<ide> String string = this.string;
<ide><path>spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java
<ide> /*
<del> * Copyright 2002-2019 the original author or authors.
<add> * Copyright 2002-2020 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> void synthesizeAlreadySynthesized() throws Exception {
<ide> @Test
<ide> void synthesizeShouldNotSynthesizeNonsynthesizableAnnotations() throws Exception {
<ide> Method method = getClass().getDeclaredMethod("getId");
<add>
<ide> Id id = method.getAnnotation(Id.class);
<ide> assertThat(id).isNotNull();
<del>
<ide> Id synthesizedId = MergedAnnotation.from(id).synthesize();
<ide> assertThat(id).isEqualTo(synthesizedId);
<del> // It doesn't make sense to synthesize {@code @Id} since it declares zero attributes.
<add> // It doesn't make sense to synthesize @Id since it declares zero attributes.
<ide> assertThat(synthesizedId).isNotInstanceOf(SynthesizedAnnotation.class);
<ide> assertThat(id).isSameAs(synthesizedId);
<add>
<add> GeneratedValue generatedValue = method.getAnnotation(GeneratedValue.class);
<add> assertThat(generatedValue).isNotNull();
<add> GeneratedValue synthesizedGeneratedValue = MergedAnnotation.from(generatedValue).synthesize();
<add> assertThat(generatedValue).isEqualTo(synthesizedGeneratedValue);
<add> // It doesn't make sense to synthesize @GeneratedValue since it declares zero attributes with aliases.
<add> assertThat(synthesizedGeneratedValue).isNotInstanceOf(SynthesizedAnnotation.class);
<add> assertThat(generatedValue).isSameAs(synthesizedGeneratedValue);
<ide> }
<ide>
<ide> /**
<ide> public void handleMappedWithDifferentPathAndValueAttributes() {
<ide> @interface Id {
<ide> }
<ide>
<add> /**
<add> * Mimics javax.persistence.GeneratedValue
<add> */
<add> @Retention(RUNTIME)
<add> @interface GeneratedValue {
<add> String strategy();
<add> }
<add>
<ide> @Id
<add> @GeneratedValue(strategy = "AUTO")
<ide> private Long getId() {
<ide> return 42L;
<ide> } | 4 |
Javascript | Javascript | fix whitespaces [ci-skip] | 536b75079328620dcc6e1adf55f6532d9daf2df3 | <ide><path>packages/ember-glimmer/lib/component.js
<ide> export const BOUNDS = symbol('BOUNDS');
<ide> tagName: 'em'
<ide> });
<ide> ```
<del>
<add>
<ide> Would result in instances with the following HTML:
<ide>
<ide> ```html
<ide> const Component = CoreView.extend(
<ide>
<ide> ```javascript
<ide> let MyComponent = Ember.Component.extend;
<del>
<add>
<ide> MyComponent.reopenClass({
<ide> positionalParams: ['name', 'age']
<ide> });
<ide> const Component = CoreView.extend(
<ide>
<ide> ```javascript
<ide> let MyComponent = Ember.Component.extend;
<del>
<add>
<ide> MyComponent.reopenClass({
<ide> positionalParams: 'names'
<ide> }); | 1 |
Javascript | Javascript | remove unused variables from net tests | 1762db0142b137d0dcc949cd38894a2b07adf18a | <ide><path>test/parallel/test-net-create-connection.js
<ide> server.listen(tcpPort, 'localhost', function() {
<ide>
<ide> function fail(opts, errtype, msg) {
<ide> assert.throws(function() {
<del> var client = net.createConnection(opts, cb);
<add> net.createConnection(opts, cb);
<ide> }, function(err) {
<ide> return err instanceof errtype && msg === err.message;
<ide> });
<ide><path>test/parallel/test-net-dns-custom-lookup.js
<ide> var common = require('../common');
<ide> var assert = require('assert');
<ide> var net = require('net');
<del>var dns = require('dns');
<ide> var ok = false;
<ide>
<ide> function check(addressType, cb) {
<ide><path>test/parallel/test-net-dns-lookup-skip.js
<ide> 'use strict';
<ide> var common = require('../common');
<del>var assert = require('assert');
<ide> var net = require('net');
<ide>
<ide> function check(addressType) {
<ide><path>test/parallel/test-net-listen-close-server.js
<ide> var common = require('../common');
<ide> var assert = require('assert');
<ide> var net = require('net');
<del>var gotError = false;
<ide>
<ide> var server = net.createServer(function(socket) {
<ide> });
<ide><path>test/parallel/test-net-local-address-port.js
<ide> var common = require('../common');
<ide> var assert = require('assert');
<ide> var net = require('net');
<ide>
<del>var conns = 0, conns_closed = 0;
<add>var conns = 0;
<ide>
<ide> var server = net.createServer(function(socket) {
<ide> conns++;
<ide><path>test/parallel/test-net-localerror.js
<ide> connect({
<ide>
<ide> function connect(opts, msg) {
<ide> assert.throws(function() {
<del> var client = net.connect(opts);
<add> net.connect(opts);
<ide> }, msg);
<ide> }
<ide><path>test/parallel/test-net-reconnect.js
<ide> var assert = require('assert');
<ide> var net = require('net');
<ide>
<ide> var N = 50;
<del>var c = 0;
<ide> var client_recv_count = 0;
<ide> var client_end_count = 0;
<ide> var disconnect_count = 0; | 7 |
Javascript | Javascript | detect missing postmortem metadata | 76b9cf5424d01b7449e3b4902d305d3a04f355ea | <ide><path>test/v8-updates/test-postmortem-metadata.js
<ide> const symbols = nm.stdout.toString().split('\n').reduce((filtered, line) => {
<ide>
<ide> return filtered;
<ide> }, []);
<add>
<add>assert.notStrictEqual(symbols.length, 0, 'No postmortem metadata detected');
<add>
<ide> const missing = getExpectedSymbols().filter((symbol) => {
<ide> return !symbols.includes(symbol);
<ide> }); | 1 |
Javascript | Javascript | add strict equalities in src/display/svg.js | 4a82dac45b7faa6c4d0e825ce84e5b41f614077a | <ide><path>src/display/svg.js
<ide> var SVGGraphics = (function SVGGraphicsClosure(ctx) {
<ide>
<ide> var self = this;
<ide> for (var i = 0; i < fnArrayLen; i++) {
<del> if (OPS.dependency == fnArray[i]) {
<add> if (OPS.dependency === fnArray[i]) {
<ide> var deps = argsArray[i];
<ide> for (var n = 0, nn = deps.length; n < nn; n++) {
<ide> var obj = deps[n];
<ide> var SVGGraphics = (function SVGGraphicsClosure(ctx) {
<ide> this.clippath = document.createElementNS(NS, 'svg:clipPath');
<ide> this.clippath.setAttributeNS(null, 'id', current.clipId);
<ide> var clipElement = current.element.cloneNode();
<del> if (type == 'evenodd') {
<add> if (type === 'evenodd') {
<ide> clipElement.setAttributeNS(null, 'clip-rule', 'evenodd');
<ide> } else {
<ide> clipElement.setAttributeNS(null, 'clip-rule', 'nonzero'); | 1 |
Ruby | Ruby | raise error when `from` is used with `delete_all` | 9e477df7c969e6a0590707fe1df0959cfdad52b1 | <ide><path>activerecord/lib/active_record/relation.rb
<ide> class Relation
<ide> :reverse_order, :distinct, :create_with, :skip_query_cache]
<ide>
<ide> CLAUSE_METHODS = [:where, :having, :from]
<del> INVALID_METHODS_FOR_DELETE_ALL = [:distinct, :group, :having]
<add> INVALID_METHODS_FOR_DELETE_ALL = [:distinct, :group, :having, :from]
<ide>
<ide> VALUE_METHODS = MULTI_VALUE_METHODS + SINGLE_VALUE_METHODS + CLAUSE_METHODS
<ide>
<ide> def destroy_all
<ide> def delete_all
<ide> invalid_methods = INVALID_METHODS_FOR_DELETE_ALL.select do |method|
<ide> value = @values[method]
<del> method == :distinct ? value : value&.any?
<add> [:distinct, :from].include?(method) ? value : value&.any?
<ide> end
<add>
<ide> if invalid_methods.any?
<ide> raise ActiveRecordError.new("delete_all doesn't support #{invalid_methods.join(', ')}")
<ide> end
<ide><path>activerecord/test/cases/relation/delete_all_test.rb
<ide> def test_delete_all_with_unpermitted_relation_raises_error
<ide> assert_raises(ActiveRecord::ActiveRecordError) { Author.distinct.delete_all }
<ide> assert_raises(ActiveRecord::ActiveRecordError) { Author.group(:name).delete_all }
<ide> assert_raises(ActiveRecord::ActiveRecordError) { Author.having("SUM(id) < 3").delete_all }
<add> assert_raises(ActiveRecord::ActiveRecordError) { Author.from("(SELECT * FROM authors) AS authors").delete_all }
<ide> end
<ide>
<ide> def test_delete_all_with_joins_and_where_part_is_hash | 2 |