-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make key properties writable to allow polyfilling
Many polyfills rewrite built-ins on the DOM to add new functionality and support new upcoming specs. In the browser, this is fine - DOM properties are reliably writable. In Domino they weren't. The specific changes here are to support the custom-elements polyfill https://github.com/webcomponents/custom-elements/blob/master/src/custom-elements.js but cover the most popular and widely applicable methods. This should probably be extended in future to cover the whole API. Writability is configurable. If you wish to lock down the DOM API, set the global `__domino_frozen__` to `true` before your first `require('domino')`. Fixes: #89
- Loading branch information
Showing
6 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* This file defines Domino behaviour that can be externally configured. | ||
* To change these settings, set the relevant global property *before* | ||
* you call `require("domino")`. | ||
*/ | ||
|
||
exports.isApiWritable = !global.__domino_frozen__; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters