Basic implementation of <import>
This CL adds basic support for the <import> elements. We're using the same imports machinery as <link rel="import">, which simplifies this patch substantially. Currently we support both <link rel="import"> and <import>. Once this CL lands, I'll update all the existing modules and then we can drop support for <link rel="import">. R=ojan@chromium.org Review URL: https://codereview.chromium.org/681983005
This commit is contained in:
parent
5e4631f922
commit
5473994cea
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<link rel="import" href="../resources/dump-as-text.sky" />
|
||||
<link rel="import" href="resources/pass.sky" as="hello" />
|
||||
<import src="../resources/dump-as-text.sky" />
|
||||
<import src="resources/pass.sky" as="hello" />
|
||||
<div id="result">FAIL</div>
|
||||
<script>
|
||||
document.getElementById("result").textContent = hello;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<link rel="import" href="resources/does-not-export.sky" as="hello" />
|
||||
<link rel="import" href="../resources/dump-as-text.sky" />
|
||||
<import src="resources/does-not-export.sky" as="hello" />
|
||||
<import src="../resources/dump-as-text.sky" />
|
||||
<div id="result">FAIL - Script did not execute</div>
|
||||
<script>
|
||||
document.getElementById("result").textContent =
|
||||
|
@ -1,5 +1,5 @@
|
||||
<html>
|
||||
<link rel="import" href="resources/intermediate.sky" as="chocolate" />
|
||||
<import src="resources/intermediate.sky" as="chocolate" />
|
||||
<div id="result">FAIL</div>
|
||||
<script>
|
||||
document.getElementById("result").textContent = JSON.stringify(chocolate);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<link rel="import" href="resources/does-not-exist.sky" as="hello" />
|
||||
<link rel="import" href="../resources/dump-as-text.sky" />
|
||||
<import src="resources/does-not-exist.sky" as="hello" />
|
||||
<import src="../resources/dump-as-text.sky" />
|
||||
<div id="result">FAIL - Script did not execute</div>
|
||||
<script>
|
||||
document.getElementById("result").textContent =
|
||||
|
@ -1,5 +1,5 @@
|
||||
<link rel="import" href="../../resources/dump-as-text.sky" />
|
||||
<link rel="import" href="pass.sky" as="banana" />
|
||||
<import src="../../resources/dump-as-text.sky" />
|
||||
<import src="pass.sky" as="banana" />
|
||||
<script>
|
||||
module.exports = {
|
||||
message: banana,
|
||||
|
Loading…
x
Reference in New Issue
Block a user