EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificações Página 236

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 304
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 235
CHAPTER 8: ExtendScript Tools and Features Operator overloading 236
You can override the following operators:
X The operators > and >= are implemented by executing NOT operator <= and NOT operator <.
X Combined assignment operators such as *= are not supported.
All operator overload implementations must return the result of the operation. To perform the default
operation, return
undefined.
Unary operator functions work on the
this object, while binary operators work on the this object and
the first argument. The + and - operators have both unary and binary implementations. If the first
argument is undefined, the operator is unary; if it is supplied, the operator is binary.
For binary operators, a second argument indicates the order of operands. For noncommutative operators,
either implement both order variants in your function or return
undefined for combinations that you do
not support. For example:
this ["/"] = function (operand, rev) {
if (rev) {
// do not resolve operand / this
return;
} else {
// resolve this / operand
return this.value / operand;
}
Unary
+, -
~
Binary
+, -
*, /, %, ^
<, <=, ==
<<, >>, >>>
&, |, ===
Vista de página 235
1 2 ... 231 232 233 234 235 236 237 238 239 240 241 ... 303 304

Comentários a estes Manuais

Sem comentários