MCPcopy Create free account
hub / github.com/dynjs/dynjs / unaryExpression

Method unaryExpression

src/main/java/org/dynjs/parser/js/Parser.java:823–866  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

821 }
822
823 public Expression unaryExpression() {
824 Expression expr = null;
825 switch (la()) {
826 case DELETE:
827 consume();
828 expr = unaryExpression();
829 if (currentContext().isStrict()) {
830 if (expr instanceof IdentifierReferenceExpression) {
831 throw new ThrowException(null, this.compilationContext.createSyntaxError("cannot delete a direct reference in strict-mode"));
832 }
833 }
834 return factory.deleteOperator(expr);
835 case VOID:
836 consume();
837 return factory.voidOperator(unaryExpression());
838 case TYPEOF:
839 consume();
840 return factory.typeofOperator(unaryExpression());
841 case PLUS_PLUS:
842 consume();
843 expr = unaryExpression();
844 checkAssignmentLHS(expr);
845 return factory.preIncrementOperator(expr);
846 case MINUS_MINUS:
847 consume();
848 expr = unaryExpression();
849 checkAssignmentLHS(expr);
850 return factory.preDecrementOperator(expr);
851 case PLUS:
852 consume();
853 return factory.unaryPlusOperator(unaryExpression());
854 case MINUS:
855 consume();
856 return factory.unaryMinusOperator(unaryExpression());
857 case INVERSION:
858 consume();
859 return factory.bitwiseInversionOperator(unaryExpression());
860 case NOT:
861 consume();
862 return factory.unaryNotOperator(unaryExpression());
863 default:
864 return postfixExpression();
865 }
866 }
867
868 public Expression postfixExpression() {
869 Expression expr = leftHandSideExpression();

Callers 1

Calls 15

laMethod · 0.95
consumeMethod · 0.95
currentContextMethod · 0.95
checkAssignmentLHSMethod · 0.95
postfixExpressionMethod · 0.95
deleteOperatorMethod · 0.80
voidOperatorMethod · 0.80
typeofOperatorMethod · 0.80
preIncrementOperatorMethod · 0.80
preDecrementOperatorMethod · 0.80
unaryPlusOperatorMethod · 0.80
unaryMinusOperatorMethod · 0.80

Tested by

no test coverage detected