mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-02-18 01:48:36 +00:00
Sparks: Assets, 1.5.1
http://getsparks.org/packages/assets/versions/HEAD/show Creates our minified and combined .js and .css files
This commit is contained in:
42
sparks/assets/1.5.1/libraries/coffeescript/yy/Existence.php
Executable file
42
sparks/assets/1.5.1/libraries/coffeescript/yy/Existence.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace CoffeeScript;
|
||||
|
||||
class yy_Existence extends yy_Base
|
||||
{
|
||||
public $children = array('expression');
|
||||
|
||||
function constructor($expression)
|
||||
{
|
||||
$this->expression = $expression;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
function compile_node($options = array())
|
||||
{
|
||||
$this->expression->front = $this->front;
|
||||
$code = $this->expression->compile($options, LEVEL_OP);
|
||||
|
||||
if (preg_match(IDENTIFIER, $code) && ! $options['scope']->check($code))
|
||||
{
|
||||
list($cmp, $cnj) = $this->negated ? array('===', '||') : array('!==', '&&');
|
||||
|
||||
$code = "typeof {$code} {$cmp} \"undefined\" {$cnj} {$code} {$cmp} null";
|
||||
}
|
||||
else
|
||||
{
|
||||
$code = "{$code} ".($this->negated ? '==' : '!=').' null';
|
||||
}
|
||||
|
||||
return (isset($options['level']) && $options['level'] <= LEVEL_COND) ? $code : "({$code})";
|
||||
}
|
||||
|
||||
function invert()
|
||||
{
|
||||
$this->negated = ! $this->negated;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user