mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-09-23 10:21:31 +00:00
Declare properties statically
Before PHP 8.2 properties were created dynamically, this is deprecated now. This change patches the class definition and defines the dynamic properties upfront.
Bug: T314099
Bug: T360709
Change-Id: Ic197369647fbd6649daebe994bae39165e3882cc
(cherry picked from commit 81dedc1909
)
This commit is contained in:
parent
b3e9b63db0
commit
eedb2003d0
|
@ -100,7 +100,10 @@ if ( options.debug ) {
|
|||
console.log( `Found ${match}.` );
|
||||
}
|
||||
}
|
||||
const newParse = parser.replace( regexp, '\\x{00$1}' );
|
||||
parser = parser
|
||||
.replace( regexp, '\\x{00$1}' )
|
||||
// declare properties for the parser that were created dynamically before PHP 8.2
|
||||
.replace( /class Parser \{/, 'class Parser {\n private $tu;\n private $options;' );
|
||||
|
||||
fs.writeFileSync( options.output, newParse );
|
||||
fs.writeFileSync( options.output, parser );
|
||||
console.log( 'Generated output file at: ' + options.output );
|
||||
|
|
|
@ -88,6 +88,8 @@ if (!class_exists("MediaWiki\\Extension\\Math\\TexVC\\SyntaxError", false)) {
|
|||
}
|
||||
|
||||
class Parser {
|
||||
private $tu;
|
||||
private $options;
|
||||
private $peg_currPos = 0;
|
||||
private $peg_reportedPos = 0;
|
||||
private $peg_cachedPos = 0;
|
||||
|
|
Loading…
Reference in a new issue