From 3a1971e66666aee8d8a58d211af3da8691e42efd Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Mon, 14 Apr 2014 10:11:21 -0700 Subject: [PATCH] Fix xenon tests Attempted to use idx() without first defining it. Differential Revision: D1274704 --- hphp/test/quick/xenon/xenon.php | 4 ++++ hphp/test/quick/xenon/xenon_init.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hphp/test/quick/xenon/xenon.php b/hphp/test/quick/xenon/xenon.php index c89eaff9dca..1179453bd9a 100644 --- a/hphp/test/quick/xenon/xenon.php +++ b/hphp/test/quick/xenon/xenon.php @@ -30,6 +30,10 @@ async function genFoo($a) { return $x + $y; } +function idx($arr, $idx, $def = null) { + return isset($arr[$idx]) ? $arr[$idx] : $def; +} + function main($a) { $result = genFoo($a)->join(); } diff --git a/hphp/test/quick/xenon/xenon_init.php b/hphp/test/quick/xenon/xenon_init.php index 9481803f687..9187ab4559a 100644 --- a/hphp/test/quick/xenon/xenon_init.php +++ b/hphp/test/quick/xenon/xenon_init.php @@ -30,6 +30,10 @@ function fn0($a) { return 2 * fa1(1 + $a)->join(); } +function idx($arr, $idx, $def = null) { + return isset($arr[$idx]) ? $arr[$idx] : $def; +} + async function fa0($a) { await RescheduleWaitHandle::Create(1, 1); // simulate blocking I/O return fn0($a); -- 2.11.4.GIT