Permalink
Browse files

Support unicode property names in as.cpp

Summary: Fixes #8192

Reviewed By: fredemmott

Differential Revision: D7954911
  • Loading branch information...
paulbiss authored and fredemmott committed May 10, 2018
1 parent ca147be commit 3336daa921e45d43ef4a2254b85f87b97883ab65
Showing with 30 additions and 1 deletion.
  1. +4 −1 hphp/runtime/vm/as.cpp
  2. +18 −0 hphp/test/quick/unicode-parse.php
  3. +6 −0 hphp/test/quick/unicode-parse.php.expect
  4. +2 −0 hphp/test/run
@@ -2616,7 +2616,10 @@ void parse_property(AsmState& as) {
auto const userTyStr = userTy ? userTy : staticEmptyString();
std::string name;
if (!as.in.readword(name)) {
as.in.skipSpaceTab();
as.in.consumePred(!boost::is_any_of(" \t\r\n#;="),
std::back_inserter(name));
if (name.empty()) {
as.error("expected name for property");
}
@@ -0,0 +1,18 @@
<?php
class_ಠ {
public $ИдентификаторТовара;
public $το_αναγνωριστικό_του;
function __construct() {
$this->ИдентификаторТовара = 100;
$this->το_αναγνωριστικό_του = 200;
}
}
$ಠ_ರೃ = new_ಠ;
$ಠ_ರೃ->ИдентификаторТовара = 10;
$ಠ_ರೃ->το_αναγνωριστικό_του = 20;
var_dump($ಠ_ರೃ);
@@ -0,0 +1,6 @@
object(ಠ_ಠ)#1 (2) {
["ИдентификаторТовара"]=>
int(10)
["το_αναγνωριστικό_του"]=>
int(20)
}
@@ -1920,6 +1920,8 @@ function strip_hhas_file($file) {
|| substr($s, 0, 7) === ".strict") {
continue;
}
// We have separate tests for srclocs, skip over them here
if (substr(trim($s), 0, 7) === '.srcloc') continue;
$buf .= $s;
}
fclose($h);

0 comments on commit 3336daa

Please sign in to comment.