Skip to content

Commit ef2077f

Browse files
authored
Merge pull request #3718 from processing/nov-updates
Remove Donation Compaign and Address Warnings
2 parents f3b1eeb + 26d4406 commit ef2077f

File tree

4 files changed

+16
-29
lines changed

4 files changed

+16
-29
lines changed

client/index.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ const store = setupStore(initialState);
2323

2424
const DONATE_LOGO_IMAGE_URL = 'https://donorbox.org/images/white_logo.svg';
2525

26+
const showDonateCampaign = false;
27+
2628
if (
29+
showDonateCampaign &&
2730
window.location.href.indexOf('full') === -1 &&
2831
window.location.href.indexOf('embed') === -1
2932
) {

client/utils/rename-variable.js

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
4646

4747
const startIndex = node.start;
4848
const endIndex = node.end;
49-
50-
if (node.name !== oldName) return;
51-
5249
const pos = cm.posFromIndex(startIndex);
5350

5451
if (
@@ -57,19 +54,15 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
5754
parent.type === 'ArrowFunctionExpression') &&
5855
parent.params.some((p) => p.type === 'Identifier' && p.name === oldName)
5956
) {
60-
if (!parent.params.includes(node)) {
61-
return;
62-
}
57+
if (!parent.params.includes(node)) return;
6358
}
6459

6560
if (
6661
parent.type === 'MemberExpression' &&
6762
parent.property === node &&
6863
!parent.computed
6964
) {
70-
if (parent.object.type === 'ThisExpression' && !isBaseThis) {
71-
return;
72-
}
65+
if (parent.object.type === 'ThisExpression' && !isBaseThis) return;
7366
}
7467

7568
const thisContext = getContext(
@@ -84,6 +77,8 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
8477
let shouldRenameGlobalVar = false;
8578
const isThis = isThisReference(cm, ast, pos, oldName);
8679

80+
shouldRenameGlobalVar = isGlobal && thisContext === 'global';
81+
8782
// Handle renaming inside classes
8883
if (isInsideClassContext) {
8984
const tempPos = {
@@ -121,14 +116,6 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
121116
isThis === isBaseThis &&
122117
baseContext === thisContext
123118
) {
124-
Object.entries(classMeta.methodVars || {}).forEach(
125-
([methodName, vars]) => {
126-
if (!vars.includes(oldName) && thisContext === methodName) {
127-
const shouldRenameMethodVar = true;
128-
}
129-
}
130-
);
131-
132119
shouldRename =
133120
thisContext === baseContext &&
134121
(currentMethodName === 'constructor' || shouldRenameGlobalVar);
@@ -162,7 +149,6 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
162149
isGlobal &&
163150
!Object.prototype.hasOwnProperty.call(thisScopeVars, oldName);
164151
}
165-
shouldRenameGlobalVar = isGlobal && thisContext === 'global';
166152
}
167153
// Handle renaming outside classes
168154
else {
@@ -201,15 +187,13 @@ function startRenaming(cm, ast, fromPos, newName, oldName) {
201187
isBaseThis
202188
);
203189

204-
if (
205-
isThisGlobal &&
206-
thisContext in userDefinedFunctionMetadata &&
207-
userDefinedFunctionMetadata[thisContext].params.some(
208-
(param) => param.p === oldName
209-
)
210-
) {
211-
return;
212-
}
190+
const params = userDefinedFunctionMetadata[thisContext]?.params || [];
191+
const hasParamNamedOldName = params.some((param) =>
192+
typeof param === 'string'
193+
? param === oldName
194+
: param?.name === oldName || param?.p === oldName
195+
);
196+
if (isThisGlobal && hasParamNamedOldName) return;
213197

214198
const methodPath = path.findParent((p) => p.isClassMethod());
215199
let currentMethodName = null;

client/utils/showRenameDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import announceToScreenReader from './ScreenReaderHelper';
22
import p5CodeAstAnalyzer from './p5CodeAstAnalyzer';
3-
import { getClassContext, getContext, getAST } from './renameVariableHelper';
3+
import { getContext, getAST } from './renameVariableHelper';
44

55
const allFuncs = require('./p5-reference-functions.json');
66

common/p5Versions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const currentP5Version = '1.11.10'; // Don't update to 2.x until 2026
1+
export const currentP5Version = '1.11.11'; // Don't update to 2.x until 2026
22

33
// Generated from https://www.npmjs.com/package/p5?activeTab=versions
44
// Run this in the console:

0 commit comments

Comments
 (0)