RegressionTests__JavaScriptTests.st
branchjv
changeset 2074 ea5b82590a6e
parent 1974 f2eaf05205d6
child 2600 2b0346a924e6
equal deleted inserted replaced
2073:eaf032c8d02f 2074:ea5b82590a6e
  1755      self run:#testNew03
  1755      self run:#testNew03
  1756      self new testNew03
  1756      self new testNew03
  1757     "
  1757     "
  1758 !
  1758 !
  1759 
  1759 
       
  1760 testNew04
       
  1761     |plug|
       
  1762 
       
  1763     plug := Plug new.
       
  1764     plug respondTo:#arr with:[ Array ].
       
  1765     
       
  1766     self
       
  1767         execute:'test(foo) {
       
  1768                     var xxx;
       
  1769 
       
  1770                     xxx = new foo.arr(7);
       
  1771                     return xxx;
       
  1772                  }'
       
  1773         for:nil
       
  1774         arguments:{plug}
       
  1775         expect:#(nil nil nil nil nil nil nil)
       
  1776 
       
  1777     "
       
  1778      self run:#testNew04
       
  1779      self new testNew04
       
  1780     "
       
  1781 
       
  1782     "Created: / 13-12-2018 / 22:52:56 / Claus Gittinger"
       
  1783 !
       
  1784 
  1760 testOperators01_plus
  1785 testOperators01_plus
  1761     self
  1786     self
  1762 	execute:'expr(a, b) {
  1787 	execute:'expr(a, b) {
  1763 		    return (a + 0);
  1788 		    return (a + 0);
  1764 		 }'
  1789 		 }'
  5375      self new testVarDeclaration06
  5400      self new testVarDeclaration06
  5376     "
  5401     "
  5377 !
  5402 !
  5378 
  5403 
  5379 testVarDeclaration07
  5404 testVarDeclaration07
  5380 
  5405     "/ changed for a fix (x is declared after parsing the initExpr,
  5381     self
  5406     "/ not before. This is the same as in NodeJS.
  5382 	execute:'expr(x) {
  5407     "/ thereforem the right x in the expr refers to the outer x.
  5383 		    var x = x + 20;
  5408     "/ (used to be different in older JavaParser)
  5384 
  5409     
  5385 		    return (x);
  5410     self
  5386 		 }'
  5411         execute:'expr(x) {
  5387 	for:nil
  5412                     var x = x + 20;
  5388 	arguments:#(10)
  5413 
  5389 	expectError:Error
  5414                     return (x);
       
  5415                  }'
       
  5416         for:nil
       
  5417         arguments:#(10)
       
  5418         expect:30
       
  5419         "/ expectError:Error
  5390 
  5420 
  5391     "
  5421     "
  5392      self run:#testVarDeclaration07
  5422      self run:#testVarDeclaration07
  5393      self new testVarDeclaration07
  5423      self new testVarDeclaration07
  5394     "
  5424     "
       
  5425 
       
  5426     "Modified: / 13-12-2018 / 22:49:37 / Claus Gittinger"
  5395 !
  5427 !
  5396 
  5428 
  5397 testVarDeclaration08
  5429 testVarDeclaration08
  5398 
  5430 
  5399     self
  5431     self