diff --git a/lib/Jsrt/ChakraCore.h b/lib/Jsrt/ChakraCore.h
index f4229bd1ce7..18aedbf33a8 100644
--- a/lib/Jsrt/ChakraCore.h
+++ b/lib/Jsrt/ChakraCore.h
@@ -163,6 +163,7 @@ JsGetModuleHostInfo(
_In_ JsModuleHostInfoKind moduleHostInfo,
_Outptr_result_maybenull_ void** hostInfo);
+#ifdef CHAKRACOREBUILD_
///
/// Called by the runtime to load the source code of the serialized script.
///
@@ -493,5 +494,5 @@ CHAKRA_API
_In_ JsSourceContext sourceContext,
_In_ JsValueRef sourceUrl,
_Out_ JsValueRef *result);
-
+#endif // CHAKRACOREBUILD_
#endif // _CHAKRACORE_H_
diff --git a/lib/Runtime/Language/AsmJsModule.cpp b/lib/Runtime/Language/AsmJsModule.cpp
index 1873a2d61da..a91a5383363 100644
--- a/lib/Runtime/Language/AsmJsModule.cpp
+++ b/lib/Runtime/Language/AsmJsModule.cpp
@@ -1080,6 +1080,11 @@ namespace Js
AsmJsFunc* AsmJsModuleCompiler::CreateNewFunctionEntry( ParseNode* pnodeFnc )
{
PropertyName name = ParserWrapper::FunctionName( pnodeFnc );
+ if ( !name )
+ {
+ return nullptr;
+ }
+
GetByteCodeGenerator()->AssignPropertyId(name);
AsmJsFunc* func = Anew( &mAllocator, AsmJsFunc, name, pnodeFnc, &mAllocator, mCx->scriptContext );
if( func )
diff --git a/test/AsmJs/bugGH2270.js b/test/AsmJs/bugGH2270.js
new file mode 100644
index 00000000000..4ad8a704778
--- /dev/null
+++ b/test/AsmJs/bugGH2270.js
@@ -0,0 +1,11 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+(function() {
+ "use asm";
+ (function(){});
+})();
+
+print("Pass");
diff --git a/test/AsmJs/rlexe.xml b/test/AsmJs/rlexe.xml
index 79533d18b8d..ddf0679696f 100644
--- a/test/AsmJs/rlexe.xml
+++ b/test/AsmJs/rlexe.xml
@@ -813,5 +813,8 @@
vardeclnorhs.baseline
-testtrace:asmjs -maic:1
+
+ bugGH2270.js
+