当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript output_ast.not函数代码示例

本文整理汇总了TypeScript中angular2/src/compiler/output/output_ast.not函数的典型用法代码示例。如果您正苦于以下问题:TypeScript not函数的具体用法?TypeScript not怎么用?TypeScript not使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了not函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('should support operators', () => {
      var lhs = o.variable('lhs');
      var rhs = o.variable('rhs');
      expect(emitStmt(someVar.cast(o.INT_TYPE).toStmt())).toEqual('(someVar as int);');
      expect(emitStmt(o.not(someVar).toStmt())).toEqual('!someVar;');
      expect(
          emitStmt(someVar.conditional(o.variable('trueCase'), o.variable('falseCase')).toStmt()))
          .toEqual('someVar? trueCase: falseCase;');

      expect(emitStmt(lhs.equals(rhs).toStmt())).toEqual('(lhs == rhs);');
      expect(emitStmt(lhs.notEquals(rhs).toStmt())).toEqual('(lhs != rhs);');
      expect(emitStmt(lhs.identical(rhs).toStmt())).toEqual('identical(lhs, rhs);');
      expect(emitStmt(lhs.notIdentical(rhs).toStmt())).toEqual('!identical(lhs, rhs);');
      expect(emitStmt(lhs.minus(rhs).toStmt())).toEqual('(lhs - rhs);');
      expect(emitStmt(lhs.plus(rhs).toStmt())).toEqual('(lhs + rhs);');
      expect(emitStmt(lhs.divide(rhs).toStmt())).toEqual('(lhs / rhs);');
      expect(emitStmt(lhs.multiply(rhs).toStmt())).toEqual('(lhs * rhs);');
      expect(emitStmt(lhs.modulo(rhs).toStmt())).toEqual('(lhs % rhs);');
      expect(emitStmt(lhs.and(rhs).toStmt())).toEqual('(lhs && rhs);');
      expect(emitStmt(lhs.or(rhs).toStmt())).toEqual('(lhs || rhs);');
      expect(emitStmt(lhs.lower(rhs).toStmt())).toEqual('(lhs < rhs);');
      expect(emitStmt(lhs.lowerEquals(rhs).toStmt())).toEqual('(lhs <= rhs);');
      expect(emitStmt(lhs.bigger(rhs).toStmt())).toEqual('(lhs > rhs);');
      expect(emitStmt(lhs.biggerEquals(rhs).toStmt())).toEqual('(lhs >= rhs);');
    });
开发者ID:AwelEshetu,项目名称:angular,代码行数:25,代码来源:dart_emitter_spec.ts

示例2: createOperatorFn

    [
      'conditionalTrue',
      o.literal('')
          .prop('length')
          .equals(o.literal(0))
          .conditional(o.literal('true'), o.literal('false'))
    ],
    [
      'conditionalFalse',
      o.literal('')
          .prop('length')
          .notEquals(o.literal(0))
          .conditional(o.literal('true'), o.literal('false'))
    ],

    ['not', o.not(o.literal(false))],

    ['externalTestIdentifier', o.importExpr(testDataIdentifier)],
    ['externalSrcIdentifier', o.importExpr(eventEmitterIdentifier)],
    ['externalEnumIdentifier', o.importExpr(enumIdentifier)],

    ['externalInstance', o.variable('externalInstance')],
    ['dynamicInstance', o.variable('dynamicInstance')],

    ['throwError', o.variable('throwError')],
    ['catchError', o.variable('catchError')],

    [
      'operators',
      o.literalMap([
        ['==', createOperatorFn(o.BinaryOperator.Equals)],
开发者ID:ChinnasamyM,项目名称:angular,代码行数:31,代码来源:output_emitter_util.ts


注:本文中的angular2/src/compiler/output/output_ast.not函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。