Skip to content

Commit

Permalink
Add trustedTypes.emptyScript. (#251)
Browse files Browse the repository at this point in the history
Fix #218.
  • Loading branch information
koto committed Dec 13, 2019
1 parent 7a3e772 commit d2dd649
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 143 deletions.
5 changes: 5 additions & 0 deletions dist/cjs/trustedtypes.api_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ const trustedTypesBuilderTestOnly = function() {
// Common constants.
const emptyHTML = freeze(create(new TrustedHTML(creatorSymbol, '')));
privates(emptyHTML)['v'] = '';
const emptyScript = freeze(create(new TrustedScript(creatorSymbol, '')));
privates(emptyScript)['v'] = '';


/**
* A map of attribute / property names to allowed types
Expand Down Expand Up @@ -640,6 +643,7 @@ const trustedTypesBuilderTestOnly = function() {
getPropertyType,
getTypeMapping,
emptyHTML,
emptyScript,
defaultPolicy, // Just to make the compiler happy, this is overridden below.

TrustedHTML: TrustedHTML,
Expand Down Expand Up @@ -712,6 +716,7 @@ function setupPolyfill() {
'getPropertyType': tt.getPropertyType,
'getTypeMapping': tt.getTypeMapping,
'emptyHTML': tt.emptyHTML,
'emptyScript': tt.emptyScript,
'_isPolyfill_': true,
});
Object.defineProperty(
Expand Down
40 changes: 20 additions & 20 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.

78 changes: 39 additions & 39 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 d2dd649

Please sign in to comment.