Skip to content

Commit

Permalink
4.0.0-pre.7 with Issue #15 Add root property for shadowRoot to imitat…
Browse files Browse the repository at this point in the history
…e a Polymer element
  • Loading branch information
t2ym committed Mar 2, 2019
1 parent 99bb564 commit 19ce39f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions i18n-format.js
Expand Up @@ -240,6 +240,13 @@ export class I18nFormat extends polyfill(HTMLElement) {
}
}

/**
* root property to imitate a Polymer element
*/
get root() {
return this.shadowRoot;
}

/**
* Default locale constant 'en'
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -18,7 +18,7 @@
},
"homepage": "https://github.com/t2ym/i18n-format#readme",
"name": "i18n-format",
"version": "4.0.0-pre.6",
"version": "4.0.0-pre.7",
"main": "i18n-format.js",
"directories": {
"test": "test"
Expand Down
4 changes: 4 additions & 0 deletions test/basic-test.html
Expand Up @@ -378,6 +378,10 @@
assert.equal(typeof el.constructor.importMeta, 'object', 'importMeta is an object');
});

test('root property', function () {
assert.equal(el.root, el.shadowRoot, 'root is identical to shadowRoot');
});

suiteTeardown(function () {
el = undefined;
var f = document.querySelector('test-fixture#default');
Expand Down

0 comments on commit 19ce39f

Please sign in to comment.