Skip to content

Commit

Permalink
Removing getPolicyNames. (#264)
Browse files Browse the repository at this point in the history
A proper introspection at policy creation time (possibly via events)
will be created at a later point.

Fixes #235.
  • Loading branch information
koto authored Mar 5, 2020
1 parent cddc9e0 commit bcd3c1b
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 201 deletions.
15 changes: 0 additions & 15 deletions dist/cjs/trustedtypes.api_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,18 +529,6 @@ const trustedTypesBuilderTestOnly = function() {
return deepClone(map);
}

/**
* Returns all configured policy names (even for non-exposed policies).
* @return {!Array<string>}
*/
function getPolicyNames() {
// TODO(msamuel): Should we sort policyNames to avoid leaking or
// encouraging dependency on the order in which policy names are
// registered? I think JavaScript builtin sorts are efficient for
// almost-sorted lists so the amortized cost is close to O(n).
return policyNames.slice();
}

/**
* Creates a TT policy.
*
Expand Down Expand Up @@ -630,8 +618,6 @@ const trustedTypesBuilderTestOnly = function() {
// The main function to create policies.
createPolicy,

getPolicyNames,

// Type checkers, also validating the object was initialized through a
// policy.
isHTML: isTrustedTypeChecker(TrustedHTML),
Expand Down Expand Up @@ -711,7 +697,6 @@ function setupPolyfill() {
'isScriptURL': tt.isScriptURL,
'isScript': tt.isScript,
'createPolicy': tt.createPolicy,
'getPolicyNames': tt.getPolicyNames,
'getAttributeType': tt.getAttributeType,
'getPropertyType': tt.getPropertyType,
'getTypeMapping': tt.getTypeMapping,
Expand Down
20 changes: 10 additions & 10 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.

46 changes: 23 additions & 23 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.

20 changes: 10 additions & 10 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 bcd3c1b

Please sign in to comment.