Skip to content

Commit

Permalink
Improve handling for provisional global attributes in Darwin codegen. (
Browse files Browse the repository at this point in the history
…#1133)

If a global attribute is marked provisional, that should auto-mark it as
provisional for all clusters without requiring explicit annotations to that
effect.
  • Loading branch information
bzbarsky-apple authored Sep 12, 2023
1 parent 3ffd71e commit 9881ae9
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,25 @@ function isSupported(cluster, options) {
function isProvisional(cluster, options) {
let provisionalRelease = findReleaseForPathOrAncestorAndSection(this.global, cluster, options, 'provisional');
if (provisionalRelease === undefined) {
return false;
// For attributes, also check whether this is a provisional global
// attribute.
let attrName = options.hash.attribute;
if (attrName) {
provisionalRelease = findReleaseForPathOrAncestorAndSection(
this.global,
/* cluster does not apply to global attributes */
"",
/*
* Keep our options (e.g. in terms of isForIds bits), but replace
* attribute with globalAttribute.
*/
{ hash: { ...options.hash, attribute: undefined, globalAttribute: attrName } },
'provisional'
);
}
if (provisionalRelease === undefined) {
return false;
}
}

let path = makeAvailabilityPath(cluster, options);
Expand Down

0 comments on commit 9881ae9

Please sign in to comment.