informatique:javascript:tests_de_compatibilite
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
informatique:javascript:tests_de_compatibilite [04/05/2018 20:51] – [Workaround] cyrille | informatique:javascript:tests_de_compatibilite [05/05/2018 19:17] (Version actuelle) – cyrille | ||
---|---|---|---|
Ligne 18: | Ligne 18: | ||
d = new Date(Date.parse(d)); | d = new Date(Date.parse(d)); | ||
document.write('< | document.write('< | ||
- | document.write('< | + | document.write('< |
</ | </ | ||
</ | </ | ||
Ligne 36: | Ligne 36: | ||
} | } | ||
- | document.write('< | + | document.write( '< |
var date = ' | var date = ' | ||
d = new Date(Date.parse(date)); | d = new Date(Date.parse(date)); | ||
- | document.write('< | + | document.write('< |
date = ' | date = ' | ||
d = new Date(Date.parse(date)); | d = new Date(Date.parse(date)); | ||
- | document.write('< | + | document.write('< |
</ | </ | ||
</ | </ | ||
- | ====== Object.assign() | + | ====== Object |
- | ===== Assign simple with scalar properties ===== | + | ===== Object.assign() - only scalar properties ===== |
Should be write 1,2 : | Should be write 1,2 : | ||
Ligne 56: | Ligne 57: | ||
< | < | ||
< | < | ||
- | var o1 = { a:1 }; | + | try { |
- | var o2 = Object.assign( o1, { b:2 } ); | + | var o1 = { a:1 }; |
- | document.write( '< | + | var o2 = Object.assign( o1, { b:2 } ); |
+ | | ||
+ | } catch ( e ){ | ||
+ | | ||
+ | } | ||
</ | </ | ||
</ | </ | ||
- | ===== Assign simple with complex properties ===== | + | ===== Object.assign() - complex properties ===== |
Should be write 1,2 : | Should be write 1,2 : | ||
Ligne 68: | Ligne 73: | ||
< | < | ||
< | < | ||
- | var o1 = { a:1 }; | + | try { |
- | var o2 = Object.assign( o1, { b: | + | var o1 = { a:1 }; |
- | document.write( '< | + | var o2 = Object.assign( o1, { b: |
+ | | ||
+ | } catch ( e ){ | ||
+ | | ||
+ | } | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | ===== Object.create() - complex properties ===== | ||
+ | |||
+ | Should be write 1,2 : | ||
+ | |||
+ | < | ||
+ | < | ||
+ | try { | ||
+ | var o1 = { a:1, b: | ||
+ | var o2 = Object.create( o1 ); | ||
+ | | ||
+ | } catch ( e ){ | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
informatique/javascript/tests_de_compatibilite.1525459860.txt.gz · Dernière modification : 04/05/2018 20:51 de cyrille