From 0836b58637be695f4cfb3a296a9076f27573d0da Mon Sep 17 00:00:00 2001 From: Neal Lubin Date: Mon, 5 Mar 2018 10:19:29 -0500 Subject: [PATCH 1/2] Undefined should return itself (otherwise it returns the "bad" `undefined`) --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 87e73cc..8fa2391 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1 @@ -export const undefined = () => {}; +export const undefined = () => undefined; From c95fcd6a5a252f83c3b6b2e6cbe6fb0e36d9b071 Mon Sep 17 00:00:00 2001 From: Neal Lubin Date: Mon, 5 Mar 2018 10:22:37 -0500 Subject: [PATCH 2/2] Update index.test.js --- src/index.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.test.js b/src/index.test.js index ae0417a..8143725 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -4,4 +4,7 @@ describe('undefined is not a function?', () => { test('it is now', () => { expect(typeof undefined).toBe('function'); }); + test('it should return itself', () => { + expect(undefined()).toBe(undefined); + }); });