From b19f089684fc84b14664257b3b6ad045006496fd Mon Sep 17 00:00:00 2001 From: Bruno Jouhier Date: Thu, 5 Nov 2015 00:00:43 +0100 Subject: [PATCH] issue #302 - unit tests for CS _this idiom --- test/common/eval-test._js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/common/eval-test._js b/test/common/eval-test._js index 1d26033d..c56ec550 100644 --- a/test/common/eval-test._js +++ b/test/common/eval-test._js @@ -656,6 +656,15 @@ asyncTest("coffeescript wrapper 2", 1, function(_) { }, "cs2"); }) +asyncTest("coffeescript wrapper 2b", 1, function(_) { + evalTest(function f(_) { + var _this = this; + return (function() { + return delay(_, "cs2"); + }).call(_this); + }, "cs2"); +}) + asyncTest("coffeescript wrapper 3", 1, function(_) { evalTest(function f(_) { return (function() { @@ -664,6 +673,15 @@ asyncTest("coffeescript wrapper 3", 1, function(_) { }, "cs3"); }) +asyncTest("coffeescript wrapper 3b", 1, function(_) { + evalTest(function f(_) { + var _this = this; + return (function() { + return delay(_, "cs3"); + }).apply(_this, arguments); + }, "cs3"); +}) + asyncTest("sync try/catch in async", 1, function(_) { evalTest(function f(_) { try {