archives

« Bugzilla Issues Index

#3091 — Loader.import should support options.metadata


The spec seems inconsistent about the metadata property. The define() function of Loader accepts options.metadata:
---
26.3.3.2Reflect.Loader.prototype.define ( name, source [ , options ] )

...

8. Let metadata be GetOption(options, "metadata").
9. ReturnIfAbrupt(metadata).
10. If metadata is undefined then let metadata be ObjectCreate(%ObjectPrototype%).
---
But the import() function does not:
Reflect.Loader.prototype.import ( name [ , options ]
...
4. Let p be the result of calling LoadModule(loaderRecord, name, options).
...
15.2.4.1LoadModule(loader, name, options) Abstract Operation
...
8 Let metadata be ObjectCreate(%ObjectPrototype%).


That means I can pass .metadata to define() but not import(). I think the metadata should be passed on both.


concerns old module spec.