Title: [189187] trunk/LayoutTests
Revision
189187
Author
[email protected]
Date
2015-08-31 15:29:32 -0700 (Mon, 31 Aug 2015)

Log Message

[ES6] Arrow function syntax. Add missed tests for invoking the arrow function that created by 'eval' statement.
https://bugs.webkit.org/show_bug.cgi?id=148445

Patch by Aleksandr Skachkov <[email protected]> on 2015-08-31
Reviewed by Yusuke Suzuki.

Added tests, that cover cases, when arrow function is created by 'eval' statement and then invoking it.
This case was missed in previous patches that are related to arrow function, also it is important to
test different cases of ending arrow function in 'eval' and invoking created arrow function because
of reparsing during function invocation.

* js/arrowfunction-syntax-endings-expected.txt:
* js/script-tests/arrowfunction-syntax-endings.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (189186 => 189187)


--- trunk/LayoutTests/ChangeLog	2015-08-31 22:01:44 UTC (rev 189186)
+++ trunk/LayoutTests/ChangeLog	2015-08-31 22:29:32 UTC (rev 189187)
@@ -1,3 +1,18 @@
+2015-08-31  Aleksandr Skachkov  <[email protected]>
+
+        [ES6] Arrow function syntax. Add missed tests for invoking the arrow function that created by 'eval' statement.
+        https://bugs.webkit.org/show_bug.cgi?id=148445
+
+        Reviewed by Yusuke Suzuki.
+       
+        Added tests, that cover cases, when arrow function is created by 'eval' statement and then invoking it. 
+        This case was missed in previous patches that are related to arrow function, also it is important to 
+        test different cases of ending arrow function in 'eval' and invoking created arrow function because 
+        of reparsing during function invocation.
+
+        * js/arrowfunction-syntax-endings-expected.txt:
+        * js/script-tests/arrowfunction-syntax-endings.js:
+
 2015-08-31  Zalan Bujtas  <[email protected]>
 
         Repaint cleanup:

Modified: trunk/LayoutTests/js/arrowfunction-syntax-endings-expected.txt (189186 => 189187)


--- trunk/LayoutTests/js/arrowfunction-syntax-endings-expected.txt	2015-08-31 22:01:44 UTC (rev 189186)
+++ trunk/LayoutTests/js/arrowfunction-syntax-endings-expected.txt	2015-08-31 22:29:32 UTC (rev 189187)
@@ -8,6 +8,17 @@
 PASS x=>x+1
  did not throw exception.
 PASS f() is 39
+eval('var af = x=>x*2')
+PASS af(10) is 20
+eval('var af1 = x=>x*3, af2=x=>x*4')
+PASS af1(10) is 30
+PASS af2(10) is 40
+eval('var af1 = x=>x*3;')
+PASS af3(10) is 30
+eval('var af4 = x=>(x*3)')
+PASS af4(10) is 30
+eval('var af5 = x=> { return x*3; }')
+PASS af5(10) is 30
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/js/script-tests/arrowfunction-syntax-endings.js (189186 => 189187)


--- trunk/LayoutTests/js/script-tests/arrowfunction-syntax-endings.js	2015-08-31 22:01:44 UTC (rev 189186)
+++ trunk/LayoutTests/js/script-tests/arrowfunction-syntax-endings.js	2015-08-31 22:29:32 UTC (rev 189187)
@@ -32,4 +32,25 @@
 
 shouldBe('f()', '39');
 
+eval('var af = x=>x*2');
+debug("eval('var af = x=>x*2')");
+shouldBe('af(10)','20');
+
+eval('var af1 = x=>x*3, af2=x=>x*4');
+debug("eval('var af1 = x=>x*3, af2=x=>x*4')");
+shouldBe('af1(10)','30');
+shouldBe('af2(10)','40');
+
+eval('var af3 = x=>x*3;');
+debug("eval('var af1 = x=>x*3;')");
+shouldBe('af3(10)','30');
+
+eval('var af4 = x=>(x*3)');
+debug("eval('var af4 = x=>(x*3)')");
+shouldBe('af4(10)','30');
+
+eval('var af5 = x => { return x*3; }');
+debug("eval('var af5 = x=> { return x*3; }')");
+shouldBe('af5(10)','30');
+
 var successfullyParsed = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to