@@ -2177,7 +2177,7 @@ function delegateAndNotify(setterName, getterName, target) {
2177
2177
if ( hadKey !== hasKey ) {
2178
2178
notifyReactives ( target , KEYCHANGES ) ;
2179
2179
}
2180
- if ( originalValue !== value ) {
2180
+ if ( originalValue !== target [ getterName ] ( key ) ) {
2181
2181
notifyReactives ( target , key ) ;
2182
2182
}
2183
2183
return ret ;
@@ -2998,15 +2998,13 @@ function prepareList(collection) {
2998
2998
keys = [ ...collection . keys ( ) ] ;
2999
2999
values = [ ...collection . values ( ) ] ;
3000
3000
}
3001
+ else if ( Symbol . iterator in Object ( collection ) ) {
3002
+ keys = [ ...collection ] ;
3003
+ values = keys ;
3004
+ }
3001
3005
else if ( collection && typeof collection === "object" ) {
3002
- if ( Symbol . iterator in collection ) {
3003
- keys = [ ...collection ] ;
3004
- values = keys ;
3005
- }
3006
- else {
3007
- values = Object . values ( collection ) ;
3008
- keys = Object . keys ( collection ) ;
3009
- }
3006
+ values = Object . values ( collection ) ;
3007
+ keys = Object . keys ( collection ) ;
3010
3008
}
3011
3009
else {
3012
3010
throw new OwlError ( `Invalid loop expression: "${ collection } " is not iterable` ) ;
@@ -3207,6 +3205,10 @@ class TemplateSet {
3207
3205
}
3208
3206
addTemplate ( name , template ) {
3209
3207
if ( name in this . rawTemplates ) {
3208
+ // this check can be expensive, just silently ignore double definitions outside dev mode
3209
+ if ( ! this . dev ) {
3210
+ return ;
3211
+ }
3210
3212
const rawTemplate = this . rawTemplates [ name ] ;
3211
3213
const currentAsString = typeof rawTemplate === "string"
3212
3214
? rawTemplate
@@ -5553,7 +5555,7 @@ function compile(template, options = {}) {
5553
5555
}
5554
5556
5555
5557
// do not modify manually. This file is generated by the release script.
5556
- const version = "2.2.5 " ;
5558
+ const version = "2.2.6 " ;
5557
5559
5558
5560
// -----------------------------------------------------------------------------
5559
5561
// Scheduler
@@ -5642,21 +5644,16 @@ const DEV_MSG = () => {
5642
5644
This is not suitable for production use.
5643
5645
See https://github.com/odoo/owl/blob/${ hash } /doc/reference/app.md#configuration for more information.` ;
5644
5646
} ;
5645
- window . __OWL_DEVTOOLS__ || ( window . __OWL_DEVTOOLS__ = {
5646
- apps : new Set ( ) ,
5647
- Fiber : Fiber ,
5648
- RootFiber : RootFiber ,
5649
- toRaw : toRaw ,
5650
- reactive : reactive ,
5651
- } ) ;
5647
+ const apps = new Set ( ) ;
5648
+ window . __OWL_DEVTOOLS__ || ( window . __OWL_DEVTOOLS__ = { apps, Fiber, RootFiber, toRaw, reactive } ) ;
5652
5649
class App extends TemplateSet {
5653
5650
constructor ( Root , config = { } ) {
5654
5651
super ( config ) ;
5655
5652
this . scheduler = new Scheduler ( ) ;
5656
5653
this . root = null ;
5657
5654
this . name = config . name || "" ;
5658
5655
this . Root = Root ;
5659
- window . __OWL_DEVTOOLS__ . apps . add ( this ) ;
5656
+ apps . add ( this ) ;
5660
5657
if ( config . test ) {
5661
5658
this . dev = true ;
5662
5659
}
@@ -5713,7 +5710,7 @@ class App extends TemplateSet {
5713
5710
this . root . destroy ( ) ;
5714
5711
this . scheduler . processTasks ( ) ;
5715
5712
}
5716
- window . __OWL_DEVTOOLS__ . apps . delete ( this ) ;
5713
+ apps . delete ( this ) ;
5717
5714
}
5718
5715
createComponent ( name , isStatic , hasSlotsProp , hasDynamicPropList , propList ) {
5719
5716
const isDynamic = ! isStatic ;
@@ -5788,6 +5785,7 @@ class App extends TemplateSet {
5788
5785
}
5789
5786
}
5790
5787
App . validateTarget = validateTarget ;
5788
+ App . apps = apps ;
5791
5789
App . version = version ;
5792
5790
async function mount ( C , target , config = { } ) {
5793
5791
return new App ( C , config ) . mount ( target , config ) ;
@@ -5986,6 +5984,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
5986
5984
export { App , Component , EventBus , OwlError , __info__ , blockDom , loadFile , markRaw , markup , mount , onError , onMounted , onPatched , onRendered , onWillDestroy , onWillPatch , onWillRender , onWillStart , onWillUnmount , onWillUpdateProps , reactive , status , toRaw , useChildSubEnv , useComponent , useEffect , useEnv , useExternalListener , useRef , useState , useSubEnv , validate , validateType , whenReady , xml } ;
5987
5985
5988
5986
5989
- __info__ . date = '2023-08-07T10:26:30.557Z ' ;
5990
- __info__ . hash = 'b25e988 ' ;
5987
+ __info__ . date = '2023-09-25T11:48:01.531Z ' ;
5988
+ __info__ . hash = '752160f ' ;
5991
5989
__info__ . url = 'https://github.com/odoo/owl' ;
0 commit comments