diff --git a/lib/loaders/base_js.js b/lib/loaders/base_js.js
index <HASH>..<HASH> 100644
--- a/lib/loaders/base_js.js
+++ b/lib/loaders/base_js.js
@@ -115,6 +115,7 @@ module.exports = class BaseJavascriptModule {
     async _completeLoading(deviceClass) {
         if (this._config)
             this._config.install(deviceClass);
+        deviceClass.manifest = this._manifest;
         deviceClass.metadata = makeBaseDeviceMetadata(this._manifest);
 
         for (let action in this._manifest.actions) {
diff --git a/test/test_v2_device.js b/test/test_v2_device.js
index <HASH>..<HASH> 100644
--- a/test/test_v2_device.js
+++ b/test/test_v2_device.js
@@ -42,7 +42,9 @@ async function testPreloaded() {
 
     const factory = await module.getDeviceClass();
 
+
     assert.strictEqual(factory, MyDevice);
+    assert.strictEqual(factory.manifest, metadata);
     //assert.strictEqual(factory.metadata, metadata);
     assert.deepStrictEqual(factory.require('package.json'), {"name":"org.thingpedia.test.mydevice",
         "main": "index.js",
Expose Thingpedia manifests to JS devices

Expose it as "deviceClass.manifest" (aka this.constructor.manifest).
This allows devices to access their own Thingpedia definition for
reflection, and allows writing generic JS packages that can be
instantiated with multiple JS classes (e.g. for schema.org). It
can be an alternative to a custom loader.