You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
889 B
JavaScript

"use strict";
const moduleAPI = require("./module-api");
const createRegistry = require("./registry");
/* Traits:
- Special 'slot' value; for use in trait implementations to indicate that the specified trait definition property should be filled in by the instance constructor, not by the trait implementation
Possible field types for a trait:
- Static value [add the value to the type's prototype?]
- Type/validation rule [check against implementation, see below]
Possible field types for a trait implementation (all of them fill in type/validation rules):
- Static value, including an appropriately guarded function [add the value to the type's prototype?]
- Slot [add the trait rule to the type rules]
Disallow extra fields in trait implementations!
TODO: Add full property paths to errors?
*/
module.exports = Object.assign({
createRegistry: createRegistry
}, moduleAPI);