Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1679)

Unified Diff: sky/tests/modules/import-without-export.sky

Issue 872043003: module.exports should default to an empty object. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/city-list/city-list.sky ('k') | sky/tests/modules/modules.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/modules/import-without-export.sky
diff --git a/sky/tests/modules/import-without-export.sky b/sky/tests/modules/import-without-export.sky
index 19415ffae342a636f1a6eb46d389944b985804dc..a3eaa1ffe4cc4f98682073c0b11bcc3ea70ada1e 100644
--- a/sky/tests/modules/import-without-export.sky
+++ b/sky/tests/modules/import-without-export.sky
@@ -3,7 +3,9 @@
<import src="../resources/dump-as-text.sky" />
<div id="result">FAIL - Script did not execute</div>
<script>
-document.getElementById("result").textContent =
- hello === undefined ? "PASS" : "FAIL";
+var result = "FAIL";
+if (typeof hello === "object" && Object.keys(hello).length === 0)
+ result = "PASS";
+document.getElementById("result").textContent = result;
</script>
</html>
« no previous file with comments | « sky/examples/city-list/city-list.sky ('k') | sky/tests/modules/modules.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698