mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Specs: default exports to {} rather than document, since it makes writing modules saner
Review URL: https://codereview.chromium.org/730223002
This commit is contained in:
parent
465846c37d
commit
93cca4aed1
@ -21,7 +21,7 @@ SKY MODULE - defines an <element> element
|
||||
<script>
|
||||
module.exports.Element = sky.registerElement({
|
||||
tagName: 'element',
|
||||
prototype: class extends Element {
|
||||
constructor: class extends Element {
|
||||
constructor (module) {
|
||||
super();
|
||||
this.state = 'loading';
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
SKY MODULE - radio button and radio button group
|
||||
<!-- accessibility handling not implemented yet, pending mojo service -->
|
||||
|
||||
<script>
|
||||
module.exports = {};
|
||||
</script>
|
||||
|
||||
<!-- <radio> -->
|
||||
<template id="radio-shadow">
|
||||
<style>
|
||||
|
||||
@ -311,7 +311,7 @@ module 'sky:core' {
|
||||
constructor (Application application, Document document, String url); // O(1)
|
||||
readonly attribute Application application; // O(1)
|
||||
|
||||
attribute any exports; // O(1) // defaults to the module's document
|
||||
attribute any exports; // O(1) // defaults to {}
|
||||
}
|
||||
|
||||
class Application : AbstractModule {
|
||||
|
||||
@ -35,9 +35,10 @@ the [``Module`` object](apis.md) that represents the module.
|
||||
|
||||
A module can export a value by assigning the ``exports`` property of
|
||||
its ``Module`` object. By default, the ``exports`` property of a
|
||||
``Module`` is its ``Document`` object, so that a script-less
|
||||
import is still useful (it exposes its contents, e.g. templates that
|
||||
the import might have been written to provide).
|
||||
``Module`` is an empty Object. Properties can be added to the object,
|
||||
or, it can be set to an entirely different object; for example, it
|
||||
could be set to the module's Document itself, in case the point of the
|
||||
module is to expose some ``template`` elements.
|
||||
|
||||
### Exporting element definitions ###
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user