Skip to content

Commit db28908

Browse files
author
its-pranjalpandey
committed
fix: bug with compile function
1 parent 3a7a909 commit db28908

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.DS_Store

6 KB
Binary file not shown.

src/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function pAttributeGroup(Node\AttributeGroup$node)
7676

7777
protected function pName(Name $node)
7878
{
79-
throw new \LogicException('Classes/Namespaces cannot be added in embedded logic');
79+
return implode('\\', $node->parts);
8080
}
8181

8282
protected function pName_FullyQualified(Name\FullyQualified$node)

src/Php2js.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public static function compile($code){
1717
}
1818

1919
$compiler= new Compiler;
20-
$jsCode = $prettyPrinter->prettyPrint($ast);
21-
return $newCode;
20+
$jscode = $compiler->prettyPrint($ast);
21+
return $jscode;
2222
}
2323

2424
public static function compileFile($input,$output=null){

0 commit comments

Comments
 (0)