Skip to content

Commit

Permalink
Added TrustedTypes.emptyHTML implementation. (#173)
Browse files Browse the repository at this point in the history
Fixes #95.
  • Loading branch information
koto authored May 16, 2019
1 parent 29ca732 commit ecbb9f3
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 122 deletions.
6 changes: 6 additions & 0 deletions dist/cjs/trustedtypes.api_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ const trustedTypesBuilderTestOnly = function() {

lockdownTrustedType(TrustedType, 'TrustedType');

// Common constants.
const emptyHTML = freeze(create(new TrustedHTML(creatorSymbol, '')));
privates(emptyHTML)['v'] = '';

/**
* A map of attribute / property names to allowed types
* for known namespaces.
Expand Down Expand Up @@ -655,6 +659,7 @@ const trustedTypesBuilderTestOnly = function() {
getAttributeType,
getPropertyType,
getTypeMapping,
emptyHTML,

TrustedHTML: TrustedHTML,
TrustedURL: TrustedURL,
Expand Down Expand Up @@ -710,6 +715,7 @@ function setupPolyfill() {
'getAttributeType': tt.getAttributeType,
'getPropertyType': tt.getPropertyType,
'getTypeMapping': tt.getTypeMapping,
'emptyHTML': tt.emptyHTML,
'_isPolyfill_': true,
});
window['TrustedTypes'] = Object.freeze(publicApi);
Expand Down
38 changes: 19 additions & 19 deletions dist/es5/trustedtypes.api_only.build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es5/trustedtypes.api_only.build.js.map

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions dist/es5/trustedtypes.build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es5/trustedtypes.build.js.map

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/es6/trustedtypes.api_only.build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es6/trustedtypes.api_only.build.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit ecbb9f3

Please sign in to comment.