code stringlengths 2 1.05M |
|---|
'use strict'
var Command = require('../../../lib/common/command/command'),
ObjectProvider = require('../../../lib/common/dependency-injection/object-provider')
;
var objectProvider = new ObjectProvider();
objectProvider.class = Command;
objectProvider.debug = false;
module.exports = objectProvider; |
/*
* @name Objects
* @arialabel Small white circle on dark navy background that moves in small amounts in various directions by a small amount by itself like it is jittering
* @description Create a Jitter class, instantiate an object,
* and move it around the screen. Adapted from Getting Started with
* Processing by Casey Reas and Ben Fry.
*/
let bug; // Declare object
function setup() {
createCanvas(710, 400);
// Create object
bug = new Jitter();
}
function draw() {
background(50, 89, 100);
bug.move();
bug.display();
}
// Jitter class
class Jitter {
constructor() {
this.x = random(width);
this.y = random(height);
this.diameter = random(10, 30);
this.speed = 1;
}
move() {
this.x += random(-this.speed, this.speed);
this.y += random(-this.speed, this.speed);
}
display() {
ellipse(this.x, this.y, this.diameter, this.diameter);
}
}
|
/**
* 场景切换
*/
var TestSceneLayer = TestBaseLayer.extend({
w: 0,
h: 0,
w2: 0,
h2: 0,
ctor: function(){
this._super();
this.w = this.size.width;
this.h = this.size.height;
this.w2 = this.size.width / 2;
this.h2 = this.size.height / 2;
var helloLabel = new cc.LabelTTF("场景切换和带有颜色的层", "Arial",24);
helloLabel.x = this.w2;
helloLabel.y = this.h - helloLabel.getContentSize().height;
this.addChild(helloLabel, 5);
var helloLabel1 = new cc.LabelTTF("TransitionScene and LayerColor", "Arial",24);
helloLabel1.x = this.w2;
helloLabel1.y = this.h - 2 * helloLabel.getContentSize().height;
this.addChild(helloLabel1, 5);
// 创建一个带有【颜色】的层 . RGBA
var layer = new cc.LayerColor(cc.color(255, 128, 128));
this.addChild(layer);
// 给层添加了一个触摸事件
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: true,
onTouchBegan: this.onTouchBegan
}, this);
return true;
},
onTouchBegan:function (touch, event) {
var target = event.getCurrentTarget();
target.runSceneTran();
return true;
},
runSceneTran:function () {
var time = 3;
var scene = new cc.Scene();
var layer = new cc.LayerColor(cc.color(128, 128, 255));
// 添加透明
// var layer = new cc.LayerColor(cc.color(128, 128, 255, 100));
// 层设置大小
layer.setContentSize(this.w * 0.8, this.h * 0.8);
layer.setPosition(this.w * 0.1, this.h * 0.1);
scene.addChild(layer, 0);
// cc.director.runScene(scene);
// 基础切换
// cc.director.runScene(new cc.TransitionScene(time,scene));
// 继承,cc.TransitionScene。提供了方向支持。
// 支持的方向:LeftOver,RightOver,UpOver,DownOver
// cc.TRANSITION_ORIENTATION_LEFT_OVER
// cc.TRANSITION_ORIENTATION_RIGHT_OVER
// cc.TRANSITION_ORIENTATION_UP_OVER
// cc.TRANSITION_ORIENTATION_DOWN_OVER
// cc.director.runScene(new cc.TransitionSceneOriented(time,scene,cc.TRANSITION_ORIENTATION_LEFT_OVER));
// 旋转
// cc.director.runScene(new cc.TransitionRotoZoom(time, scene));
// 跳转
// cc.director.runScene(new cc.TransitionJumpZoom(time, scene));
// 四方推入
// cc.director.runScene(new cc.TransitionMoveInL(time,scene));
// cc.director.runScene(new cc.TransitionMoveInR(time,scene));
// cc.director.runScene(new cc.TransitionMoveInT(time,scene));
// cc.director.runScene(new cc.TransitionMoveInB(time,scene));
// 四面滑入
// cc.director.runScene(new cc.TransitionSlideInL(time,scene));
// cc.director.runScene(new cc.TransitionSlideInR(time,scene));
// cc.director.runScene(new cc.TransitionSlideInB(time,scene));
// cc.director.runScene(new cc.TransitionSlideInT(time,scene));
// 本场景缩小切换到另一场景放大
// cc.director.runScene(new cc.TransitionShrinkGrow(time,scene));
// X轴和Y轴翻转
// cc.director.runScene(new cc.TransitionFlipX(time,scene,cc.TRANSITION_ORIENTATION_LEFT_OVER));
// cc.director.runScene(new cc.TransitionFlipY(time,scene,cc.TRANSITION_ORIENTATION_UP_OVER));
// X轴和Y轴有角度翻转
// cc.director.runScene(new cc.TransitionFlipAngular(time,scene,cc.TRANSITION_ORIENTATION_RIGHT_OVER));
// 水平翻转屏幕,做一个 传入/穿出 缩放, 正面是传出的场景,背面是传入的场景。
// cc.director.runScene(new cc.TransitionZoomFlipX(time,scene,cc.TRANSITION_ORIENTATION_LEFT_OVER));
// cc.director.runScene(new cc.TransitionZoomFlipY(t,scene,cc.TRANSITION_ORIENTATION_LEFT_OVER));
// 一半水平一半垂直传入/穿出翻转并一点点的缩放屏幕正面是传出的场景,背面是传入的场景
// cc.director.runScene(new cc.TransitionZoomFlipAngular(time,scene,cc.TRANSITION_ORIENTATION_LEFT_OVER));
// 淡出传出场景,淡入传入场景
// cc.director.runScene(new cc.TransitionFade(time,scene));
// cc.director.runScene(new cc.TransitionFade(time,scene, cc.color(255,128,255, 255)));
// 两个 scenes 使用 RenderTexture 对象交叉淡入淡出
// cc.director.runScene(new cc.TransitionCrossFade(time,scene));
// 随机顺序关闭淡出场景的 tiles
// cc.director.runScene(new cc.TransitionTurnOffTiles(time,scene));
// 奇数列向上推移而偶数列向下推移.
// cc.director.runScene(new cc.TransitionSplitCols(time,scene));
// cc.director.runScene(new cc.TransitionSplitRows(time,scene));
// 从各个方向淡出 scene 的所有 tiles
cc.director.runScene(new cc.TransitionFadeTR(time,scene));
// cc.director.runScene(new cc.TransitionFadeBL(time,scene));
// cc.director.runScene(new cc.TransitionFadeUp(time,scene));
// cc.director.runScene(new cc.TransitionFadeDown(time,scene));
}
});
var TestSceneScene = cc.Scene.extend({
onEnter: function(){
this._super();
var layer = new TestSceneLayer();
this.addChild(layer);
}
}); |
'use strict';
var fs = require('fs'),
util = require('util'),
Int64 = require('node-int64'),
constants = require('../lib/constants');
if (process.argv.length < 3) {
console.warn('Usage: node ' + process.argv[1] + ' <debug output file>');
process.exit(1);
}
var debugOutputFile = process.argv[2];
var tryToConvert = true;
var rxPrefix = 'Connection Rx:';
var txPrefix = 'amqp10-Frame Sending frame:';
function s(cnt) {
var r = '';
for (var idx = 0; idx < cnt; ++idx) r += ' ';
return r;
}
function checkLength(str, l) {
if (str.length < l) {
console.log('String smaller than expected: ('+str.length+' < '+l+')');
return false;
}
return true;
}
function x(hexstr, consumed, result, indent) {
if (hexstr.length === 0) return { consumed: consumed, result: result };
var prefix = hexstr.substr(0, 2);
hexstr = hexstr.substr(2);
consumed += 2;
if (prefix === '00') {
result += s(indent) + prefix + '\n';
var label = x(hexstr, consumed, result, indent + 2);
hexstr = hexstr.substr(label.consumed - consumed);
result = label.result;
consumed = label.consumed;
var body = x(hexstr, consumed, result, indent + 2);
hexstr = hexstr.substr(body.consumed - consumed);
result = body.result;
consumed = body.consumed;
} else {
var len, nent, val, parsedColl;
switch (prefix[0]) {
case '4':
result += s(indent) + prefix + '\n';
break;
case '5':
val = hexstr.substr(0, 2);
consumed += 2;
hexstr = hexstr.substr(2);
result += s(indent) + prefix + ' ' + val + '\n';
break;
case '6':
val = hexstr.substr(0, 4);
consumed += 4;
hexstr = hexstr.substr(4);
result += s(indent) + prefix + ' ' + val + '\n';
break;
case '7':
val = hexstr.substr(0, 8);
consumed += 8;
hexstr = hexstr.substr(8);
result += s(indent) + prefix + ' ' + val + '\n';
break;
case '8':
val = hexstr.substr(0, 16);
consumed += 16;
hexstr = hexstr.substr(16);
result += s(indent) + prefix + ' ' + val + '\n';
break;
case 'a':
len = new Buffer(hexstr.substr(0, 2), 'hex').readUInt8(0);
consumed += 2;
hexstr = hexstr.substr(2);
val = hexstr.substr(0, len * 2);
consumed += len * 2;
hexstr = hexstr.substr(len * 2);
if (tryToConvert || prefix[1] === '1' || prefix[1] === '3') val = new Buffer(val, 'hex').toString('utf8');
result += s(indent) + prefix + ' ' + len + '\n' + s(indent + 2) + val + '\n';
break;
case 'b':
len = new Buffer(hexstr.substr(0, 8), 'hex').readUInt32BE(0);
consumed += 8;
hexstr = hexstr.substr(8);
val = hexstr.substr(0, len * 2);
consumed += len * 2;
hexstr = hexstr.substr(len * 2);
if (tryToConvert || prefix[1] === '1' || prefix[1] === '3') val = new Buffer(val, 'hex').toString('utf8');
result += s(indent) + prefix + ' ' + len + '\n' + s(indent + 2) + val + '\n';
break;
case 'c':
len = new Buffer(hexstr.substr(0, 2), 'hex').readUInt8(0);
consumed += 2;
hexstr = hexstr.substr(2);
nent = new Buffer(hexstr.substr(0, 2), 'hex').readUInt8(0);
consumed += 2;
hexstr = hexstr.substr(2);
val = hexstr.substr(0, (len - 1) * 2);
consumed += (len - 1) * 2;
hexstr = hexstr.substr((len - 1) * 2);
parsedColl = x(val, 0, '', indent + 2);
result += s(indent) + prefix + ' ' + len + ' ' + nent + '\n' + parsedColl.result;
break;
case 'd':
len = new Buffer(hexstr.substr(0, 8), 'hex').readUInt32BE(0);
consumed += 8;
hexstr = hexstr.substr(8);
nent = new Buffer(hexstr.substr(0, 8), 'hex').readUInt32BE(0);
consumed += 8;
hexstr = hexstr.substr(8);
val = hexstr.substr(0, (len - 1) * 2);
consumed += (len - 1) * 2;
hexstr = hexstr.substr((len - 1) * 2);
parsedColl = x(val, 0, '', indent + 2);
result += s(indent) + prefix + ' ' + len + ' ' + nent + '\n' + parsedColl.result;
break;
default:
console.log('Error: Unexpected prefix ' + prefix);
result += s(indent) + prefix + ' unexpected\n';
break;
}
}
return x(hexstr, consumed, result, indent);
}
function parseHex(hexstr) {
var amqpstr = constants.amqpVersion.toString('hex');
var headerIdx = hexstr.indexOf(amqpstr);
var body = hexstr;
if (headerIdx === -1) {
console.log('Header not found, assuming partial trace. If trace is not frame-aligned, results will be incorrect.');
} else {
body = hexstr.substr(headerIdx + amqpstr.length);
}
// Assume everything from here on out is frames
var parsed = '';
var error = false;
while (!error && body.length > 0) {
var lengthstr = body.substr(0, 8);
if (checkLength(body, 16)) {
body = body.substr(16);
var frameLength64 = new Int64(new Buffer('00000000' + lengthstr, 'hex'));
var frameLength = frameLength64.valueOf() * 2 - (8*2);
if (checkLength(body, frameLength)) {
var frame = body.substr(0, frameLength);
var parsedFrame = x(frame, 0, '', 2).result;
parsed += 'Frame of length ' + frameLength + ':\n';
parsed += parsedFrame;
body = body.substr(frameLength);
} else error = true;
} else error = true;
}
return parsed;
}
fs.readFile(debugOutputFile, function (err, data) {
var lines = data.toString().split('\n');
var rxHex = '';
var txHex = '';
for (var idx in lines) {
var line = lines[idx].trim();
var idxOfPrefix = line.indexOf(rxPrefix);
if (idxOfPrefix >= 0) {
var curRxHex = line.substr(idxOfPrefix + rxPrefix.length + 1).trim();
if (curRxHex.indexOf(' +') !== -1) {
curRxHex = curRxHex.substr(0, curRxHex.indexOf(' +'));
}
rxHex += curRxHex;
}
idxOfPrefix = line.indexOf(txPrefix);
if (idxOfPrefix >= 0) {
var rest = line.substr(idxOfPrefix + txPrefix.length + 1).trim();
var idxOfHexStart = rest.indexOf('}: ');
if (idxOfHexStart >= 0) {
var curTxHex = rest.substr(idxOfHexStart + '}: '.length);
if (curTxHex.indexOf(' +') !== -1) {
curTxHex = curTxHex.substr(0, curTxHex.indexOf(' +'));
}
txHex += curTxHex;
}
}
}
var parsedRxHex = parseHex(rxHex);
var parsedTxHex = parseHex(txHex);
console.log('============================================');
console.log('=============== Received ===================');
console.log('============================================\n');
console.log('Hex:');
console.log(rxHex);
console.log('\nParsed:');
console.log(parsedRxHex);
console.log('\n============================================');
console.log('================= Sent =====================');
console.log('============================================\n');
console.log('Hex:');
console.log(txHex);
console.log('\nParsed:');
console.log(parsedTxHex);
});
|
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function (req, res, next) {
res.render('index', { title: 'Minnebar 2017 Session Map' });
});
module.exports = router;
|
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
const common = require('../common');
const assert = require('assert');
const util = require('util');
const [, , modeArgv, sectionArgv] = process.argv;
if (modeArgv === 'child')
child(sectionArgv);
else
parent();
function parent() {
test('foo,tud,bar', true, 'tud');
test('foo,tud', true, 'tud');
test('tud,bar', true, 'tud');
test('tud', true, 'tud');
test('foo,bar', false, 'tud');
test('', false, 'tud');
test('###', true, '###');
test('hi:)', true, 'hi:)');
test('f$oo', true, 'f$oo');
test('f$oo', false, 'f.oo');
test('no-bar-at-all', false, 'bar');
test('test-abc', true, 'test-abc');
test('test-a', false, 'test-abc');
test('test-*', true, 'test-abc');
test('test-*c', true, 'test-abc');
test('test-*abc', true, 'test-abc');
test('abc-test', true, 'abc-test');
test('a*-test', true, 'abc-test');
test('*-test', true, 'abc-test');
}
function test(environ, shouldWrite, section, forceColors = false) {
let expectErr = '';
const expectOut = 'ok\n';
const spawn = require('child_process').spawn;
const child = spawn(process.execPath, [__filename, 'child', section], {
env: Object.assign(process.env, {
NODE_DEBUG: environ,
FORCE_COLOR: forceColors ? 'true' : 'false'
})
});
if (shouldWrite) {
if (forceColors) {
const { colors, styles } = util.inspect;
const addCodes = (arr) => [`\x1B[${arr[0]}m`, `\x1B[${arr[1]}m`];
const num = addCodes(colors[styles.number]);
const str = addCodes(colors[styles.string]);
const regexp = addCodes(colors[styles.regexp]);
const start = `${section.toUpperCase()} ${num[0]}${child.pid}${num[1]}`;
const debugging = `${regexp[0]}/debugging/${regexp[1]}`;
expectErr =
`${start}: this { is: ${str[0]}'a'${str[1]} } ${debugging}\n` +
`${start}: num=1 str=a obj={"foo":"bar"}\n`;
} else {
const start = `${section.toUpperCase()} ${child.pid}`;
expectErr =
`${start}: this { is: 'a' } /debugging/\n` +
`${start}: num=1 str=a obj={"foo":"bar"}\n`;
}
}
let err = '';
child.stderr.setEncoding('utf8');
child.stderr.on('data', (c) => {
err += c;
});
let out = '';
child.stdout.setEncoding('utf8');
child.stdout.on('data', (c) => {
out += c;
});
child.on('close', common.mustCall((c) => {
assert(!c);
assert.strictEqual(err, expectErr);
assert.strictEqual(out, expectOut);
// Run the test again, this time with colors enabled.
if (!forceColors) {
test(environ, shouldWrite, section, true);
}
}));
}
function child(section) {
const tty = require('tty');
// Make sure we check for colors, no matter of the stream's default.
Object.defineProperty(process.stderr, 'hasColors', {
value: tty.WriteStream.prototype.hasColors
});
// eslint-disable-next-line no-restricted-syntax
const debug = util.debuglog(section, common.mustCall((cb) => {
assert.strictEqual(typeof cb, 'function');
}));
debug('this', { is: 'a' }, /debugging/);
debug('num=%d str=%s obj=%j', 1, 'a', { foo: 'bar' });
console.log('ok');
}
|
import React from 'react'
import ReactTestUtils from 'react-dom/test-utils'
import {findWithType} from 'react-shallow-testutils'
import {findAllWithClass} from 'react-shallow-testutils'
import LessonNavigator from './LessonNavigator'
import Nound from './Nound'
import NoundPanel from '../dictionary/nound/NoundPanel'
import {countWithId} from '../../TestUtils'
import {heapsPermute} from '../../TestUtils'
import initialState from '../../data/StateGetter'
import NoundActionTypes from '../../data/dictionary/nound/NoundActionTypes'
import QuizStore from '../../data/quiz/QuizStore'
describe("Nound", function() {
/**
* This component should be tested as each quiz question is answered.
* However, I have found errors that derive from the order of answering
* the quiz questions. Therefore test this component using every possible
* order of answering the quiz questions.
*/
it("Renders Nound in all its glory.", function() {
const verifyBasicLayout = (noundComponent, expectQuizBox) => {
expect(noundComponent.type).toBe('div')
expect(countWithId(noundComponent,'help')).toBe(1)
expect(findWithType(noundComponent,NoundPanel))
expect(countWithId(noundComponent,'quiz')).toBe(expectQuizBox ? 1 : 0)
expect(findWithType(noundComponent,LessonNavigator))
}
/*
Given an array of actions, dispatch each one sequentially, in order,
and verify that the basic layout is good and that the correct (and no other)
checkmarks are present
*/
const testSinglePermutation = (actions) => {
let state = initialState
const renderExpression = <Nound {...state} />
const noundComponent = ReactTestUtils.createRenderer().render(renderExpression)
// no need to check basic layout or the fact that none of the checks are displayed
// because we've already checked it for the beginning state.
let checks = [] // which check marks should be set?
for(let quizItem of actions) {
state.quiz = QuizStore.reduce(state.quiz, {type: quizItem.type, nound: quizItem.nound})
checks.push(quizItem.i)
let renderExpression = <Nound {...state} />
let noundComponent = ReactTestUtils.createRenderer().render(renderExpression)
// Passed or not, the quiz box should be there
//if(state.quiz.getIn(['nound','passed'])) {
// If the quiz has pass, don't expect the quiz box and don't look for the checkmarks
//verifyBasicLayout(noundComponent, false)
//} else {
// If the quiz has not passed, expect the quiz box and look
// for the checkmarks
verifyBasicLayout(noundComponent, true)
// verify that only the currently answered questions are checked
for(let check of checks)
expect(countWithId(noundComponent,check)).toBe(1)
//}
}
}
const renderExpression = <Nound {...initialState} />
const noundComponent = ReactTestUtils.createRenderer().render(renderExpression)
verifyBasicLayout(noundComponent, true) // expect quizbox
// None of the quiz items should be checked.
expect(findAllWithClass(noundComponent,'checkmark').length).toBe(0)
// Now verify correct operation of each permutation.
heapsPermute([
{type:NoundActionTypes.ON_CLICK_SAVE_NOUND, i:'insertNoundCheck', nound:{}},
{type:NoundActionTypes.ON_CLICK_SAVE_NOUND, i:'updateNoundCheck', nound:{id:'1'}},
{type:NoundActionTypes.ON_CLICK_DELETE_NOUND, i:'deleteNoundCheck'}
], testSinglePermutation)
})
})
|
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
indent:4, unused:vars, latedef:nofunc
*/
module.exports = {
'ios' : {
hostos : ['darwin'],
parser : './metadata/ios_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git',
version: '3.5.0'
},
'android' : {
parser : './metadata/android_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git',
version: '3.5.1'
},
'ubuntu' : {
hostos : ['linux'],
parser : './metadata/ubuntu_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-ubuntu.git',
version: '3.5.0'
},
'amazon-fireos' : {
parser : './metadata/amazon_fireos_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-amazon-fireos.git',
version: '3.5.0'
},
'wp8' : {
hostos : ['win32'],
parser : './metadata/wp8_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-wp8.git',
version: '3.5.0',
subdirectory: 'wp8'
},
'blackberry10' : {
parser : './metadata/blackberry10_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-blackberry.git',
version: '3.5.0',
subdirectory: 'blackberry10'
},
'www':{
hostos : [],
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git',
version: '3.5.0'
},
'firefoxos':{
parser: './metadata/firefoxos_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-firefoxos.git',
version: '3.5.0'
},
'windows8':{
hostos : ['win32'],
parser: './metadata/windows8_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-windows.git',
version: '3.5.0',
subdirectory: 'windows8'
}
};
var addModuleProperty = require('./util').addModuleProperty;
Object.keys(module.exports).forEach(function(key) {
var obj = module.exports[key];
if (obj.parser) {
addModuleProperty(module, 'parser', obj.parser, false, obj);
}
});
|
import React from 'react';
import { connect } from 'react-redux'
import { submitContactForm } from '../actions/contact';
import Messages from './Messages';
class Contact extends React.Component {
constructor(props) {
super(props);
this.state = { name: '', email: '', message: '' };
}
handleChange(event) {
this.setState({ [event.target.name]: event.target.value });
}
handleSubmit(event) {
event.preventDefault();
this.props.dispatch(submitContactForm(this.state.name, this.state.email, this.state.message));
}
render() {
return (
//= CONTACT_RENDER_INDENT3
);
}
}
const mapStateToProps = (state) => {
return {
messages: state.messages
};
};
export default connect(mapStateToProps)(Contact);
|
//小区价格走势
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.Types.ObjectId;
var ZonePriceSchema = new mongoose.Schema({
zone:{type:ObjectId, ref:'Zone'},
time: String, //时间
price: Number, //价格
district:String, //区域
meta: {
createdAt: {
type: Date,
default: Date.now()
},
updatedAt: {
type: Date,
default: Date.now()
}
}
});
ZonePriceSchema.pre('save', function(next) {
if (this.isNew) {
this.meta.createdAt = this.meta.updatedAt = Date.now();
} else {
this.meta.updatedAt = Date.now();
}
console.log("save zonePrice...........");
next();
})
ZonePriceSchema.statics = {
fetch: function(callback) {
return this.find({}).sort('meta.updatedAt').exec(callback);
},
findById: function(id, callback) {
return this.findOne({_id: id}).exec(callback);
}
}
module.exports = ZonePriceSchema;
|
/*
* jQuery File Upload Audio Preview Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, document */
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('blueimp-load-image/js/load-image'),
require('./jquery.file_upload-process')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
}
}(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadAudio',
// Use the action as prefix for the "@" options:
prefix: true,
fileTypes: '@',
maxFileSize: '@',
disabled: '@disableAudioPreview'
},
{
action: 'setAudio',
name: '@audioPreviewName',
disabled: '@disableAudioPreview'
}
);
// The File Upload Audio Preview plugin extends the file_upload widget
// with audio preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of audio files to load,
// matched against the file type:
loadAudioFileTypes: /^audio\/.*$/
},
_audioElement: document.createElement('audio'),
processActions: {
// Loads the audio file given via data.files and data.index
// as audio element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
// and maxFileSize (integer) to limit the files to load:
loadAudio: function (data, options) {
if (options.disabled) {
return data;
}
var file = data.files[data.index],
url,
audio;
if (this._audioElement.canPlayType &&
this._audioElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes ||
options.fileTypes.test(file.type))) {
url = loadImage.createObjectURL(file);
if (url) {
audio = this._audioElement.cloneNode(false);
audio.src = url;
audio.controls = true;
data.audio = audio;
return data;
}
}
return data;
},
// Sets the audio element as a property of the file object:
setAudio: function (data, options) {
if (data.audio && !options.disabled) {
data.files[data.index][options.name || 'preview'] = data.audio;
}
return data;
}
}
});
}));
|
/* globals Seemple */
const $ = require('balajs');
const { select, bindNode } = require('seemple');
function parseForm(object, selector, callback, eventOptions) {
const form = /:sandbox|:bound/.test(selector) ? select(object, selector) : $.one(selector);
const fields = $('input, textarea, output, progress, select', form);
/* istanbul ignore if */
if (!object || typeof object !== 'object' && typeof object !== 'function') {
throw new TypeError('parseForm should accept an object or a function as the first argument');
}
for (let i = 0; i < fields.length; i++) {
const field = fields[i];
const { name } = field;
if (name) {
bindNode(object, name, field, undefined, eventOptions);
if (callback) {
callback(name, field);
}
}
}
return form;
}
// extend Seemple in browser environment
/* istanbul ignore if */
if (typeof Seemple === 'function') {
Seemple.parseForm = parseForm;
}
module.exports = parseForm;
|
/**
* @license Highcharts JS v8.0.0 (2019-12-10)
* @module highcharts/modules/solid-gauge
* @requires highcharts
* @requires highcharts/highcharts-more
*
* Solid angular gauge module
*
* (c) 2010-2019 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
import '../../modules/solid-gauge.src.js';
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
const _excluded = ["BackdropProps"],
_excluded2 = ["anchor", "BackdropProps", "children", "className", "elevation", "hideBackdrop", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"];
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { integerPropType } from '@material-ui/utils';
import { unstable_composeClasses as composeClasses } from '@material-ui/unstyled';
import Modal from '../Modal';
import Slide from '../Slide';
import Paper from '../Paper';
import capitalize from '../utils/capitalize';
import { duration } from '../styles/createTransitions';
import useTheme from '../styles/useTheme';
import useThemeProps from '../styles/useThemeProps';
import styled, { rootShouldForwardProp } from '../styles/styled';
import { getDrawerUtilityClass } from './drawerClasses';
import { jsx as _jsx } from "react/jsx-runtime";
const overridesResolver = (props, styles) => {
const {
ownerState
} = props;
return [styles.root, (ownerState.variant === 'permanent' || ownerState.variant === 'persistent') && styles.docked, styles.modal];
};
const useUtilityClasses = ownerState => {
const {
classes,
anchor,
variant
} = ownerState;
const slots = {
root: ['root'],
docked: [(variant === 'permanent' || variant === 'persistent') && 'docked'],
modal: ['modal'],
paper: ['paper', `paperAnchor${capitalize(anchor)}`, variant !== 'temporary' && `paperAnchorDocked${capitalize(anchor)}`]
};
return composeClasses(slots, getDrawerUtilityClass, classes);
};
const DrawerRoot = styled(Modal, {
name: 'MuiDrawer',
slot: 'Root',
overridesResolver
})(({
theme
}) => ({
zIndex: theme.zIndex.drawer
}));
const DrawerDockedRoot = styled('div', {
shouldForwardProp: rootShouldForwardProp,
name: 'MuiDrawer',
slot: 'Docked',
skipVariantsResolver: false,
overridesResolver
})({
flex: '0 0 auto'
});
const DrawerPaper = styled(Paper, {
name: 'MuiDrawer',
slot: 'Paper',
overridesResolver: (props, styles) => {
const {
ownerState
} = props;
return [styles.paper, styles[`paperAnchor${capitalize(ownerState.anchor)}`], ownerState.variant !== 'temporary' && styles[`paperAnchorDocked${capitalize(ownerState.anchor)}`]];
}
})(({
theme,
ownerState
}) => _extends({
overflowY: 'auto',
display: 'flex',
flexDirection: 'column',
height: '100%',
flex: '1 0 auto',
zIndex: theme.zIndex.drawer,
// Add iOS momentum scrolling for iOS < 13.0
WebkitOverflowScrolling: 'touch',
// temporary style
position: 'fixed',
top: 0,
// We disable the focus ring for mouse, touch and keyboard users.
// At some point, it would be better to keep it for keyboard users.
// :focus-ring CSS pseudo-class will help.
outline: 0
}, ownerState.anchor === 'left' && {
left: 0
}, ownerState.anchor === 'top' && {
top: 0,
left: 0,
right: 0,
height: 'auto',
maxHeight: '100%'
}, ownerState.anchor === 'right' && {
right: 0
}, ownerState.anchor === 'bottom' && {
top: 'auto',
left: 0,
bottom: 0,
right: 0,
height: 'auto',
maxHeight: '100%'
}, ownerState.anchor === 'left' && ownerState.variant !== 'temporary' && {
borderRight: `1px solid ${theme.palette.divider}`
}, ownerState.anchor === 'top' && ownerState.variant !== 'temporary' && {
borderBottom: `1px solid ${theme.palette.divider}`
}, ownerState.anchor === 'right' && ownerState.variant !== 'temporary' && {
borderLeft: `1px solid ${theme.palette.divider}`
}, ownerState.anchor === 'bottom' && ownerState.variant !== 'temporary' && {
borderTop: `1px solid ${theme.palette.divider}`
}));
const oppositeDirection = {
left: 'right',
right: 'left',
top: 'down',
bottom: 'up'
};
export function isHorizontal(anchor) {
return ['left', 'right'].indexOf(anchor) !== -1;
}
export function getAnchor(theme, anchor) {
return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
}
const defaultTransitionDuration = {
enter: duration.enteringScreen,
exit: duration.leavingScreen
};
/**
* The props of the [Modal](/api/modal/) component are available
* when `variant="temporary"` is set.
*/
const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
const props = useThemeProps({
props: inProps,
name: 'MuiDrawer'
});
const {
anchor: anchorProp = 'left',
BackdropProps,
children,
className,
elevation = 16,
hideBackdrop = false,
ModalProps: {
BackdropProps: BackdropPropsProp
} = {},
onClose,
open = false,
PaperProps = {},
SlideProps,
// eslint-disable-next-line react/prop-types
TransitionComponent = Slide,
transitionDuration = defaultTransitionDuration,
variant = 'temporary'
} = props,
ModalProps = _objectWithoutPropertiesLoose(props.ModalProps, _excluded),
other = _objectWithoutPropertiesLoose(props, _excluded2);
const theme = useTheme(); // Let's assume that the Drawer will always be rendered on user space.
// We use this state is order to skip the appear transition during the
// initial mount of the component.
const mounted = React.useRef(false);
React.useEffect(() => {
mounted.current = true;
}, []);
const anchorInvariant = getAnchor(theme, anchorProp);
const anchor = anchorProp;
const ownerState = _extends({}, props, {
anchor,
elevation,
open,
variant
}, other);
const classes = useUtilityClasses(ownerState);
const drawer = /*#__PURE__*/_jsx(DrawerPaper, _extends({
elevation: variant === 'temporary' ? elevation : 0,
square: true
}, PaperProps, {
className: clsx(classes.paper, PaperProps.className),
ownerState: ownerState,
children: children
}));
if (variant === 'permanent') {
return /*#__PURE__*/_jsx(DrawerDockedRoot, _extends({
className: clsx(classes.root, classes.docked, className),
ownerState: ownerState,
ref: ref
}, other, {
children: drawer
}));
}
const slidingDrawer = /*#__PURE__*/_jsx(TransitionComponent, _extends({
in: open,
direction: oppositeDirection[anchorInvariant],
timeout: transitionDuration,
appear: mounted.current
}, SlideProps, {
children: drawer
}));
if (variant === 'persistent') {
return /*#__PURE__*/_jsx(DrawerDockedRoot, _extends({
className: clsx(classes.root, classes.docked, className),
ownerState: ownerState,
ref: ref
}, other, {
children: slidingDrawer
}));
} // variant === temporary
return /*#__PURE__*/_jsx(DrawerRoot, _extends({
BackdropProps: _extends({}, BackdropProps, BackdropPropsProp, {
transitionDuration
}),
className: clsx(classes.root, classes.modal, className),
open: open,
ownerState: ownerState,
onClose: onClose,
hideBackdrop: hideBackdrop,
ref: ref
}, other, ModalProps, {
children: slidingDrawer
}));
});
process.env.NODE_ENV !== "production" ? Drawer.propTypes
/* remove-proptypes */
= {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* Side from which the drawer will appear.
* @default 'left'
*/
anchor: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
/**
* @ignore
*/
BackdropProps: PropTypes.object,
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The elevation of the drawer.
* @default 16
*/
elevation: integerPropType,
/**
* If `true`, the backdrop is not rendered.
* @default false
*/
hideBackdrop: PropTypes.bool,
/**
* Props applied to the [`Modal`](/api/modal/) element.
* @default {}
*/
ModalProps: PropTypes.object,
/**
* Callback fired when the component requests to be closed.
*
* @param {object} event The event source of the callback.
*/
onClose: PropTypes.func,
/**
* If `true`, the component is shown.
* @default false
*/
open: PropTypes.bool,
/**
* Props applied to the [`Paper`](/api/paper/) element.
* @default {}
*/
PaperProps: PropTypes.object,
/**
* Props applied to the [`Slide`](/api/slide/) element.
*/
SlideProps: PropTypes.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.object,
/**
* The duration for the transition, in milliseconds.
* You may specify a single timeout for all transitions, or individually with an object.
* @default { enter: duration.enteringScreen, exit: duration.leavingScreen }
*/
transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
appear: PropTypes.number,
enter: PropTypes.number,
exit: PropTypes.number
})]),
/**
* The variant to use.
* @default 'temporary'
*/
variant: PropTypes.oneOf(['permanent', 'persistent', 'temporary'])
} : void 0;
export default Drawer; |
var ReportDataQualityServices = (function() {
function ReportDataQuality(reportSetup, tagFilter) {
this.reportSetup = reportSetup;
this.tagFilter = tagFilter;
}
ReportDataQuality.prototype.render = function() {
var that = this;
var factSheetPromise = $.get(this.reportSetup.apiBaseUrl + '/factsheets?relations=true&types[]=10&pageSize=-1')
.then(function (response) {
return response.data;
});
$.when(factSheetPromise)
.then(function (data) {
var fsIndex = new FactSheetIndex(data);
var list = fsIndex.getSortedList('services');
var output = [];
function getGreenToRed(percent){
var r = percent<50 ? 255 : Math.floor(255-(percent*2-100)*255/100);
var g = percent>50 ? 255 : Math.floor((percent*2)*255/100);
return 'rgb('+r+','+g+',0)';
}
for (var i = 0; i < list.length; i++) {
if (!that.tagFilter || list[i].tags.indexOf(that.tagFilter) != -1) {
var item = {
name : list[i].fullName,
type : 'App',
id : list[i].ID,
completion : Math.floor(list[i].completion * 100),
count : ''
};
output.push(item);
}
}
function link(cell, row) {
if (row.type != 'Market')
return '<a href="' + that.reportSetup.baseUrl + '/services/' + row.id + '" target="_blank">' + cell + '</a>';
else
return '<b>' + cell + '</b>';
}
function percentage(cell, row) {
return '<div class="percentage" style="background-color: ' + getGreenToRed(cell) + ';">' + cell + ' %</div>';
}
function trClassFormat(rowData,rIndex){
return 'tr-type-' + rowData.type.toLowerCase();
}
ReactDOM.render(
<div className="report-data-quality">
<BootstrapTable data={output} striped={true} hover={true} search={true} condensed={true} exportCSV={true} trClassName={trClassFormat}>
<TableHeaderColumn dataField="id" isKey={true} hidden={true}>ID</TableHeaderColumn>
<TableHeaderColumn dataField="name" dataAlign="left" dataSort={true} dataFormat={link} filter={{type: "TextFilter", placeholder: "Please enter a value"}}>Application Name</TableHeaderColumn>
<TableHeaderColumn dataField="completion" dataAlign="left" dataSort={true} dataFormat={percentage} filter={{type: "NumberFilter", defaultValue: {comparator: '<='}}}>Completion</TableHeaderColumn>
</BootstrapTable>
</div>,
document.getElementById("app")
);
});
};
return ReportDataQuality;
})();
|
/**
*
* Submits a form found by given selector. The submit command may also be applied
* to any element that is a descendant of a `<form>` element.
*
* <example>
:index.html
<form action="/form.php" method="post" id="loginForm">
<label for="username">User:</label>
<input type="text" name="username" id="username">
<label for="password">Password:</label>
<input type="password" name="password" id="password">
<input type="submit" value="Login">
</form>
:submitForm.js
browser.submitForm('#loginForm');
* </example>
*
* @param {String} selector form element
*
* @uses protocol/element, protocol/submit
* @type action
*
*/
let submitForm = function (selector) {
return this.element(selector).then((res) =>
this.submit(res.value.ELEMENT))
}
export default submitForm
|
var selectors = require('../util/selector');
var arrays = require('../util/array');
/**
* Create new Element with selector
*
* @func
* @alias module:waff.element
* @param {string} selector - query selector
* @param {object} [attr] - element's attributes
* @param {Element[]} children - element's children
*/
var create = function(selector, attr, children) {
var parsedSelector = selectors.parse(selector);
var element = document.createElement(parsedSelector.tag || 'div');
if (children == null && arrays.arrayLike(attr)) {
children = attr;
attr = {};
}
if (children != null && arrays.array(attr)) {
var tmp_attr = {};
for (var i = 0; i < attr.length; ++i) {
tmp_attr[attr[i]] = '';
}
attr = tmp_attr;
}
attr = attr || {};
children = children || [];
if (parsedSelector.id !== false) {
element.id = parsedSelector.id;
}
element.classes = parsedSelector.classes;
element.append(children);
element.attr(parsedSelector.attr);
element.attr(attr);
return element;
};
module.exports = create;
|
import { SET_EXHIBIT_MODE } from './constants';
/**
* setExhibitMode
* Sets the mode which determines which list of exhibits to display
*/
export function setExhibitMode(mode) {
return {
type: SET_EXHIBIT_MODE,
value: mode,
};
}
|
var cm;
Template.postSubmit.rendered = function() {
var options = {
element: $('#editor')[0]
};
var editor = new Editor(options);
cm = editor.codemirror;
};
Template.postSubmit.events({
'click #btn-post-submit': function(e){
e.preventDefault();
var content = cm.getValue();
var title = $('#ta-post-title').val();
if (title.length < 2 || title.length > 28) {
return flushMsg('标题的长度应该在2-28之间!');
}
if (content.length < 10 || content.length > 10000) {
return flushMsg('正文的长度应该在10-10000之间!');
}
Meteor.call('postSubmit', title, content, function(err, postId){
if(err){
return flushMsg(err.reason);
}
Router.go('post', {id: postId});
});
}
});
|
var jaws = (function(jaws) {
/**
* @class Manage a parallax scroller with different layers. "Field Summary" contains options for the Parallax()-constructor.
* @constructor
*
* @property scale number, scale factor for all layers (2 will double everything and so on)
* @property repeat_x true|false, repeat all parallax layers horizontally
* @property repeat_y true|false, repeat all parallax layers vertically
* @property camera_x number, x-position of "camera". add to camera_x and layers will scroll left. defaults to 0
* @property camera_y number, y-position of "camera". defaults to 0
*
* @example
* parallax = new jaws.Parallax({repeat_x: true})
* parallax.addLayer({image: "parallax_1.png", damping: 100})
* parallax.addLayer({image: "parallax_2.png", damping: 6})
* parallax.camera_x += 1 // scroll layers horizontally
* parallax.draw()
*
*/
jaws.Parallax = function Parallax(options) {
if( !(this instanceof arguments.callee) ) return new arguments.callee( options );
jaws.parseOptions(this, options, this.default_options)
}
jaws.Parallax.prototype.default_options = {
width: function() { return jaws.width },
height: function() { return jaws.height },
scale: 1,
repeat_x: null,
repeat_y: null,
camera_x: 0,
camera_y: 0,
layers: []
}
/** Draw all layers in parallax scroller */
jaws.Parallax.prototype.draw = function(options) {
var layer, numx, numy, initx;
for(var i=0; i < this.layers.length; i++) {
layer = this.layers[i]
if(this.repeat_x) {
initx = -((this.camera_x / layer.damping) % layer.width);
}
else {
initx = -(this.camera_x / layer.damping)
}
if (this.repeat_y) {
layer.y = -((this.camera_y / layer.damping) % layer.height);
}
else {
layer.y = -(this.camera_y / layer.damping);
}
layer.x = initx;
while (layer.y < this.height) {
while (layer.x < this.width) {
if (layer.x + layer.width >= 0 && layer.y + layer.height >= 0) { //Make sure it's on screen
layer.draw(); //Draw only if actually on screen, for performance reasons
}
layer.x = layer.x + layer.width;
if (!this.repeat_x) {
break;
}
}
layer.y = layer.y + layer.height;
layer.x = initx;
if (!this.repeat_y) {
break;
}
}
}
}
/** Add a new layer to the parallax scroller */
jaws.Parallax.prototype.addLayer = function(options) {
var layer = new jaws.ParallaxLayer(options)
layer.scaleAll(this.scale)
this.layers.push(layer)
}
/** Debugstring for Parallax() */
jaws.Parallax.prototype.toString = function() { return "[Parallax " + this.x + ", " + this.y + ". " + this.layers.length + " layers]" }
/**
* @class A single layer that's contained by Parallax()
*
* @property damping number, higher the number, the slower it will scroll with regards to other layers, defaults to 0
* @constructor
* @extends jaws.Sprite
*/
jaws.ParallaxLayer = function ParallaxLayer(options) {
if( !(this instanceof arguments.callee) ) return new arguments.callee( options );
this.damping = options.damping || 0
jaws.Sprite.call(this, options)
}
jaws.ParallaxLayer.prototype = jaws.Sprite.prototype
/** Debugstring for ParallaxLayer() */
// This overwrites Sprites toString, find another sollution.
// jaws.ParallaxLayer.prototype.toString = function() { return "[ParallaxLayer " + this.x + ", " + this.y + "]" }
return jaws;
})(jaws || {});
|
var gulp = require('gulp'),
concat = require('gulp-concat'),
lint = require('gulp-jslint'),
uglify = require('gulp-uglify'),
ngAnnotate = require('gulp-ng-annotate'),
del = require('del'),
SOURCES = 'src/**/*.js';
gulp.task('cleanDist', function(cb) {
del(['dist/*'], cb);
});
gulp.task('build', ['lint', 'cleanDist'], function () {
return gulp.src(['src/named-route-module.js', SOURCES])
.pipe(ngAnnotate())
.pipe(concat('angular-named-route.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('lint', function () {
return gulp.src(SOURCES)
.pipe(lint({
global: ['angular'],
browser: true,
devel: true,
todo: true,
noempty: false,
plusplus: true,
unparam: true //I like to include all callback params even if they're not used
}));
}); |
var fb=require('../../firebird');
var http=require('http');
var sys =require('sys');
// Create Firebird Connection Object
var con = fb.createConnection();
// Connect to Database
con.connectSync('test.fdb','sysdba','masterkey','');
// Create HTTP server
http.createServer(function(req,res){
// Query and fecth all rows
var rows = con.querySync("select * from rdb$relations")
.fetchSync('all',true);
res.writeHead(200,{'Content-Type':'text/plain'});
// Return rows object (it is array) to browser
res.end(sys.inspect(rows));
}).listen(8080);
console.log('Server is running at http://localhost:8080'); |
/** Text descriptor is used for describing text sources */
var TextDescriptor=Descriptor.extend({
/** Constructor
@param source Path to text */
init: function(source) {
this._super();
this.source=source;
},
type: function() {
return "TextDescriptor";
},
equals: function(other) {
if(!this._super(other)) return false;
return this.source==other.source;
}
}); |
/*! jQuery UI - v1.10.4 - 2014-06-15
* http://jqueryui.com
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
jQuery(function(t){t.datepicker.regional.hi={closeText:"बंद",prevText:"पिछला",nextText:"अगला",currentText:"आज",monthNames:["जनवरी ","फरवरी","मार्च","अप्रेल","मई","जून","जूलाई","अगस्त ","सितम्बर","अक्टूबर","नवम्बर","दिसम्बर"],monthNamesShort:["जन","फर","मार्च","अप्रेल","मई","जून","जूलाई","अग","सित","अक्ट","नव","दि"],dayNames:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"],dayNamesShort:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],dayNamesMin:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],weekHeader:"हफ्ता",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.datepicker.setDefaults(t.datepicker.regional.hi)}); |
'use strict';
var localePageFactory = function($log, $http, $q, CONSTANTS) {
var apiBasePath = CONSTANTS.DISCLOSURE_API_BASEURL;
var apiEndpoint = '/locality';
var localePageData = {};
localePageData.metaData = {};
var service = {
getLocalePageData: getLocalePageData,
getMetaDataForPage: getMetaDataForPage,
getCurrentBallotData: getCurrentBallotData
// getLocalePageMetaData: getLocalePageMetaData,
// setLocalePageMetaData: setLocalePageMetaData
};
return service;
function getLocalePageData(localeId) {
return getMetaDataForPage(localeId).then(function (data) {
// localePageData.metaData = data;
localePageData = data;
$log.info('data from getMetaDataForPage() = ', localePageData);
return localePageData;
});
}
function getMetaDataForPage(localeId) {
return $http.get(apiBasePath + apiEndpoint + '/' + localeId)
.then(getDataComplete)
.catch(getMetaDataFailed);
}
// function getCurrentBallotData() {
function getCurrentBallotData(localeId) {
// return $http.get(apiBasePath + apiEndpoint + '/' + localePageData.metaData.localeId)
return $http.get(apiBasePath + apiEndpoint + '/' + localeId + '/current_ballot')
.then(getDataComplete)
.catch(getMetaDataFailed);
}
// function getDataComplete(data, status, headers, config) {
function getDataComplete(data) {
return data.data;
}
function getMetaDataFailed(e) {
var newMessage = 'XHR Failed for getPageData';
if (e.data && e.data.description) {
newMessage = newMessage + '\n' + e.data.description;
}
e.data.description = newMessage;
$log.error(newMessage);
return $q.reject(e);
}
};
localePageFactory.$inject = ['$log', '$http', '$q', 'CONSTANTS'];
module.exports = localePageFactory;
|
DO NOT USE THIS YET. NOT IMPLEMENTED
// /**
// SUMMARY:
// for each release we want to be able to get
// - team commits for a particular team for one train
// - team commits for a particular team across all trains
// - team commits for a particular train for all teams
// - all team commits in a release
// each team commit is a 1 to 1 mapping for portfolioitem/project
// - needs to contain both the portoflioitme and project in id
// therefore: the TeamCommitID should be in this format
// teamcommit-<release name>-<scrumgroupid>-<portfolioitem id>-<project id>
// The teamcommit 'value' is obfuscated because Rally strips html characters from the text, which then breaks JSON. it is obfuscated by using:
// btoa(encodeURIComponent(JSON.stringify(teamCommitJSON, null, '\t')))
// this file does not handle schema or validation things for risks -- it only handles the CRUD interface for them. It uses the TeamCommitModel object
// to do validation
// DEPENDENCIES:
// - Intel.SAFe.lib.model.TeamCommit
// */
// (function(){
// var Ext = window.Ext4 || window.Ext,
// KeyValueDb = Intel.lib.resource.KeyValueDb,
// TeamCommitModel = Intel.SAFe.lib.model.TeamCommit;
// Ext.define('Intel.SAFe.lib.resource.TeamCommitDb', {
// singleton: true,
// /**
// private function. returns error if missing or invalid fields, else returns pruned teamCommitJSON
// returns Promise(teamCommitJSON)
// */
// _validateTeamCommit: function(teamCommitJSON){
// var model = new TeamCommitModel(teamCommitJSON),
// errors = model.validate();
// if(errors.length) return Q.reject(_.map(errors.getRange(), function(error){ return error.field + ' ' + error.message; }));
// else return Q(model.data);
// },
// _getPortfolioItem: function(
// _updatePortfolioItem: function(portfolioItem, teamCommitJSON){
// (PortfolioItemType.Ordinal%20=%200)
// },
// /**
// You must call this before you can use it. Not using constructor because we need a promise to be returned.
// returns Promise()
// */
// initialize: function(){
// return KeyValueDb.initialize();
// },
// /** returns Promise(teamCommitJSON) */
// get: function(teamCommitID){
// if(!TeamCommitModel.isValidTeamCommitID(teamCommitID)) return Q.reject('invalid TeamCommitID');
// return KeyValueDb.getKeyValuePair(teamCommitID).then(function(kvPair){
// try { return kvPair ? _.merge(JSON.parse(decodeURIComponent(atob(kvPair.value))), {TeamCommitID: kvPair.key}) : null; }
// catch(e){ return Q.reject(e); }
// });
// },
// /**
// currently does not have ability to filter just by project, since implementation is still backed by custom fields on
// portfolio items. So we can't say: give me all team commits for project 'X' in the entire workspace.
// returns Promise( [teamCommitJSON] )
// */
// query: function(opts){
// var me = this,
// filter = null,
// context = {
// workspace: Rally.environment.getContext().getWorkspace()._ref,
// project: null
// };
// if(opts.releaseName) filter = Ext.create('Ext.data.wsapi.Filter', {property:'Release.Name', value: opts.releaseName});
// if(opts.scrumGroupOID) context = { project: '/project/' + opts.scrumGroupOID };
// if(opts.portfolioItemOID){
// var newFilter = Ext.create('Ext.data.wsapi.Filter', {property:'ObjectID', value: opts.portfolioItemOID});
// filter = filter ? filter.and(newFilter) : newFilter;
// }
// if(opts.projectOID){
// var newFilter = Ext.create('Ext.data.wsapi.Filter', {property:'ObjectID', value: opts.portfolioItemOID});
// filter = filter ? filter.and(newFilter) : newFilter;
// }
// return me._queryPortfolioItems(context, filter).then(function(portfolioItems){
// var teamCommits = [];
// _.each(portfolioItems, function(portfolioItem){
// var newTeamCommits = {};
// try { newTeamCommits = JSON.parse(decodeURIComponent(atob(portfolioItem.data.c_TeamCommits))); }
// catch(e){ newTeamCommits = {}; }
// _.each(newTeamCommits, function(data, projectOID){
// //validate/clean data here and add to teamCommits[]
// });
// });
// if(opts.projectOID){
// var newFilter = Ext.create('Ext.data.wsapi.Filter', {property:'ObjectID', value: opts.portfolioItemOID});
// filter = filter ? filter.and(newFilter) : newFilter;
// }
// });
// },
// btoa(encodeURIComponent(JSON.stringify(riskJSON, null, '\t')));
// return KeyValueDb.createKeyValuePair(riskID, riskJSONString).then(function(kvPair){
// try { return _.merge(JSON.parse(decodeURIComponent(atob(kvPair.value))),
// /**
// validates the teamCommitJSON and then creates risk if it is unique
// returns Promise(teamCommitJSON)
// */
// create: function(teamCommitID, teamCommitJSON){
// if(!TeamCommitModel.isValidTeamCommitID(teamCommitID)) return Q.reject('invalid TeamCommitID');
// return this._validateTeamCommit(_.merge(teamCommitJSON, {TeamCommitID: teamCommitID})).then(function(teamCommitJSON){
// var teamCommitJSONString = btoa(encodeURIComponent(JSON.stringify(teamCommitJSON, null, '\t')));
// return KeyValueDb.createKeyValuePair(teamCommitID, teamCommitJSONString).then(function(kvPair){
// try { return _.merge(JSON.parse(decodeURIComponent(atob(kvPair.value))), {TeamCommitID: kvPair.key}); }
// catch(e){ return Q.reject(e); }
// });
// });
// },
// /**
// validates the teamCommitJSON and then updates risk if it exists
// returns Promise(teamCommitJSON)
// */
// update: function(teamCommitID, teamCommitJSON){
// if(!TeamCommitModel.isValidTeamCommitID(teamCommitID)) return Q.reject('invalid TeamCommitID');
// return this._validateTeamCommit(_.merge(teamCommitJSON, {TeamCommitID: teamCommitID})).then(function(teamCommitJSON){
// var teamCommitJSONString = btoa(encodeURIComponent(JSON.stringify(teamCommitJSON, null, '\t')));
// return KeyValueDb.updateKeyValuePair(teamCommitID, teamCommitJSONString).then(function(kvPair){
// try { return _.merge(JSON.parse(decodeURIComponent(atob(kvPair.value))), {TeamCommitID: kvPair.key}); }
// catch(e){ return Q.reject(e); }
// });
// });
// },
// /** returns Promise(void) */
// 'delete': function(teamCommitID){
// if(!TeamCommitModel.isValidTeamCommitID(teamCommitID)) return Q.reject('invalid TeamCommitID');
// return KeyValueDb.deleteKeyValuePair(teamCommitID);
// }
// });
// }()); |
const RESERVED = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield'.split( ' ' );
const INVALID_CHAR = /[^a-zA-Z0-9_$]/g;
const INVALID_LEADING_CHAR = /[^a-zA-Z_$]/;
/**
* Generates a sanitized (i.e. valid identifier) name from a module ID
* @param {string} id - a module ID, or part thereof
* @returns {string}
*/
export default function sanitize ( name ) {
name = name.replace( INVALID_CHAR, '_' );
if ( INVALID_LEADING_CHAR.test( name[0] ) || ~RESERVED.indexOf( name ) ) {
name = `_${name}`;
}
return name;
}
var pathSplitRE = /\/|\\/;
export function splitPath ( path ) {
return path.split( pathSplitRE );
}
|
'use strict';
const { By, until } = require('selenium-webdriver');
const { register, Page, platforms } = require('../../../../../scripts/e2e');
class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/card/test/basic?ionic:mode=${platform}`);
}
}
platforms.forEach(platform => {
describe('card/basic', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate('#content');
});
});
});
|
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the Clear BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
/**
* @requires OpenLayers/Control.js
*/
/**
* Class: OpenLayers.Control.ZoomToMaxExtent
* The ZoomToMaxExtent control is a button that zooms out to the maximum
* extent of the map. It is designed to be used with a
* <OpenLayers.Control.Panel>.
*
* Inherits from:
* - <OpenLayers.Control>
*/
OpenLayers.Control.ZoomToMaxExtent = OpenLayers.Class(OpenLayers.Control, {
/**
* Property: type
* {String} The type of <OpenLayers.Control> -- When added to a
* <Control.Panel>, 'type' is used by the panel to determine how to
* handle our events.
*/
type: OpenLayers.Control.TYPE_BUTTON,
/*
* Method: trigger
* Do the zoom.
*/
trigger: function() {
if (this.map) {
this.map.zoomToMaxExtent();
}
},
CLASS_NAME: "OpenLayers.Control.ZoomToMaxExtent"
});
|
Package.describe({
name: 'rate-limit',
version: '1.0.5',
// Brief, one-line summary of the package.
summary: 'An algorithm for rate limiting anything',
// URL to the Git repository containing the source code for this package.
git: '',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
documentation: 'README.md'
});
Package.onUse(function(api) {
api.use('underscore');
api.use('random');
api.addFiles('rate-limit.js');
api.export("RateLimiter");
});
Package.onTest(function(api) {
api.use('test-helpers', ['client', 'server']);
api.use('underscore');
api.use('random');
api.use('ddp-rate-limiter');
api.use('tinytest');
api.use('rate-limit');
api.use('ddp-common');
api.addFiles('rate-limit-tests.js');
});
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
/**
* Class representing a JobHistoryFilter.
*/
class JobHistoryFilter {
/**
* Create a JobHistoryFilter.
* @member {string} [status] Gets or sets the job execution status. Possible
* values include: 'Completed', 'Failed', 'Postponed'
*/
constructor() {
}
/**
* Defines the metadata of JobHistoryFilter
*
* @returns {object} metadata of JobHistoryFilter
*
*/
mapper() {
return {
required: false,
serializedName: 'JobHistoryFilter',
type: {
name: 'Composite',
className: 'JobHistoryFilter',
modelProperties: {
status: {
required: false,
serializedName: 'status',
type: {
name: 'Enum',
allowedValues: [ 'Completed', 'Failed', 'Postponed' ]
}
}
}
}
};
}
}
module.exports = JobHistoryFilter;
|
import React from 'react';
import SvgIcon from '../../SvgIcon';
const ActionDelete = (props) => (
<SvgIcon {...props}>
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>
</SvgIcon>
);
ActionDelete.displayName = 'ActionDelete';
ActionDelete.muiName = 'SvgIcon';
export default ActionDelete;
|
var root = require('./_root');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsFinite = root.isFinite;
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MAX_VALUE);
* // => true
*
* _.isFinite(3.14);
* // => true
*
* _.isFinite(Infinity);
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
module.exports = isFinite;
|
/**
* Post Meta JS
*
* This file contains all post-meta functionality
*
* @package Layers
* @since Layers 1.0.0
*
* Author: Obox Themes
* Author URI: http://www.oboxthemes.com/
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
jQuery(document).ready(function($) {
$page_template = $('#page_template');
$(document).on( 'click' , '#layers_toggle_builder a', function(e){
e.preventDefault();
// "Hi Mom"
$that = jQuery(this);
// Submit form
$that.closest('form').submit();
window.location = $that.attr('href');
});
$(document).on( 'change' , '#page_template', function(){
// "Hi Mom"
$that = jQuery(this);
$non_layers_boxes = '#postdivrich, #postbox-container-2, #postimagediv';
// If we use the builder, show the "build" button
if('builder.php' == $that.val() ){
$( '#layers_toggle_builder' ).removeClass( 'layers-hide' );
$( $non_layers_boxes ).hide();
} else {
$( '#layers_toggle_builder' ).addClass( 'layers-hide' );
$( $non_layers_boxes ).show();
}
jQuery.ajax({
type: 'POST',
url: layers_meta_params.ajaxurl,
data: 'action=update_page_builder_meta&template=' + $that.val() + '&id=' + $('#post_ID').val()
});
});
}); |
function Blitzcrank() {
return 'B' + INCLUDE('c');
}
|
$(window).bind("load", function() {
$('.cm-container').delay(300).fadeIn(800);
$('#footer').delay(1000).fadeIn(800);
$('.load_screen').delay(400).fadeOut(1000);
}); |
var dom = skit.browser.dom;
var events = skit.browser.events;
var Controller = skit.platform.Controller;
var BaseController = library.BaseController;
var GitHubAPIClient = library.GitHubAPIClient;
var template = __module__.html;
module.exports = Controller.create(BaseController, {
__preload__: function(loaded) {
GitHubAPIClient.loadGists(function(gists) {
this.gists = gists;
loaded();
}, this);
},
__title__: function() {
return 'Home';
},
__body__: function() {
return template({gists: this.gists});
},
__ready__: function() {
var reload = dom.get('#reload');
events.bind(reload, 'click', this.reload, this);
}
}); |
var vec2 = require('../math/vec2');
module.exports = Body;
var zero = vec2.fromValues(0,0);
/**
* A rigid body. Has got a center of mass, position, velocity and a number of
* shapes that are used for collisions.
*
* @class Body
* @constructor
* @param {Object} [options]
* @param {Number} [options.mass=0] A number >= 0. If zero, the .motionState will be set to Body.STATIC.
* @param {Float32Array|Array} [options.position]
* @param {Float32Array|Array} [options.velocity]
* @param {Number} [options.angle=0]
* @param {Number} [options.angularVelocity=0]
* @param {Float32Array|Array} [options.force]
* @param {Number} [options.angularForce=0]
*
* @todo Should not take mass as argument to Body, but as density to each Shape
*/
function Body(options){
options = options || {};
/**
* The body identifyer
* @property id
* @type {Number}
*/
this.id = ++Body._idCounter;
/**
* The shapes of the body. The local transform of the shape in .shapes[i] is
* defined by .shapeOffsets[i] and .shapeAngles[i].
*
* @property shapes
* @type {Array}
*/
this.shapes = [];
/**
* The local shape offsets, relative to the body center of mass. This is an
* array of Float32Array.
* @property shapeOffsets
* @type {Array}
*/
this.shapeOffsets = [];
/**
* The body-local shape angle transforms. This is an array of numbers (angles).
* @property shapeAngles
* @type {Array}
*/
this.shapeAngles = [];
/**
* The mass of the body.
* @property mass
* @type {number}
*/
this.mass = options.mass || 0;
/**
* The inverse mass of the body.
* @property invMass
* @type {number}
*/
this.invMass = 0;
/**
* The inertia of the body around the Z axis.
* @property inertia
* @type {number}
*/
this.inertia = 0;
/**
* The inverse inertia of the body.
* @property invInertia
* @type {number}
*/
this.invInertia = 0;
this.updateMassProperties();
/**
* The position of the body
* @property position
* @type {Float32Array}
*/
this.position = vec2.fromValues(0,0);
if(options.position) vec2.copy(this.position, options.position);
/**
* The velocity of the body
* @property velocity
* @type {Float32Array}
*/
this.velocity = vec2.fromValues(0,0);
if(options.velocity) vec2.copy(this.velocity, options.velocity);
/**
* Constraint velocity that was added to the body during the last step.
* @property vlambda
* @type {Float32Array}
*/
this.vlambda = vec2.fromValues(0,0);
/**
* Angular constraint velocity that was added to the body during last step.
* @property wlambda
* @type {Float32Array}
*/
this.wlambda = 0;
/**
* The angle of the body
* @property angle
* @type {number}
*/
this.angle = options.angle || 0;
/**
* The angular velocity of the body
* @property angularVelocity
* @type {number}
*/
this.angularVelocity = options.angularVelocity || 0;
/**
* The force acting on the body
* @property force
* @type {Float32Array}
*/
this.force = vec2.create();
if(options.force) vec2.copy(this.force, options.force);
/**
* The angular force acting on the body
* @property angularForce
* @type {number}
*/
this.angularForce = options.angularForce || 0;
/**
* The type of motion this body has. Should be one of: Body.STATIC (the body
* does not move), Body.DYNAMIC (body can move and respond to collisions)
* and Body.KINEMATIC (only moves according to its .velocity).
*
* @property motionState
* @type {number}
*
* @example
* // This body will move and interact with other bodies
* var dynamicBody = new Body();
* dynamicBody.motionState = Body.DYNAMIC;
*
* @example
* // This body will not move at all
* var staticBody = new Body();
* staticBody.motionState = Body.STATIC;
*
* @example
* // This body will only move if you change its velocity
* var kinematicBody = new Body();
* kinematicBody.motionState = Body.KINEMATIC;
*/
this.motionState = this.mass === 0 ? Body.STATIC : Body.DYNAMIC;
/**
* Bounding circle radius
* @property boundingRadius
* @type {Number}
*/
this.boundingRadius = 0;
};
Body._idCounter = 0;
/**
* Update the bounding radius of the body. Should be done if any of the shapes
* are changed.
* @method updateBoundingRadius
*/
Body.prototype.updateBoundingRadius = function(){
var shapes = this.shapes,
shapeOffsets = this.shapeOffsets,
N = shapes.length,
radius = 0;
for(var i=0; i!==N; i++){
var shape = shapes[i],
offset = vec2.length(shapeOffsets[i] || zero),
r = shape.boundingRadius;
if(offset + r > radius)
radius = offset + r;
}
this.boundingRadius = radius;
};
/**
* Add a shape to the body. You can pass a local transform when adding a shape,
* so that the shape gets an offset and angle relative to the body center of mass.
* Will automatically update the mass properties and bounding radius.
*
* @method addShape
* @param {Shape} shape
* @param {Float32Array|Array} [offset] Local body offset of the shape.
* @param {Number} [angle] Local body angle.
*
* @example
* var body = new Body(),
* shape = new Circle();
*
* // Add the shape to the body, positioned in the center
* body.addShape(shape);
*
* // Add another shape to the body, positioned 1 unit length from the body center of mass along the local x-axis.
* body.addShape(shape,[1,0]);
*
* // Add another shape to the body, positioned 1 unit length from the body center of mass along the local y-axis, and rotated 90 degrees CCW.
* body.addShape(shape,[0,1],Math.PI/2);
*/
Body.prototype.addShape = function(shape,offset,angle){
this.shapes .push(shape);
this.shapeOffsets.push(offset);
this.shapeAngles .push(angle);
this.updateMassProperties();
this.updateBoundingRadius();
};
/**
* Updates .inertia, .invMass, .invInertia for this Body. Should be called when
* changing the structure or mass of the Body.
*
* @method updateMassProperties
*
* @example
* body.mass += 1;
* body.updateMassProperties();
*/
Body.prototype.updateMassProperties = function(){
var shapes = this.shapes,
N = shapes.length,
m = this.mass / N,
I = 0;
for(var i=0; i<N; i++){
var shape = shapes[i],
r2 = vec2.squaredLength(this.shapeOffsets[i] || zero),
Icm = shape.computeMomentOfInertia(m);
I += Icm + m*r2;
}
this.inertia = I;
// Inverse mass properties are easy
this.invMass = this.mass > 0 ? 1/this.mass : 0;
this.invInertia = I>0 ? 1/I : 0;
};
var Body_applyForce_r = vec2.create();
/**
* Apply force to a world point. This could for example be a point on the RigidBody surface. Applying force this way will add to Body.force and Body.angularForce.
* @method applyForce
* @param {Float32Array} force The force to add.
* @param {Float32Array} worldPoint A world point to apply the force on.
*/
Body.prototype.applyForce = function(force,worldPoint){
// Compute point position relative to the body center
var r = Body_applyForce_r;
vec2.sub(r,worldPoint,this.position);
// Add linear force
vec2.add(this.force,this.force,force);
// Compute produced rotational force
var rotForce = vec2.crossLength(r,force);
// Add rotational force
this.angularForce += rotForce;
};
/**
* Transform a world point to local body frame.
* @method toLocalFrame
* @param {Float32Array|Array} out The vector to store the result in
* @param {Float32Array|Array} worldPoint The input world vector
*/
Body.prototype.toLocalFrame = function(out, worldPoint){
vec2.toLocalFrame(out, worldPoint, this.position, this.angle);
};
/**
* Transform a local point to world frame.
* @method toWorldFrame
* @param {Array} out The vector to store the result in
* @param {Array} localPoint The input local vector
*/
Body.prototype.toWorldFrame = function(out, localPoint){
vec2.toGlobalFrame(out, localPoint, this.position, this.angle);
};
/**
* Dynamic body.
* @property DYNAMIC
* @type {Number}
* @static
*/
Body.DYNAMIC = 1;
/**
* Static body.
* @property STATIC
* @type {Number}
* @static
*/
Body.STATIC = 2;
/**
* Kinematic body.
* @property KINEMATIC
* @type {Number}
* @static
*/
Body.KINEMATIC = 4;
|
wysihtml.commands.alignCenterStyle = (function() {
var nodeOptions = {
styleProperty: "textAlign",
styleValue: "center",
toggle: true
};
return {
exec: function(composer, command) {
return wysihtml.commands.formatBlock.exec(composer, "formatBlock", nodeOptions);
},
state: function(composer, command) {
return wysihtml.commands.formatBlock.state(composer, "formatBlock", nodeOptions);
}
};
})();
|
/**
* @param {Object} $ - Global jQuery object
* @param {Object} bolt - The Bolt module
*/
(function ($, bolt) {
'use strict';
/**
* BUIC upload widget.
*
* @license http://opensource.org/licenses/mit-license.php MIT License
* @author rarila
*
* @class buicUpload
* @memberOf jQuery.widget.bolt
*/
$.widget('bolt.buicUpload', /** @lends jQuery.widget.bolt.buicUpload.prototype */ {
/**
* Event reporting that a file was selected.
*
* @event jQuery.widget.bolt.buicUpload#buicuploaduploaded
* @property {string} path - The path to the selected file
*/
/**
* The constructor of the upload widget.
*
* @private
*/
_create: function () {
var fieldset = this.element,
fileInput = $('input[type=file]', fieldset),
dropZone = $('.dropzone', fieldset),
//
accept = $(fileInput).attr('accept'),
extensions = accept ? accept.replace(/^\./, '').split(/,\./) : [],
pattern = new RegExp('(\\.|\\/)(' + extensions.join('|') + ')$', 'i');
// Set maxSize, if not set on creation.
if (this.options.maxSize === null) {
var tempSize = Math.floor(bolt.conf('uploadConfig.maxSize'));
this.options.maxSize = bolt.utils.filterInt(tempSize, 2000000);
}
/**
* Refs to UI elements of this widget.
*
* @type {Object}
* @name _ui
* @memberOf jQuery.widget.bolt.buicUpload.prototype
* @private
*
* @property {?Object} progress - Progress bar widget
*/
this._ui = {
progress: null
};
// Initialize the upload widget.
fileInput.fileupload({
dataType: 'json',
dropZone: dropZone,
pasteZone: null,
maxFileSize: this.options.maxSize > 0 ? this.options.maxSize : undefined,
minFileSize: undefined,
acceptFileTypes: accept ? pattern : undefined,
maxNumberOfFiles: undefined,
messages: {
maxFileSize: '>:' + bolt.utils.humanBytes(this.options.maxSize),
minFileSize: '<',
acceptFileTypes: 'T:.' + extensions.join(', .'),
maxNumberOfFiles: '#'
}
});
// Binds event handlers.
this._on({
'fileuploadprocessfail': this._onProcessFail,
'fileuploadsubmit': this._onUploadSubmit,
'fileuploadprogress': this._onUploadProgress,
'fileuploadalways': this._onUploadAlways,
'fileuploaddone': this._onUploadDone
});
},
/**
* Upload processing failed.
*
* @private
*
* @param {Object} event
* @param {Object} data
*/
_onProcessFail: function (event, data) {
var currentFile = data.files[data.index],
type = currentFile.error.substr(0, 1),
alert,
context = {
'%FILENAME%': currentFile.name,
'%FILESIZE%': bolt.utils.humanBytes(currentFile.size),
'%FILETYPE%': currentFile.type,
'%ALLOWED%': currentFile.error.substr(2)
};
switch (type) {
case '>':
alert = bolt.data('field.uploads.template.large-file', context);
break;
case 'T':
alert = bolt.data('field.uploads.template.wrong-type', context);
break;
default:
alert = '<p>' + currentFile.error + '</p>';
}
bootbox.alert(alert);
},
/**
* Upload starts.
*
* @private
*
* @param {Object} event
* @param {Object} data
*/
_onUploadSubmit: function(event, data) {
this._progress('add', data.files);
},
/**
* Signal upload progress.
*
* @private
*
* @param {Object} event
* @param {Object} data
*/
_onUploadProgress: function (event, data) {
this._progress('set', data.files, data.loaded / data.total);
},
/**
* After successful or failed upload.
*
* @private
*
* @param {Object} event
* @param {Object} data
*/
_onUploadAlways: function (event, data) {
this._progress('remove', data.files);
},
/**
* Files successfully uploaded.
*
* @private
* @fires jQuery.widget.bolt.buicUpload#buicuploaduploaded
*
* @param {Object} event
* @param {Object} data
*/
_onUploadDone: function (event, data) {
var self = this;
$.each(data.result, function (idx, file) {
if (file.error) {
bootbox.alert(bolt.data('field.uploads.template.error', {'%ERROR%': file.error}));
} else {
self._trigger('uploaded', event, {path: file.name});
}
});
},
/**
* Send commands to buicProgress to display upload progress.
*
* @private
*
* @param {string} command - Command to send
* @param {array} files - Files to process
* @param {number} [done] - Percentage of bytes already uploaded
*/
_progress: function (command, files, done) {
var self = this;
if (self._ui.progress === null) {
self._ui.progress = $(':bolt-buicProgress', self.element);
}
$.each(files, function () {
self._ui.progress.buicProgress(command, this.name, done);
});
},
/**
* Default options.
*
* @property {?number} maxSize - Maximum upload size in bytes. 0 means unlimited.
*/
options: {
maxSize: null
}
});
})(jQuery, Bolt);
|
(function() {
var self = this;
var ms, createParserContext, createDynamicLexer, parser, jisonLexer;
ms = require("../memorystream");
createParserContext = require("./parserContext").createParserContext;
createDynamicLexer = require("./dynamicLexer").createDynamicLexer;
parser = require("./jisonParser").parser;
jisonLexer = parser.lexer;
exports.createParser = function(gen1_options) {
var self = this;
var terms, filename;
terms = gen1_options !== void 0 && Object.prototype.hasOwnProperty.call(gen1_options, "terms") && gen1_options.terms !== void 0 ? gen1_options.terms : terms;
filename = gen1_options !== void 0 && Object.prototype.hasOwnProperty.call(gen1_options, "filename") && gen1_options.filename !== void 0 ? gen1_options.filename : void 0;
return {
parse: function(source) {
var self = this;
var dynamicLexer, parserContext;
dynamicLexer = createDynamicLexer({
nextLexer: jisonLexer
});
parserContext = createParserContext({
terms: terms,
filename: filename
});
parserContext.lexer = dynamicLexer;
jisonLexer.yy = parserContext;
parser.yy = parserContext;
parser.lexer = dynamicLexer;
return parser.parse(source);
},
errors: terms.errors,
lex: function(source) {
var self = this;
var tokens, lexer, parserContext, tokenIndex, token, text, lexerToken;
tokens = [];
lexer = createDynamicLexer({
nextLexer: jisonLexer,
source: source
});
parserContext = createParserContext({
terms: terms
});
parserContext.lexer = lexer;
jisonLexer.yy = parserContext;
tokenIndex = lexer.lex();
while (tokenIndex !== 1) {
token = function() {
if (typeof tokenIndex === "number") {
return parser.terminals_[tokenIndex];
} else if (tokenIndex === "") {
return undefined;
} else {
return tokenIndex;
}
}();
text = function() {
if (lexer.yytext === "") {
return undefined;
} else if (lexer.yytext === token) {
return undefined;
} else {
return lexer.yytext;
}
}();
lexerToken = function() {
if (text) {
return [ token, text ];
} else {
return [ token ];
}
}();
tokens.push(lexerToken);
tokenIndex = lexer.lex();
}
return tokens;
}
};
};
}).call(this); |
"use strict";
var neume = require("../namespace");
require("./component");
var util = require("../util");
function NeuParam(context, value, spec) {
spec = spec || {};
neume.Component.call(this, context);
this._value = util.finite(value);
this._params = [];
this._events = [];
this._curve = spec.curve;
this._lag = util.defaults(spec.lag, 0);
this._scheduled = null;
}
util.inherits(NeuParam, neume.Component);
NeuParam.$$name = "NeuParam";
Object.defineProperties(NeuParam.prototype, {
events: {
get: function() {
return this._events.slice();
},
enumerable: true
},
value: {
set: function(value) {
value = util.finite(value);
var params = this._params;
this._value = value;
for (var i = 0, imax = params.length; i < imax; i++) {
params[i].value = value;
}
},
get: function() {
return this._params.length ? this._params[0].value : this._value;
},
enumerable: true
}
});
NeuParam.prototype.valueAtTime = function(t) {
t = util.finite(this.context.toSeconds(t));
var value = this._value;
var events = this._events;
var t0;
for (var i = 0; i < events.length; i++) {
var e0 = events[i];
var e1 = events[i + 1];
if (t < e0.time) {
break;
}
t0 = Math.min(t, e1 ? e1.time : t);
if (e1 && e1.type === "LinearRampToValue") {
value = calcLinearRampToValue(value, e0.value, e1.value, t0, e0.time, e1.time);
} else if (e1 && e1.type === "ExponentialRampToValue") {
value = calcExponentialRampToValue(value, e0.value, e1.value, t0, e0.time, e1.time);
} else {
switch (e0.type) {
case "SetValue":
case "LinearRampToValue":
case "ExponentialRampToValue":
value = e0.value;
break;
case "SetTarget":
value = calcTarget(value, e0.value, t0, e0.time, e0.timeConstant);
break;
case "SetValueCurve":
value = calcValueCurve(value, t0, e0.time, e0.time + e0.duration, e0.curve);
break;
}
}
}
return value;
};
NeuParam.prototype.setAt = function(value, startTime) {
value = util.finite(value);
startTime = util.finite(this.context.toSeconds(startTime));
var params = this._params;
for (var i = 0, imax = params.length; i < imax; i++) {
params[i].setValueAtTime(value, startTime);
}
insertEvent(this, {
type: "SetValue",
value: value,
time: startTime,
});
return this;
};
NeuParam.prototype.setValueAtTime = NeuParam.prototype.setAt;
NeuParam.prototype.linTo = function(value, endTime) {
value = util.finite(value);
endTime = util.finite(this.context.toSeconds(endTime));
var params = this._params;
for (var i = 0, imax = params.length; i < imax; i++) {
params[i].linearRampToValueAtTime(value, endTime);
}
insertEvent(this, {
type: "LinearRampToValue",
value: value,
time: endTime,
});
return this;
};
NeuParam.prototype.linearRampToValueAtTime = NeuParam.prototype.linTo;
NeuParam.prototype.expTo = function(value, endTime) {
value = util.finite(value);
endTime = util.finite(this.context.toSeconds(endTime));
var params = this._params;
for (var i = 0, imax = params.length; i < imax; i++) {
params[i].exponentialRampToValueAtTime(value, endTime);
}
insertEvent(this, {
type: "ExponentialRampToValue",
value: value,
time: endTime,
});
return this;
};
NeuParam.prototype.exponentialRampToValueAtTime = NeuParam.prototype.expTo;
NeuParam.prototype.targetAt = function(target, startTime, timeConstant) {
target = util.finite(target);
startTime = util.finite(this.context.toSeconds(startTime));
timeConstant = util.finite(this.context.toSeconds(timeConstant));
var params = this._params;
for (var i = 0, imax = params.length; i < imax; i++) {
params[i].setTargetAtTime(target, startTime, timeConstant);
}
insertEvent(this, {
type: "SetTarget",
value: target,
time: startTime,
timeConstant: timeConstant
});
return this;
};
NeuParam.prototype.setTargetAtTime = NeuParam.prototype.targetAt;
NeuParam.prototype.curveAt = function(values, startTime, duration) {
startTime = util.finite(this.context.toSeconds(startTime));
duration = util.finite(this.context.toSeconds(duration));
var params = this._params;
for (var i = 0, imax = params.length; i < imax; i++) {
params[i].setValueCurveAtTime(values, startTime, duration);
}
insertEvent(this, {
type: "SetValueCurve",
time: startTime,
duration: duration,
curve: values
});
return this;
};
NeuParam.prototype.setValueCurveAtTime = NeuParam.prototype.curveAt;
NeuParam.prototype.cancel = function(startTime) {
startTime = util.finite(this.context.toSeconds(startTime));
var params = this._params;
var events = this._events;
var i, imax;
for (i = 0, imax = params.length; i < imax; i++) {
params[i].cancelScheduledValues(startTime);
}
for (i = 0, imax = events.length; i < imax; ++i) {
if (events[i].time >= startTime) {
events.splice(i);
break;
}
}
return this;
};
NeuParam.prototype.cancelScheduledValues = NeuParam.prototype.cancel;
NeuParam.prototype.update = function(value, startTime, lag) {
var context = this.context;
var endTime = startTime + util.finite(context.toSeconds(util.defaults(lag, this._lag, 0)));
var startValue = this.valueAtTime(startTime);
var curve = this._curve;
var scheduled = null;
terminateAudioParamScheduling(this, startValue, startTime);
if (endTime <= startTime) {
curve = "step";
}
switch (curve) {
case "exp":
case "exponential":
this.setValueAtTime(Math.max(1e-6, startValue), startTime);
this.exponentialRampToValueAtTime(Math.max(1e-6, value), endTime);
scheduled = { method: "exponentialRampToValueAtTime", time: endTime };
break;
case "lin":
case "linear":
this.setValueAtTime(startValue, startTime);
this.linearRampToValueAtTime(value, endTime);
scheduled = { method: "linearRampToValueAtTime", time: endTime };
break;
// case "step":
default:
this.setValueAtTime(value, startTime);
break;
}
this._scheduled = scheduled;
return this;
};
function terminateAudioParamScheduling(_this, startValue, startTime) {
var scheduled = _this._scheduled;
if (scheduled == null || scheduled.time <= startTime) {
return;
}
_this.cancelScheduledValues(scheduled.time);
_this[scheduled.method](startValue, startTime);
}
NeuParam.prototype.toAudioNode = function(input) {
var context = this.context;
if (this._outlet == null) {
this._outlet = context.createGain();
this._outlet.gain.value = this._value;
this._params.push(this._outlet.gain);
if (input) {
context.connect(input, this._outlet);
} else {
context.connect(new neume.DC(context, 1), this._outlet);
}
}
return this._outlet;
};
NeuParam.prototype.connect = function(to) {
if (to instanceof neume.webaudio.AudioParam) {
to.value = this._value;
this._params.push(to);
} else {
this.context.connect(this.toAudioNode(), to);
}
return this;
};
NeuParam.prototype.disconnect = function() {
this.context.disconnect(this._outlet);
return this;
};
function insertEvent(_this, event) {
var time = event.time;
var events = _this._events;
var replace = 0;
var i, imax;
for (i = 0, imax = events.length; i < imax; ++i) {
if (events[i].time === time && events[i].type === event.type) {
replace = 1;
break;
}
if (events[i].time > time) {
break;
}
}
events.splice(i, replace, event);
}
function calcLinearRampToValue(v, v0, v1, t, t0, t1) {
var dt = (t - t0) / (t1 - t0);
return (1 - dt) * v0 + dt * v1;
}
function calcExponentialRampToValue(v, v0, v1, t, t0, t1) {
var dt = (t - t0) / (t1 - t0);
return 0 < v0 && 0 < v1 ? v0 * Math.pow(v1 / v0, dt) : /* istanbul ignore next */ v;
}
function calcTarget(v0, v1, t, t0, timeConstant) {
return v1 + (v0 - v1) * Math.exp((t0 - t) / timeConstant);
}
function calcValueCurve(v, t, t0, t1, curve) {
var dt = (t - t0) / (t1 - t0);
if (dt <= 0) {
return util.defaults(curve[0], v);
}
if (1 <= dt) {
return util.defaults(curve[curve.length - 1], v);
}
return util.defaults(curve[(curve.length * dt)|0], v);
}
module.exports = neume.Param = NeuParam;
|
const locale = {
placeholder: 'Selecteer tijd',
};
export default locale;
|
define([
'spoon/View',
'doT',
'text!./assets/tmpl/list.html',
'css!./assets/css/articles.css'
], function (View, doT, tmpl) {
'use strict';
return View.extend({
$name: 'ArticlesListView',
_element: 'div.articles-list',
_template: doT.template(tmpl),
_events: {
'click tr': '_onClick',
'mouseenter tr a': '_onMouseEnter',
'mouseleave tr a': '_onMouseLeave'
},
/**
* Handles the row click.
*/
_onClick: function (event, element) {
console.log('Click tr of element #' + element.data('id'), element);
},
/**
* Handles the row mouse enter.
*/
_onMouseEnter: function (event, element) {
console.log('Enter link of element #' + element.closest('tr').data('id'), element);
},
/**
* Handles the row mouse leave.
*/
_onMouseLeave: function (event, element) {
console.log('Leave link of element #' + element.closest('tr').data('id'), element);
}
});
}); |
import { singularize } from "ember-inflector";
import RESTSerializer from "ember-data/serializers/rest-serializer";
import normalizeModelName from "ember-data/system/normalize-model-name";
/**
@module ember-data
*/
var camelize = Ember.String.camelize;
var classify = Ember.String.classify;
var decamelize = Ember.String.decamelize;
var underscore = Ember.String.underscore;
/**
The ActiveModelSerializer is a subclass of the RESTSerializer designed to integrate
with a JSON API that uses an underscored naming convention instead of camelCasing.
It has been designed to work out of the box with the
[active\_model\_serializers](http://github.com/rails-api/active_model_serializers)
Ruby gem. This Serializer expects specific settings using ActiveModel::Serializers,
`embed :ids, embed_in_root: true` which sideloads the records.
This serializer extends the DS.RESTSerializer by making consistent
use of the camelization, decamelization and pluralization methods to
normalize the serialized JSON into a format that is compatible with
a conventional Rails backend and Ember Data.
## JSON Structure
The ActiveModelSerializer expects the JSON returned from your server
to follow the REST adapter conventions substituting underscored keys
for camelcased ones.
### Conventional Names
Attribute names in your JSON payload should be the underscored versions of
the attributes in your Ember.js models.
For example, if you have a `Person` model:
```js
App.FamousPerson = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
occupation: DS.attr('string')
});
```
The JSON returned should look like this:
```js
{
"famous_person": {
"id": 1,
"first_name": "Barack",
"last_name": "Obama",
"occupation": "President"
}
}
```
Let's imagine that `Occupation` is just another model:
```js
App.Person = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
occupation: DS.belongsTo('occupation')
});
App.Occupation = DS.Model.extend({
name: DS.attr('string'),
salary: DS.attr('number'),
people: DS.hasMany('person')
});
```
The JSON needed to avoid extra server calls, should look like this:
```js
{
"people": [{
"id": 1,
"first_name": "Barack",
"last_name": "Obama",
"occupation_id": 1
}],
"occupations": [{
"id": 1,
"name": "President",
"salary": 100000,
"person_ids": [1]
}]
}
```
@class ActiveModelSerializer
@namespace DS
@extends DS.RESTSerializer
*/
var ActiveModelSerializer = RESTSerializer.extend({
// SERIALIZE
/**
Converts camelCased attributes to underscored when serializing.
@method keyForAttribute
@param {String} attribute
@return String
*/
keyForAttribute: function(attr) {
return decamelize(attr);
},
/**
Underscores relationship names and appends "_id" or "_ids" when serializing
relationship keys.
@method keyForRelationship
@param {String} relationshipModelName
@param {String} kind
@return String
*/
keyForRelationship: function(relationshipModelName, kind) {
var key = decamelize(relationshipModelName);
if (kind === "belongsTo") {
return key + "_id";
} else if (kind === "hasMany") {
return singularize(key) + "_ids";
} else {
return key;
}
},
/**
`keyForLink` can be used to define a custom key when deserializing link
properties. The `ActiveModelSerializer` camelizes link keys by default.
@method keyForLink
@param {String} key
@param {String} kind `belongsTo` or `hasMany`
@return {String} normalized key
*/
keyForLink: function(key, relationshipKind) {
return camelize(key);
},
/*
Does not serialize hasMany relationships by default.
*/
serializeHasMany: Ember.K,
/**
Underscores the JSON root keys when serializing.
@method payloadKeyFromModelName
@param {String} modelName
@return {String}
*/
payloadKeyFromModelName: function(modelName) {
return underscore(decamelize(modelName));
},
/**
Serializes a polymorphic type as a fully capitalized model name.
@method serializePolymorphicType
@param {DS.Snapshot} snapshot
@param {Object} json
@param {Object} relationship
*/
serializePolymorphicType: function(snapshot, json, relationship) {
var key = relationship.key;
var belongsTo = snapshot.belongsTo(key);
var jsonKey = underscore(key + "_type");
if (Ember.isNone(belongsTo)) {
json[jsonKey] = null;
} else {
json[jsonKey] = classify(belongsTo.modelName).replace('/', '::');
}
},
// EXTRACT
/**
Add extra step to `DS.RESTSerializer.normalize` so links are normalized.
If your payload looks like:
```js
{
"post": {
"id": 1,
"title": "Rails is omakase",
"links": { "flagged_comments": "api/comments/flagged" }
}
}
```
The normalized version would look like this
```js
{
"post": {
"id": 1,
"title": "Rails is omakase",
"links": { "flaggedComments": "api/comments/flagged" }
}
}
```
@method normalize
@param {subclass of DS.Model} typeClass
@param {Object} hash
@param {String} prop
@return Object
*/
normalize: function(typeClass, hash, prop) {
this.normalizeLinks(hash);
return this._super(typeClass, hash, prop);
},
/**
Convert `snake_cased` links to `camelCase`
@method normalizeLinks
@param {Object} data
*/
normalizeLinks: function(data) {
if (data.links) {
var links = data.links;
for (var link in links) {
var camelizedLink = camelize(link);
if (camelizedLink !== link) {
links[camelizedLink] = links[link];
delete links[link];
}
}
}
},
/**
Normalize the polymorphic type from the JSON.
Normalize:
```js
{
id: "1"
minion: { type: "evil_minion", id: "12"}
}
```
To:
```js
{
id: "1"
minion: { type: "evilMinion", id: "12"}
}
```
@param {Subclass of DS.Model} typeClass
@method normalizeRelationships
@private
*/
normalizeRelationships: function(typeClass, hash) {
if (this.keyForRelationship) {
typeClass.eachRelationship(function(key, relationship) {
var payloadKey, payload;
if (relationship.options.polymorphic) {
payloadKey = this.keyForAttribute(key, "deserialize");
payload = hash[payloadKey];
if (payload && payload.type) {
payload.type = this.modelNameFromPayloadKey(payload.type);
} else if (payload && relationship.kind === "hasMany") {
payload.forEach((single) => single.type = this.modelNameFromPayloadKey(single.type));
}
} else {
payloadKey = this.keyForRelationship(key, relationship.kind, "deserialize");
if (!hash.hasOwnProperty(payloadKey)) { return; }
payload = hash[payloadKey];
}
hash[key] = payload;
if (key !== payloadKey) {
delete hash[payloadKey];
}
}, this);
}
},
modelNameFromPayloadKey: function(key) {
var convertedFromRubyModule = singularize(key.replace('::', '/'));
return normalizeModelName(convertedFromRubyModule);
}
});
export default ActiveModelSerializer;
|
'use strict';
// Flags: --expose-internals
const common = require('../common');
const assert = require('assert');
const { BigIntStats } = require('internal/fs/utils');
const fs = require('fs');
const path = require('path');
const tmpdir = require('../common/tmpdir');
const enoentFile = path.join(tmpdir.path, 'non-existent-file');
const expectedStatObject = new BigIntStats(
0n, // dev
0n, // mode
0n, // nlink
0n, // uid
0n, // gid
0n, // rdev
0n, // blksize
0n, // ino
0n, // size
0n, // blocks
0n, // atimeMs
0n, // mtimeMs
0n, // ctimeMs
0n, // birthtimeMs
0n, // atimeNs
0n, // mtimeNs
0n, // ctimeNs
0n // birthtimeNs
);
tmpdir.refresh();
// If the file initially didn't exist, and gets created at a later point of
// time, the callback should be invoked again with proper values in stat object
let fileExists = false;
const options = { interval: 0, bigint: true };
const watcher =
fs.watchFile(enoentFile, options, common.mustCall((curr, prev) => {
if (!fileExists) {
// If the file does not exist, all the fields should be zero and the date
// fields should be UNIX EPOCH time
assert.deepStrictEqual(curr, expectedStatObject);
assert.deepStrictEqual(prev, expectedStatObject);
// Create the file now, so that the callback will be called back once the
// event loop notices it.
fs.closeSync(fs.openSync(enoentFile, 'w'));
fileExists = true;
} else {
// If the ino (inode) value is greater than zero, it means that the file
// is present in the filesystem and it has a valid inode number.
assert(curr.ino > 0n);
// As the file just got created, previous ino value should be lesser than
// or equal to zero (non-existent file).
assert(prev.ino <= 0n);
// Stop watching the file
fs.unwatchFile(enoentFile);
watcher.stop(); // Stopping a stopped watcher should be a noop
}
}, 2));
// 'stop' should only be emitted once - stopping a stopped watcher should
// not trigger a 'stop' event.
watcher.on('stop', common.mustCall(function onStop() {}));
|
Template.Constellation_docViewer.helpers({
activeDocument: function () {
var collectionName = String(this);
var currentCollection = Constellation.Collection(collectionName);
if (!currentCollection) {
return null;
}
var documents = currentCollection.find(Constellation.searchSelector(collectionName), {transform: null}).fetch();
var sessionKey = Constellation.sessKey(String(this));
var docNumber = ConstellationDict.get(sessionKey);
var docCurrent = documents[docNumber];
return docCurrent;
},
documentJSON: function () {
var docCurrent = this;
var json_output = JSON.stringify(docCurrent, null, 2), colorize;
if (!(json_output === undefined)) {
colorize = Constellation.colorize(json_output);
} else {
colorize = json_output;
}
return colorize;
},
editContent: function () {
var editMode = ConstellationDict.get("Constellation_editMode");
if (editMode) {
return "true";
}
},
editStyle: function () {
var editMode = ConstellationDict.get("Constellation_editMode");
if (editMode) {
return "Constellation_editable";
}
},
noInlineEditing: function () {
return ConstellationDict.get('Constellation_noInlineEditing');
}
}); |
'use strict';
var format = require('util').format;
var stripAnsi = require('strip-ansi');
// Parses stack trace and extracts original function name, file name and line.
function getSourceFromStack(stack, index) {
return stack
.split('\n')
.slice(index, index + 1)
.join('')
.replace(/^\s+ /, '');
}
function TapReporter() {
if (!(this instanceof TapReporter)) {
return new TapReporter();
}
this.i = 0;
}
module.exports = TapReporter;
TapReporter.prototype.start = function () {
return 'TAP version 13';
};
TapReporter.prototype.test = function (test) {
var output;
var directive = '';
var passed = test.todo ? 'not ok' : 'ok';
if (test.todo) {
directive = '# TODO';
} else if (test.skip) {
directive = '# SKIP';
}
var title = stripAnsi(test.title);
if (test.error) {
output = [
'# ' + title,
format('not ok %d - %s', ++this.i, title),
' ---',
' operator: ' + test.error.operator,
' expected: ' + test.error.expected,
' actual: ' + test.error.actual,
' at: ' + getSourceFromStack(test.error.stack, 1),
' ...'
];
} else {
output = [
'# ' + title,
format('%s %d - %s %s', passed, ++this.i, title, directive).trim()
];
}
return output.join('\n');
};
TapReporter.prototype.unhandledError = function (err) {
var output = [
'# ' + err.message,
format('not ok %d - %s', ++this.i, err.message)
];
// AvaErrors don't have stack traces.
if (err.type !== 'exception' || err.name !== 'AvaError') {
output.push(
' ---',
' name: ' + err.name,
' at: ' + getSourceFromStack(err.stack, 1),
' ...'
);
}
return output.join('\n');
};
TapReporter.prototype.finish = function (runStatus) {
var output = [
'',
'1..' + (runStatus.passCount + runStatus.failCount + runStatus.skipCount),
'# tests ' + (runStatus.passCount + runStatus.failCount + runStatus.skipCount),
'# pass ' + runStatus.passCount
];
if (runStatus.skipCount > 0) {
output.push('# skip ' + runStatus.skipCount);
}
output.push('# fail ' + (runStatus.failCount + runStatus.rejectionCount + runStatus.exceptionCount), '');
return output.join('\n');
};
TapReporter.prototype.write = function (str) {
console.log(str);
};
TapReporter.prototype.stdout = TapReporter.prototype.stderr = function (data) {
process.stderr.write(data);
};
|
import {module, test} from 'qunit';
import DS from 'ember-data';
import Ember from 'ember';
import testInDebug from 'dummy/tests/helpers/test-in-debug';
module('unit/transform - DS.DateTransform');
let dateString = '2015-01-01T00:00:00.000Z';
let dateInMillis = Date.parse(dateString);
let date = new Date(dateString);
test('#serialize', function(assert) {
let transform = new DS.DateTransform();
assert.equal(transform.serialize(null), null);
assert.equal(transform.serialize(undefined), null);
assert.equal(transform.serialize(new Date('invalid')), null);
assert.equal(transform.serialize(date), dateString);
});
test('#deserialize', function(assert) {
let transform = new DS.DateTransform();
// from String
assert.equal(transform.deserialize(dateString).toISOString(), dateString);
// from Number
assert.equal(transform.deserialize(dateInMillis).valueOf(), dateInMillis);
// from other
assert.equal(transform.deserialize({}), null);
// from none
assert.equal(transform.deserialize(null), null);
assert.equal(transform.deserialize(undefined), null);
});
testInDebug('#deserialize with different offset formats', function(assert) {
let transform = new DS.DateTransform();
let dateString = '2003-05-24T23:00:00.000+0000';
let dateStringColon = '2013-03-15T23:22:00.000+00:00';
let dateStringShortOffset = '2016-12-02T17:30:00.000+00';
assert.expect(4);
let deserialized;
assert.expectDeprecation(() => {
deserialized = transform.deserialize(dateStringShortOffset).getTime();
}, /The ECMA2015 Spec for ISO 8601 dates does not allow for shorthand timezone offsets such as \+00/);
assert.equal(transform.deserialize(dateString).getTime(), 1053817200000, 'date-strings with no-colon offsets are ok');
assert.equal(deserialized, 1480699800000, 'This test can be removed once the deprecation is removed');
assert.equal(transform.deserialize(dateStringColon).getTime(), 1363389720000, 'date-strings with colon offsets are ok');
});
testInDebug('Ember.Date.parse has been deprecated', function(assert) {
assert.expectDeprecation(() => {
Ember.Date.parse(dateString);
}, /Ember.Date.parse is deprecated/);
});
|
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'a11yhelp', 'no', {
title: 'Instruksjoner for tilgjengelighet',
contents: 'Innhold for hjelp. Trykk ESC for å lukke denne dialogen.',
legend: [
{
name: 'Generelt',
items: [
{
name: 'Verktøylinje for editor',
legend: 'Trykk ${toolbarFocus} for å navigere til verktøylinjen. Flytt til neste og forrige verktøylinjegruppe med TAB og SHIFT-TAB. Flytt til neste og forrige verktøylinjeknapp med HØYRE PILTAST og VENSTRE PILTAST. Trykk MELLOMROM eller ENTER for å aktivere verktøylinjeknappen.'
},
{
name: 'Dialog for editor',
legend: 'Mens du er i en dialog, trykk TAB for å navigere til neste dialogfelt, press SHIFT + TAB for å flytte til forrige felt, trykk ENTER for å akseptere dialogen, trykk ESC for å avbryte dialogen. For dialoger med flere faner, trykk ALT + F10 for å navigere til listen over faner. Gå til neste fane med TAB eller HØYRE PILTAST. Gå til forrige fane med SHIFT + TAB eller VENSTRE PILTAST. Trykk MELLOMROM eller ENTER for å velge fanen.'
},
{
name: 'Kontekstmeny for editor',
legend: 'Trykk ${contextMenu} eller MENYKNAPP for å åpne kontekstmeny. Gå til neste alternativ i menyen med TAB eller PILTAST NED. Gå til forrige alternativ med SHIFT+TAB eller PILTAST OPP. Trykk MELLOMROM eller ENTER for å velge menyalternativet. Åpne undermenyen på valgt alternativ med MELLOMROM eller ENTER eller HØYRE PILTAST. Gå tilbake til overordnet menyelement med ESC eller VENSTRE PILTAST. Lukk kontekstmenyen med ESC.'
},
{
name: 'Listeboks for editor',
legend: 'I en listeboks, gå til neste alternativ i listen med TAB eller PILTAST NED. Gå til forrige alternativ i listen med SHIFT + TAB eller PILTAST OPP. Trykk MELLOMROM eller ENTER for å velge alternativet i listen. Trykk ESC for å lukke listeboksen.'
},
{
name: 'Verktøylinje for elementsti',
legend: 'Trykk ${elementsPathFocus} for å navigere til verktøylinjen som viser elementsti. Gå til neste elementknapp med TAB eller HØYRE PILTAST. Gå til forrige elementknapp med SHIFT+TAB eller VENSTRE PILTAST. Trykk MELLOMROM eller ENTER for å velge elementet i editoren.'
}
]
},
{
name: 'Kommandoer',
items: [
{
name: 'Angre',
legend: 'Trykk ${undo}'
},
{
name: 'Gjør om',
legend: 'Trykk ${redo}'
},
{
name: 'Fet tekst',
legend: 'Trykk ${bold}'
},
{
name: 'Kursiv tekst',
legend: 'Trykk ${italic}'
},
{
name: 'Understreking',
legend: 'Trykk ${underline}'
},
{
name: 'Link',
legend: 'Trykk ${link}'
},
{
name: 'Skjul verktøylinje',
legend: 'Trykk ${toolbarCollapse}'
},
{
name: 'Gå til forrige fokusområde',
legend: 'Trykk ${accessPreviousSpace} for å komme til nærmeste fokusområde før skrivemarkøren som ikke kan nås på vanlig måte, for eksempel to tilstøtende HR-elementer. Gjenta tastekombinasjonen for å komme til fokusområder lenger unna i dokumentet.'
},
{
name: 'Gå til neste fokusområde',
legend: 'Trykk ${accessNextSpace} for å komme til nærmeste fokusområde etter skrivemarkøren som ikke kan nås på vanlig måte, for eksempel to tilstøtende HR-elementer. Gjenta tastekombinasjonen for å komme til fokusområder lenger unna i dokumentet.'
},
{
name: 'Hjelp for tilgjengelighet',
legend: 'Trykk ${a11yHelp}'
}
]
}
]
});
|
/*
DO NOT MODIFY - This file has been generated and will be regenerated
Semantic UI v2.0.2
*/
/*!
* # Semantic UI - Shape
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
"use strict";
$.fn.shape = function(parameters) {
var
$allModules = $(this),
$body = $('body'),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); },
returnedValue
;
$allModules
.each(function() {
var
moduleSelector = $allModules.selector || '',
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.shape.settings, parameters)
: $.extend({}, $.fn.shape.settings),
// internal aliases
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
className = settings.className,
// define namespaces for modules
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
// selector cache
$module = $(this),
$sides = $module.find(selector.sides),
$side = $module.find(selector.side),
// private variables
nextIndex = false,
$activeSide,
$nextSide,
// standard module
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing module for', element);
module.set.defaultSide();
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, instance)
;
},
destroy: function() {
module.verbose('Destroying previous module for', element);
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
},
refresh: function() {
module.verbose('Refreshing selector cache for', element);
$module = $(element);
$sides = $(this).find(selector.shape);
$side = $(this).find(selector.side);
},
repaint: function() {
module.verbose('Forcing repaint event');
var
shape = $sides[0] || document.createElement('div'),
fakeAssignment = shape.offsetWidth
;
},
animate: function(propertyObject, callback) {
module.verbose('Animating box with properties', propertyObject);
callback = callback || function(event) {
module.verbose('Executing animation callback');
if(event !== undefined) {
event.stopPropagation();
}
module.reset();
module.set.active();
};
settings.beforeChange.call($nextSide[0]);
if(module.get.transitionEvent()) {
module.verbose('Starting CSS animation');
$module
.addClass(className.animating)
;
$sides
.css(propertyObject)
.one(module.get.transitionEvent(), callback)
;
module.set.duration(settings.duration);
requestAnimationFrame(function() {
$module
.addClass(className.animating)
;
$activeSide
.addClass(className.hidden)
;
});
}
else {
callback();
}
},
queue: function(method) {
module.debug('Queueing animation of', method);
$sides
.one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation');
setTimeout(function(){
$module.shape(method);
}, 0);
})
;
},
reset: function() {
module.verbose('Animating states reset');
$module
.removeClass(className.animating)
.attr('style', '')
.removeAttr('style')
;
// removeAttr style does not consistently work in safari
$sides
.attr('style', '')
.removeAttr('style')
;
$side
.attr('style', '')
.removeAttr('style')
.removeClass(className.hidden)
;
$nextSide
.removeClass(className.animating)
.attr('style', '')
.removeAttr('style')
;
},
is: {
complete: function() {
return ($side.filter('.' + className.active)[0] == $nextSide[0]);
},
animating: function() {
return $module.hasClass(className.animating);
}
},
set: {
defaultSide: function() {
$activeSide = $module.find('.' + settings.className.active);
$nextSide = ( $activeSide.next(selector.side).length > 0 )
? $activeSide.next(selector.side)
: $module.find(selector.side).first()
;
nextIndex = false;
module.verbose('Active side set to', $activeSide);
module.verbose('Next side set to', $nextSide);
},
duration: function(duration) {
duration = duration || settings.duration;
duration = (typeof duration == 'number')
? duration + 'ms'
: duration
;
module.verbose('Setting animation duration', duration);
if(settings.duration || settings.duration === 0) {
$sides.add($side)
.css({
'-webkit-transition-duration': duration,
'-moz-transition-duration': duration,
'-ms-transition-duration': duration,
'-o-transition-duration': duration,
'transition-duration': duration
})
;
}
},
currentStageSize: function() {
var
$activeSide = $module.find('.' + settings.className.active),
width = $activeSide.outerWidth(true),
height = $activeSide.outerHeight(true)
;
$module
.css({
width: width,
height: height
})
;
},
stageSize: function() {
var
$clone = $module.clone().addClass(className.loading),
$activeSide = $clone.find('.' + settings.className.active),
$nextSide = (nextIndex)
? $clone.find(selector.side).eq(nextIndex)
: ( $activeSide.next(selector.side).length > 0 )
? $activeSide.next(selector.side)
: $clone.find(selector.side).first(),
newSize = {}
;
module.set.currentStageSize();
$activeSide.removeClass(className.active);
$nextSide.addClass(className.active);
$clone.insertAfter($module);
newSize = {
width : $nextSide.outerWidth(true),
height : $nextSide.outerHeight(true)
};
$clone.remove();
$module
.css(newSize)
;
module.verbose('Resizing stage to fit new content', newSize);
},
nextSide: function(selector) {
nextIndex = selector;
$nextSide = $side.filter(selector);
nextIndex = $side.index($nextSide);
if($nextSide.length === 0) {
module.set.defaultSide();
module.error(error.side);
}
module.verbose('Next side manually set to', $nextSide);
},
active: function() {
module.verbose('Setting new side to active', $nextSide);
$side
.removeClass(className.active)
;
$nextSide
.addClass(className.active)
;
settings.onChange.call($nextSide[0]);
module.set.defaultSide();
}
},
flip: {
up: function() {
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
module.debug('Side already visible', $nextSide);
return;
}
if( !module.is.animating()) {
module.debug('Flipping up', $nextSide);
module.set.stageSize();
module.stage.above();
module.animate( module.get.transform.up() );
}
else {
module.queue('flip up');
}
},
down: function() {
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
module.debug('Side already visible', $nextSide);
return;
}
if( !module.is.animating()) {
module.debug('Flipping down', $nextSide);
module.set.stageSize();
module.stage.below();
module.animate( module.get.transform.down() );
}
else {
module.queue('flip down');
}
},
left: function() {
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
module.debug('Side already visible', $nextSide);
return;
}
if( !module.is.animating()) {
module.debug('Flipping left', $nextSide);
module.set.stageSize();
module.stage.left();
module.animate(module.get.transform.left() );
}
else {
module.queue('flip left');
}
},
right: function() {
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
module.debug('Side already visible', $nextSide);
return;
}
if( !module.is.animating()) {
module.debug('Flipping right', $nextSide);
module.set.stageSize();
module.stage.right();
module.animate(module.get.transform.right() );
}
else {
module.queue('flip right');
}
},
over: function() {
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
module.debug('Side already visible', $nextSide);
return;
}
if( !module.is.animating()) {
module.debug('Flipping over', $nextSide);
module.set.stageSize();
module.stage.behind();
module.animate(module.get.transform.over() );
}
else {
module.queue('flip over');
}
},
back: function() {
if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
module.debug('Side already visible', $nextSide);
return;
}
if( !module.is.animating()) {
module.debug('Flipping back', $nextSide);
module.set.stageSize();
module.stage.behind();
module.animate(module.get.transform.back() );
}
else {
module.queue('flip back');
}
}
},
get: {
transform: {
up: function() {
var
translate = {
y: -(($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
z: -($activeSide.outerHeight(true) / 2)
}
;
return {
transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(-90deg)'
};
},
down: function() {
var
translate = {
y: -(($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
z: -($activeSide.outerHeight(true) / 2)
}
;
return {
transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(90deg)'
};
},
left: function() {
var
translate = {
x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
z : -($activeSide.outerWidth(true) / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(90deg)'
};
},
right: function() {
var
translate = {
x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
z : -($activeSide.outerWidth(true) / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(-90deg)'
};
},
over: function() {
var
translate = {
x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) rotateY(180deg)'
};
},
back: function() {
var
translate = {
x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)'
};
}
},
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() {
return ( $activeSide.next(selector.side).length > 0 )
? $activeSide.next(selector.side)
: $module.find(selector.side).first()
;
}
},
stage: {
above: function() {
var
box = {
origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
depth : {
active : ($nextSide.outerHeight(true) / 2),
next : ($activeSide.outerHeight(true) / 2)
}
}
;
module.verbose('Setting the initial animation position as above', $nextSide, box);
$sides
.css({
'transform' : 'translateZ(-' + box.depth.active + 'px)'
})
;
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'top' : box.origin + 'px',
'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
below: function() {
var
box = {
origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
depth : {
active : ($nextSide.outerHeight(true) / 2),
next : ($activeSide.outerHeight(true) / 2)
}
}
;
module.verbose('Setting the initial animation position as below', $nextSide, box);
$sides
.css({
'transform' : 'translateZ(-' + box.depth.active + 'px)'
})
;
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'top' : box.origin + 'px',
'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
left: function() {
var
height = {
active : $activeSide.outerWidth(true),
next : $nextSide.outerWidth(true)
},
box = {
origin : ( ( height.active - height.next ) / 2),
depth : {
active : (height.next / 2),
next : (height.active / 2)
}
}
;
module.verbose('Setting the initial animation position as left', $nextSide, box);
$sides
.css({
'transform' : 'translateZ(-' + box.depth.active + 'px)'
})
;
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'left' : box.origin + 'px',
'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
right: function() {
var
height = {
active : $activeSide.outerWidth(true),
next : $nextSide.outerWidth(true)
},
box = {
origin : ( ( height.active - height.next ) / 2),
depth : {
active : (height.next / 2),
next : (height.active / 2)
}
}
;
module.verbose('Setting the initial animation position as left', $nextSide, box);
$sides
.css({
'transform' : 'translateZ(-' + box.depth.active + 'px)'
})
;
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'left' : box.origin + 'px',
'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
behind: function() {
var
height = {
active : $activeSide.outerWidth(true),
next : $nextSide.outerWidth(true)
},
box = {
origin : ( ( height.active - height.next ) / 2),
depth : {
active : (height.next / 2),
next : (height.active / 2)
}
}
;
module.verbose('Setting the initial animation position as behind', $nextSide, box);
$activeSide
.css({
'transform' : 'rotateY(0deg)'
})
;
$nextSide
.addClass(className.animating)
.css({
'left' : box.origin + 'px',
'transform' : 'rotateY(-180deg)'
})
;
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
}
else {
return settings[name];
}
},
internal: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else if(value !== undefined) {
module[name] = value;
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.shape.settings = {
// module info
name : 'Shape',
// debug content outputted to console
debug : false,
// verbose debug output
verbose : false,
// performance data output
performance: true,
// event namespace
namespace : 'shape',
// callback occurs on side change
beforeChange : function() {},
onChange : function() {},
// allow animation to same side
allowRepeats: false,
// animation duration
duration : false,
// possible errors
error: {
side : 'You tried to switch to a side that does not exist.',
method : 'The method you called is not defined'
},
// classnames used
className : {
animating : 'animating',
hidden : 'hidden',
loading : 'loading',
active : 'active'
},
// selectors used
selector : {
sides : '.sides',
side : '.side'
}
};
})( jQuery, window , document ); |
module.exports = {
createContext: require('./lib/createContext'),
setVertexAttribArrays: require('./lib/setVertexAttribArrays'),
GLBuffer: require('./lib/GLBuffer'),
GLFramebuffer: require('./lib/GLFramebuffer'),
GLShader: require('./lib/GLShader'),
GLTexture: require('./lib/GLTexture'),
VertexArrayObject: require('./lib/VertexArrayObject')
}; |
/* global describe it beforeEach */
const _ = require('lodash');
/*eslint-disable*/
const should = require('should');
const sinon = require('sinon');
require('should-sinon');
/*eslint-enable*/
const update = require('immutability-helper');
const createReducer = require('../src/server/reducer');
const actions = require('../src/server/actions');
function getNoopReducer () {
return createReducer({
client: {
init: () => ({}),
events: {
update: () => ({}),
},
},
cluster: {
init: () => ({}),
events: {
update: () => ({}),
merge: () => ({}),
},
},
});
}
describe('reducer', () => {
describe('NEXT_STATE', () => {
const initialState = {
clusters: {
A: { id: 'A', data: { counter: 10 } },
},
clients: {
a: { id: 'a', data: { counter: 0 }, clusterID: 'A' },
b: { id: 'b', data: { counter: 2 }, clusterID: 'A' },
},
};
const expectedCluster = {
clients: [
{ clusterID: 'A', data: { counter: 0 }, id: 'a' },
{ clusterID: 'A', data: { counter: 2 }, id: 'b' },
],
data: { counter: 10 },
id: 'A',
};
function createUpdateReducer ({ updateClient, updateCluster }) {
return createReducer({
client: {
events: {
update: updateClient,
},
},
cluster: {
events: {
update: updateCluster,
},
},
});
}
it('should call client.events.update', () => {
const update = sinon.spy(() => ({}));
const reducer = createUpdateReducer({
updateClient: update,
});
reducer(initialState, actions.nextState());
update.should.be.calledTwice();
update.getCall(0).args[0].should.eql({
cluster: expectedCluster,
client: {
id: 'a',
data: { counter: 0 },
clusterID: 'A',
},
});
update.getCall(1).args[0].should.eql({
cluster: expectedCluster,
client: {
id: 'b',
data: { counter: 2 },
clusterID: 'A',
},
});
});
it('should call cluster.events.update', () => {
const update = sinon.spy(() => ({}));
const reducer = createUpdateReducer({
updateCluster: update,
});
reducer(initialState, actions.nextState());
update.should.be.calledOnce();
update.getCall(0).args[0].should.eql(expectedCluster);
});
it('should update cluster state', () => {
const reducer = createUpdateReducer({
updateCluster: (cluster) => ({
counter: { $set: cluster.data.counter + 1 },
}),
});
const nextState = reducer(initialState, actions.nextState());
nextState.clusters.A.should.have.property('data').which.eql({ counter: 11 });
});
it('should update client state', () => {
const reducer = createUpdateReducer({
updateClient: ({ client }) => ({
counter: { $set: client.data.counter + 2 },
}),
});
const nextState = reducer(initialState, actions.nextState());
nextState.clients.a.should.have.property('data').which.eql({ counter: 2 });
nextState.clients.b.should.have.property('data').which.eql({ counter: 4 });
});
it('should update client state and cluster state combined', () => {
const reducer = createUpdateReducer({
updateCluster: (cluster) => ({
counter: { $set: cluster.data.counter + 1 },
}),
updateClient: ({ client }) => ({
counter: { $set: client.data.counter + 2 },
}),
});
const nextState = reducer(initialState, actions.nextState());
nextState.clients.a.should.have.property('data').which.eql({ counter: 2 });
nextState.clients.b.should.have.property('data').which.eql({ counter: 4 });
nextState.clusters.A.should.have.property('data').which.eql({ counter: 11 });
});
});
describe('CONNECT', () => {
const state = {
clusters: {},
clients: {},
};
let newState;
let reducer;
let initClient;
let initCluster;
let clusterID;
let expectedClient;
beforeEach(() => {
initClient = sinon.spy(() => ({ x: 'client' }));
initCluster = sinon.spy(() => ({ x: 'cluster' }));
reducer = createReducer({
client: { init: initClient },
cluster: { init: initCluster },
});
newState = reducer(state, actions.connect('a', { size: { width: 200, height: 300 } }));
clusterID = _.keys(newState.clusters)[0];
expectedClient = {
id: 'a',
clusterID,
size: { width: 200, height: 300 },
transform: { x: 0, y: 0 },
adjacentClientIDs: [],
openings: {
top: [],
bottom: [],
left: [],
right: [],
},
};
});
it('should call initClient', () => {
initClient.getCall(0).args[0].should.eql(expectedClient);
initClient.should.be.calledOnce();
});
it('should call initCluster', () => {
initCluster.getCall(0).args[0].should.eql(expectedClient);
initCluster.should.be.calledOnce();
});
it('should add player with new cluster', () => {
newState.should.eql({
clusters: {
[clusterID]: { id: clusterID, data: { x: 'cluster' } },
},
clients: {
a: _.assign({}, expectedClient, { data: { x: 'client' } }),
},
});
});
});
describe('SWIPE', () => {
let initialState;
let manyClustersInitialState;
let clientA;
let clientB;
let clientA2;
let clientB2;
let clientC;
let clientD;
let reducer;
let merge;
beforeEach(() => {
merge = sinon.spy((cluster, otherCluster) => ({
sum: { $set: cluster.data.sum + otherCluster.data.sum },
}));
clientA = {
id: 'a',
clusterID: 'A',
transform: { x: 0, y: 0 },
size: { width: 100, height: 100 },
adjacentClientIDs: [],
data: {},
};
clientB = {
id: 'b',
clusterID: 'B',
transform: { x: 0, y: 0 },
size: { width: 100, height: 100 },
adjacentClientIDs: [],
data: {},
};
clientA2 = update(clientA, { adjacentClientIDs: { $push: ['c'] } });
clientB2 = update(clientB, { adjacentClientIDs: { $push: ['d'] } });
clientC = {
id: 'c',
clusterID: 'A',
transform: { x: -100, y: 20 },
size: { width: 100, height: 200 },
adjacentClientIDs: ['a'],
data: {},
};
clientD = {
id: 'd',
clusterID: 'B',
transform: { x: 100, y: -50 },
size: { width: 100, height: 200 },
adjacentClientIDs: ['b'],
data: {},
};
initialState = {
clusters: {
A: { id: 'A', data: { sum: 2 } },
B: { id: 'B', data: { sum: 3 } },
},
clients: {
a: clientA,
b: clientB,
},
};
manyClustersInitialState = {
clusters: initialState.clusters,
clients: {
a: clientA2,
b: clientB2,
c: clientC,
d: clientD,
},
};
reducer = createReducer({
client: { init: () => {} },
cluster: {
init: () => {},
events: { merge },
},
});
});
describe('swipe handling', () => {
it('should save first swipe', () => {
const state = reducer(initialState, actions.swipe('a', { direction: 'LEFT', position: { x: 0, y: 20 } }));
state.should.have.property('swipes').which.eql([{
direction: 'LEFT',
id: 'a',
position: {
x: 0,
y: 20,
},
timestamp: state.swipes[0].timestamp,
}]);
});
it('should only save latest swipe if delay is too big', (done) => {
const state1 = reducer(initialState, actions.swipe('a', { direction: 'LEFT', position: { x: 0, y: 20 } }));
setTimeout(() => {
const state2 = reducer(state1, actions.swipe('b', { direction: 'RIGHT', position: { x: 100, y: 20 } }));
state2.should.have.property('swipes').which.eql([{
direction: 'RIGHT',
id: 'b',
position: {
x: 100,
y: 20,
},
timestamp: state2.swipes[0].timestamp,
}]);
done();
}, 100);
});
});
describe('merge of two clusters', () => {
let state1;
let state2;
beforeEach(() => {
state1 = reducer(initialState, actions.swipe('a', { direction: 'RIGHT', position: { x: 100, y: 20 } }));
state2 = reducer(state1, actions.swipe('b', { direction: 'LEFT', position: { x: 0, y: 20 } }));
});
it('should remove second cluster', () => {
state2.should.not.have.propertyByPath('clusters', 'A');
});
it('should update adjacentClientIDs in each client', () => {
state2.should.have.propertyByPath('clients', 'a', 'adjacentClientIDs').which.eql(['b']);
state2.should.have.propertyByPath('clients', 'b', 'adjacentClientIDs').which.eql(['a']);
});
it('should recalculate transform of joined client', () => {
state2.should.have.propertyByPath('clients', 'a', 'transform').which.eql({ x: -100, y: 0 });
});
it('should update clusterID of joined client', () => {
state2.should.have.propertyByPath('clients', 'a', 'clusterID').which.eql('B');
});
it('should call merge handler with both clusters and transform', () => {
merge.should.be.calledOnce();
merge.getCall(0).args.should.eql([
{ data: { sum: 3 }, id: 'B', clients: [clientB] },
{ data: { sum: 2 }, id: 'A', clients: [clientA] },
{ x: -100, y: 0 },
]);
});
it('should merge state', () => {
state2.should.have.propertyByPath('clusters', 'B', 'data').which.eql({ sum: 5 });
});
it('should recalculate openings', () => {
state2.should.have.propertyByPath('clients', 'a', 'openings').which.eql({
bottom: [],
left: [],
right: [{ end: 100, start: 0 }],
top: [],
});
state2.should.have.propertyByPath('clients', 'b', 'openings').which.eql({
bottom: [],
left: [{ end: 100, start: 0 }],
right: [],
top: [],
});
});
});
describe('merge of two clusters with each having multiple clients', () => {
let state1;
let state2;
beforeEach(() => {
state1 = reducer(manyClustersInitialState, actions.swipe('a', {
direction: 'RIGHT',
position: { x: 100, y: 20 },
}));
state2 = reducer(state1, actions.swipe('b', { direction: 'LEFT', position: { x: 0, y: 20 } }));
});
it('should remove second cluster', () => {
state2.should.not.have.propertyByPath('clusters', 'A');
});
it('should update adjacentClientIDs in each client', () => {
state2.should.have.propertyByPath('clients', 'a', 'adjacentClientIDs')
.which.containEql('b')
.which.containEql('c')
.which.have.length(2);
state2.should.have.propertyByPath('clients', 'b', 'adjacentClientIDs')
.which.containEql('a')
.which.containEql('d')
.which.have.length(2);
});
it('should recalculate transform of joined client', () => {
state2.should.have.propertyByPath('clients', 'a', 'transform').which.eql({ x: -100, y: 0 });
state2.should.have.propertyByPath('clients', 'c', 'transform').which.eql({ x: -200, y: 20 });
state2.should.have.propertyByPath('clients', 'b', 'transform').which.eql({ x: 0, y: 0 });
state2.should.have.propertyByPath('clients', 'd', 'transform').which.eql({ x: 100, y: -50 });
});
it('should update clusterID of joined client', () => {
state2.should.have.propertyByPath('clients', 'a', 'clusterID').which.eql('B');
state2.should.have.propertyByPath('clients', 'c', 'clusterID').which.eql('B');
});
it('should call merge handler with both clusters and transform', () => {
merge.should.be.calledOnce();
merge.getCall(0).args.should.eql([
{ data: { sum: 3 }, id: 'B', clients: [clientB2, clientD] },
{ data: { sum: 2 }, id: 'A', clients: [clientA2, clientC] },
{ x: -100, y: 0 },
]);
});
it('should merge state', () => {
state2.should.have.propertyByPath('clusters', 'B', 'data').which.eql({ sum: 5 });
});
it('should recalculate openings', () => {
state2.should.have.propertyByPath('clients', 'a', 'openings').which.eql({
bottom: [],
left: [{ end: 100, start: 20 }],
right: [{ end: 100, start: 0 }],
top: [],
});
state2.should.have.propertyByPath('clients', 'b', 'openings').which.eql({
bottom: [],
left: [{ end: 100, start: 0 }],
right: [{ end: 150, start: 0 }],
top: [],
});
});
});
});
describe('RECONNECT', () => {
let initialState;
let nextState;
let reducer;
beforeEach(() => {
reducer = getNoopReducer();
initialState = {
clusters: {
A: { id: 'A', data: { counter: 10 } },
},
clients: {
a: {
id: 'a',
data: { counter: 0 },
clusterID: 'A',
size: { width: 100, height: 200 },
},
},
};
nextState = reducer(initialState, actions.reconnect('a', { size: { width: 200, height: 100 } }));
});
it('should assign client to new cluster', () => {
nextState.should.have.propertyByPath('clients', 'a', 'clusterID').which.not.eql('A');
nextState.should.have.propertyByPath('clusters', nextState.clients.a.clusterID);
});
it('should update client size', () => {
nextState.should.have.propertyByPath('clients', 'a', 'size').which.eql({ width: 200, height: 100 });
});
});
});
|
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var $ = require('gulp-load-plugins')();
module.exports = function(options) {
function webpack(watch, callback) {
var webpackOptions = {
watch: watch,
module: {
preLoaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'jshint-loader'
}],
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
},
output: {
filename: 'index.js'
}
};
if (watch) {
webpackOptions.devtool = 'inline-source-map';
}
var webpackChangeHandler = function(err, stats) {
if (err) {
options.errorHandler('Webpack')(err);
}
$.util.log(stats.toString({
colors: $.util.colors.supportsColor,
chunks: false,
hash: false,
version: false
}));
browserSync.reload();
if (watch) {
watch = false;
callback();
}
};
return gulp.src(options.src + '/app/index.js')
.pipe($.webpack(webpackOptions, null, webpackChangeHandler))
.pipe(gulp.dest(options.tmp + '/serve/app'));
}
gulp.task('scripts', function() {
return webpack(false);
});
gulp.task('scripts:watch', ['scripts'], function(callback) {
return webpack(true, callback);
});
};
|
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
const agent = new http.Agent();
const _err = new Error('kaboom');
agent.createSocket = function(req, options, cb) {
cb(_err);
};
const req = http
.request({
agent
})
.on('error', common.mustCall((err) => {
assert.strictEqual(err, _err);
}))
.on('close', common.mustCall(() => {
assert.strictEqual(req.destroyed, true);
}));
|
var scss = require('./styles/background.scss');
module.exports = scss;
|
/* Return the value of the first argument plus twice the second
*/
var aPlus2b = function () {
return a + 2*b;
}
anything.prototype.aPlus2b = aPlus2b; |
var express = require('express');
var app = express();
var user = { username: 'admin', password: 'secret' };
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: 'mottainai kara' }));
function requiresAccount(req, res, next) {
if (req.session.signedIn) {
next();
} else {
res.send(401);
}
}
app.post('/session', function(req, res) {
if (req.body.username === user.username
&& req.body.password === user.password) {
req.session.signedIn = true;
req.session.user = user;
res.send(200);
} else {
res.send(401);
}
});
app.get('/admin', requiresAccount, function(req, res) {
res.send('Administrators only area');
});
module.exports = app;
|
var md = false;
var color = tinycolor('#840000');
$(document).ready(function(){
$.ajaxSetup({ cache: false });
$('.unicorn').draggable({ handle: "h1" });
$(document)
.on('mousedown',function(e){md=true;})
.on('mouseup',function(e){md=false;});
$('table').on('dragstart',function(e){
e.preventDefault();
return false;
});
$('.tools li').on('click',function(){
switch($(this).index()){
case 6:
clear();
break;
case 7:
save();
break;
default:
$('.tools li').removeClass('selected');
$(this).addClass('selected');
break;
}
});
$('.palette li').on('click',function(){
$('.palette li').removeClass('selected');
$(this).addClass('selected');
$('.current').css('background-color', current_color().toRgbString() );
$('.mc').trigger("colorpickersliders.updateColor", current_color().toHexString());
}).each(function(){
$(this).data('default', $(this).css('background-color'));
});
function current_color(){
return color;
}
function handle_tool(obj, is_click){
switch($('.tools li.selected').index()){
case 0: //'paint':
paint(obj);
break;
case 1: // Fill
if( is_click ) fill(obj);
break;
case 2: // Erase
update_pixel(obj, tinycolor('#000000'));
break;
case 3: //'pick':
pick(obj);
break;
case 4: //'lighten':
lighten(obj);
break;
case 5: //'darken':
darken(obj);
break;
}
}
var fill_target = null;
var fill_stack = [];
function fill(obj){
fill_target = tinycolor($(obj).css('background-color')).toRgbString();
if( fill_target == current_color().toRgbString ){
return false;
}
console.log('Fill Target',fill_target);
console.log('Fill With',current_color());
do_fill(obj);
while(fill_stack.length > 0){
pixel = fill_stack.pop();
do_fill(pixel);
}
}
function is_target_color(obj){
return ( tinycolor($(obj).css('background-color')).toRgbString() == fill_target);
}
function do_fill(obj){
obj = $(obj);
if( is_target_color(obj) ){
update_pixel(obj, current_color());
var r = obj.next('td');
var l = obj.prev('td');
var u = obj.parent().prev('tr').find('td:eq(' + obj.index() + ')');
var d = obj.parent().next('tr').find('td:eq(' + obj.index() + ')');
if( r.length && is_target_color(r[0]) ) fill_stack.push(r[0]);
if( l.length && is_target_color(l[0]) ) fill_stack.push(l[0]);
if( u.length && is_target_color(u[0]) ) fill_stack.push(u[0]);
if( d.length && is_target_color(d[0]) ) fill_stack.push(d[0]);
}
}
function save(){
var filename = prompt('Please enter a filename', 'mypaint');
filename = filename.replace(/[^a-z0-9]/gi, '_').toLowerCase();
$.get('/save/' + filename);
alert('Saved into saves/' + filename + '.py, \nRun with "sudo saves/' + filename + '.py"');
}
function clear(){
$('td').css('background-color','rgb(0,0,0)').data('changed',false);
$.get('/clear');
$.get('/show');
}
function lighten(obj){
var rgb = tinycolor($(obj).css('background-color')).toRgb();
update_pixel(obj, tinycolor({
r: rgb.r + 2,
g: rgb.g + 2,
b: rgb.b + 2
}));
}
function darken(obj){
var rgb = tinycolor($(obj).css('background-color')).toRgb();
update_pixel(obj, tinycolor({
r: rgb.r - 2,
g: rgb.g - 2,
b: rgb.b - 2
}));
}
/*
function set_color(hex){
$('.palette li.selected').css('background-color', rgb_string(rgb));
$('.current').css('background-color',rgb_string(rgb));
}
*/
function pick(obj){
var col = tinycolor($(obj).css('background-color'));
$('.mc').trigger("colorpickersliders.updateColor", col.toHexString());
}
function update_pixel(obj, col){
var bgcol = tinycolor($(obj).css('background-color'));
if( col.toRgbString() != bgcol.toRgbString() ){
$(obj)
.data('changed', true)
.css('background-color',col.toRgbString());
}
}
function update_pixels(){
var changed = false;
$('td').each(function( index, obj ){
if( $(obj).data('changed') ){
$(obj).data('changed',false);
changed = true;
var x = $(this).index();
var y = $(this).parent().index();
var col = tinycolor($(obj).css('background-color')).toRgb();
var data = [x,y,col.r,col.g,col.b];
$.get('/pixel/' + data.join('/'));
}
});
if(changed){
$.get('/show');
}
}
function paint(obj){
update_pixel(obj, current_color());
}
$('table td').on('click',function(){
handle_tool(this, true);
});
$('table td').on('mousemove',function(){
if(!md) return false;
handle_tool(this, false);
})
swatches = [
'rgb(0,0,0)','rgb(132,0,0)','rgb(0,132,0)','rgb(132,132,0)','rgb(0,0,132)','rgb(132,0,132)','rgb(0,132,132)','rgb(132,132,132)',
'rgb(198,198,198)','rgb(255,0,0)','rgb(0,255,0)','rgb(255,255,0)','rgb(0,0,255)','rgb(255,0,255)','rgb(0,255,255)','rgb(255,255,255)'
];
$('.mc').ColorPickerSliders({
flat: true,
previewformat: 'hex',
color: current_color(),
labels: {
preview: '',
hslhue: 'Hue',
hslsaturation: 'Saturation',
hsllightness: 'Lightness'
},
swatches: swatches,
order: {
hsl: 1,
preview: 2
},
onchange: function(obj, c){
color = c.tiny;
}
});
$.get('/clear');
$.get('/show');
var update = setInterval(update_pixels, 50);
});
|
'use strict';
var Support = require(__dirname + '/../support')
, DataTypes = require(__dirname + '/../../../lib/data-types')
, expectsql = Support.expectsql
, current = Support.sequelize;
// Notice: [] will be replaced by dialect specific tick/quote character when there is not dialect specific expectation but only a default expectation
suite(Support.getTestDialectTeaser('SQL'), function() {
suite('DataTypes', function () {
var testsql = function (description, dataType, expectation) {
test(description, function () {
return expectsql(current.normalizeDataType(dataType).toSql(), expectation);
});
};
suite('STRING', function () {
testsql('STRING', DataTypes.STRING, {
default: 'VARCHAR(255)',
mssql: 'NVARCHAR(255)',
oracle: 'VARCHAR2(255)'
});
testsql('STRING(1234)', DataTypes.STRING(1234), {
default: 'VARCHAR(1234)',
mssql: 'NVARCHAR(1234)',
oracle: 'VARCHAR2(1234)'
});
testsql('STRING({ length: 1234 })', DataTypes.STRING({ length: 1234 }), {
default: 'VARCHAR(1234)',
mssql: 'NVARCHAR(1234)',
oracle: 'VARCHAR2(1234)'
});
testsql('STRING(1234).BINARY', DataTypes.STRING(1234).BINARY, {
default: 'VARCHAR(1234) BINARY',
sqlite: 'VARCHAR BINARY(1234)',
mssql: 'BINARY(1234)',
postgres: 'BYTEA',
oracle: 'VARCHAR2(1234)'
});
testsql('STRING.BINARY', DataTypes.STRING.BINARY, {
default: 'VARCHAR(255) BINARY',
sqlite: 'VARCHAR BINARY(255)',
mssql: 'BINARY(255)',
postgres: 'BYTEA',
oracle: 'VARCHAR2(255)'
});
});
if (current.dialect.name !== 'oracle') {
suite('TEXT', function () {
testsql('TEXT', DataTypes.TEXT, {
default: 'TEXT',
mssql: 'NVARCHAR(MAX)' // in mssql text is actually representing a non unicode text field
});
testsql('TEXT("tiny")', DataTypes.TEXT('tiny'), {
default: 'TEXT',
mssql: 'NVARCHAR(256)',
mysql: 'TINYTEXT',
mariadb: 'TINYTEXT'
});
testsql('TEXT({ length: "tiny" })', DataTypes.TEXT({ length: 'tiny' }), {
default: 'TEXT',
mssql: 'NVARCHAR(256)',
mysql: 'TINYTEXT',
mariadb: 'TINYTEXT'
});
testsql('TEXT("medium")', DataTypes.TEXT('medium'), {
default: 'TEXT',
mssql: 'NVARCHAR(MAX)',
mysql: 'MEDIUMTEXT',
mariadb: 'MEDIUMTEXT'
});
testsql('TEXT("long")', DataTypes.TEXT('long'), {
default: 'TEXT',
mssql: 'NVARCHAR(MAX)',
mysql: 'LONGTEXT',
mariadb: 'LONGTEXT'
});
});
}
suite('CHAR', function () {
testsql('CHAR', DataTypes.CHAR, {
default: 'CHAR(255)'
});
testsql('CHAR(12)', DataTypes.CHAR(12), {
default: 'CHAR(12)'
});
testsql('CHAR({ length: 12 })', DataTypes.CHAR({ length: 12 }), {
default: 'CHAR(12)'
});
testsql('CHAR(12).BINARY', DataTypes.CHAR(12).BINARY, {
default: 'CHAR(12) BINARY',
sqlite: 'CHAR BINARY(12)',
postgres: 'BYTEA',
oracle: 'CHAR(12)'
});
testsql('CHAR.BINARY', DataTypes.CHAR.BINARY, {
default: 'CHAR(255) BINARY',
sqlite: 'CHAR BINARY(255)',
postgres: 'BYTEA',
oracle: 'CHAR(255)'
});
});
suite('BOOLEAN', function () {
testsql('BOOLEAN', DataTypes.BOOLEAN, {
postgres: 'BOOLEAN',
mssql: 'BIT',
mysql: 'TINYINT(1)',
sqlite: 'TINYINT(1)',
oracle: 'NUMBER(1)'
});
});
suite('DATE', function () {
testsql('DATE', DataTypes.DATE, {
postgres: 'TIMESTAMP WITH TIME ZONE',
mssql: 'DATETIME2',
mysql: 'DATETIME',
sqlite: 'DATETIME',
oracle: 'TIMESTAMP WITH LOCAL TIME ZONE',
});
});
suite('UUID', function () {
testsql('UUID', DataTypes.UUID, {
postgres: 'UUID',
mssql: 'CHAR(36)',
mysql: 'CHAR(36) BINARY',
sqlite: 'UUID',
oracle: 'CHAR(36)'
});
testsql('UUIDV1', DataTypes.UUIDV1, {
default: 'UUIDV1'
});
testsql('UUIDV4', DataTypes.UUIDV4, {
default: 'UUIDV4'
});
});
suite('NOW', function () {
testsql('NOW', DataTypes.NOW, {
default: 'NOW',
mssql: 'GETDATE()',
oracle: 'LOCALTIMESTAMP'
});
});
suite('INTEGER', function () {
testsql('INTEGER', DataTypes.INTEGER, {
default: 'INTEGER'
});
testsql('INTEGER.UNSIGNED', DataTypes.INTEGER.UNSIGNED, {
default: 'INTEGER UNSIGNED',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER.UNSIGNED.ZEROFILL', DataTypes.INTEGER.UNSIGNED.ZEROFILL, {
default: 'INTEGER UNSIGNED ZEROFILL',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER(11)', DataTypes.INTEGER(11), {
default: 'INTEGER(11)',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER({ length: 11 })', DataTypes.INTEGER({ length: 11 }), {
default: 'INTEGER(11)',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER(11).UNSIGNED', DataTypes.INTEGER(11).UNSIGNED, {
default: 'INTEGER(11) UNSIGNED',
sqlite: 'INTEGER UNSIGNED(11)',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER(11).UNSIGNED.ZEROFILL', DataTypes.INTEGER(11).UNSIGNED.ZEROFILL, {
default: 'INTEGER(11) UNSIGNED ZEROFILL',
sqlite: 'INTEGER UNSIGNED ZEROFILL(11)',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER(11).ZEROFILL', DataTypes.INTEGER(11).ZEROFILL, {
default: 'INTEGER(11) ZEROFILL',
sqlite: 'INTEGER ZEROFILL(11)',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
testsql('INTEGER(11).ZEROFILL.UNSIGNED', DataTypes.INTEGER(11).ZEROFILL.UNSIGNED, {
default: 'INTEGER(11) UNSIGNED ZEROFILL',
sqlite: 'INTEGER UNSIGNED ZEROFILL(11)',
postgres: 'INTEGER',
mssql: 'INTEGER',
oracle: 'INTEGER'
});
});
suite('BIGINT', function () {
testsql('BIGINT', DataTypes.BIGINT, {
default: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT.UNSIGNED', DataTypes.BIGINT.UNSIGNED, {
default: 'BIGINT UNSIGNED',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT.UNSIGNED.ZEROFILL', DataTypes.BIGINT.UNSIGNED.ZEROFILL, {
default: 'BIGINT UNSIGNED ZEROFILL',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT(11)', DataTypes.BIGINT(11), {
default: 'BIGINT(11)',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT({ length: 11 })', DataTypes.BIGINT({ length: 11 }), {
default: 'BIGINT(11)',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT(11).UNSIGNED', DataTypes.BIGINT(11).UNSIGNED, {
default: 'BIGINT(11) UNSIGNED',
sqlite: 'BIGINT UNSIGNED(11)',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT(11).UNSIGNED.ZEROFILL', DataTypes.BIGINT(11).UNSIGNED.ZEROFILL, {
default: 'BIGINT(11) UNSIGNED ZEROFILL',
sqlite: 'BIGINT UNSIGNED ZEROFILL(11)',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT(11).ZEROFILL', DataTypes.BIGINT(11).ZEROFILL, {
default: 'BIGINT(11) ZEROFILL',
sqlite: 'BIGINT ZEROFILL(11)',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
testsql('BIGINT(11).ZEROFILL.UNSIGNED', DataTypes.BIGINT(11).ZEROFILL.UNSIGNED, {
default: 'BIGINT(11) UNSIGNED ZEROFILL',
sqlite: 'BIGINT UNSIGNED ZEROFILL(11)',
postgres: 'BIGINT',
mssql: 'BIGINT',
oracle: 'NUMBER(19)'
});
});
suite('REAL', function () {
testsql('REAL', DataTypes.REAL, {
default: 'REAL'
});
testsql('REAL.UNSIGNED', DataTypes.REAL.UNSIGNED, {
default: 'REAL UNSIGNED',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11)', DataTypes.REAL(11), {
default: 'REAL(11)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL({ length: 11 })', DataTypes.REAL({ length: 11 }), {
default: 'REAL(11)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11).UNSIGNED', DataTypes.REAL(11).UNSIGNED, {
default: 'REAL(11) UNSIGNED',
sqlite: 'REAL UNSIGNED(11)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11).UNSIGNED.ZEROFILL', DataTypes.REAL(11).UNSIGNED.ZEROFILL, {
default: 'REAL(11) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11).ZEROFILL', DataTypes.REAL(11).ZEROFILL, {
default: 'REAL(11) ZEROFILL',
sqlite: 'REAL ZEROFILL(11)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11).ZEROFILL.UNSIGNED', DataTypes.REAL(11).ZEROFILL.UNSIGNED, {
default: 'REAL(11) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11, 12)', DataTypes.REAL(11, 12), {
default: 'REAL(11,12)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11, 12).UNSIGNED', DataTypes.REAL(11, 12).UNSIGNED, {
default: 'REAL(11,12) UNSIGNED',
sqlite: 'REAL UNSIGNED(11,12)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL({ length: 11, decimals: 12 }).UNSIGNED', DataTypes.REAL({ length: 11, decimals: 12 }).UNSIGNED, {
default: 'REAL(11,12) UNSIGNED',
sqlite: 'REAL UNSIGNED(11,12)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11, 12).UNSIGNED.ZEROFILL', DataTypes.REAL(11, 12).UNSIGNED.ZEROFILL, {
default: 'REAL(11,12) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11,12)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11, 12).ZEROFILL', DataTypes.REAL(11, 12).ZEROFILL, {
default: 'REAL(11,12) ZEROFILL',
sqlite: 'REAL ZEROFILL(11,12)',
postgres: 'REAL',
mssql: 'REAL'
});
testsql('REAL(11, 12).ZEROFILL.UNSIGNED', DataTypes.REAL(11, 12).ZEROFILL.UNSIGNED, {
default: 'REAL(11,12) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11,12)',
postgres: 'REAL',
mssql: 'REAL'
});
});
suite('DOUBLE PRECISION', function () {
testsql('DOUBLE', DataTypes.DOUBLE, {
default: 'DOUBLE PRECISION'
});
testsql('DOUBLE.UNSIGNED', DataTypes.DOUBLE.UNSIGNED, {
default: 'DOUBLE PRECISION UNSIGNED',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11)', DataTypes.DOUBLE(11), {
default: 'DOUBLE PRECISION(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).UNSIGNED', DataTypes.DOUBLE(11).UNSIGNED, {
default: 'DOUBLE PRECISION(11) UNSIGNED',
sqlite: 'DOUBLE PRECISION UNSIGNED(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE({ length: 11 }).UNSIGNED', DataTypes.DOUBLE({ length: 11 }).UNSIGNED, {
default: 'DOUBLE PRECISION(11) UNSIGNED',
sqlite: 'DOUBLE PRECISION UNSIGNED(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).UNSIGNED.ZEROFILL', DataTypes.DOUBLE(11).UNSIGNED.ZEROFILL, {
default: 'DOUBLE PRECISION(11) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).ZEROFILL', DataTypes.DOUBLE(11).ZEROFILL, {
default: 'DOUBLE PRECISION(11) ZEROFILL',
sqlite: 'DOUBLE PRECISION ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).ZEROFILL.UNSIGNED', DataTypes.DOUBLE(11).ZEROFILL.UNSIGNED, {
default: 'DOUBLE PRECISION(11) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12)', DataTypes.DOUBLE(11, 12), {
default: 'DOUBLE PRECISION(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).UNSIGNED', DataTypes.DOUBLE(11, 12).UNSIGNED, {
default: 'DOUBLE PRECISION(11,12) UNSIGNED',
sqlite: 'DOUBLE PRECISION UNSIGNED(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).UNSIGNED.ZEROFILL', DataTypes.DOUBLE(11, 12).UNSIGNED.ZEROFILL, {
default: 'DOUBLE PRECISION(11,12) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).ZEROFILL', DataTypes.DOUBLE(11, 12).ZEROFILL, {
default: 'DOUBLE PRECISION(11,12) ZEROFILL',
sqlite: 'DOUBLE PRECISION ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).ZEROFILL.UNSIGNED', DataTypes.DOUBLE(11, 12).ZEROFILL.UNSIGNED, {
default: 'DOUBLE PRECISION(11,12) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
});
suite('FLOAT', function () {
testsql('FLOAT', DataTypes.FLOAT, {
default: 'FLOAT',
postgres: 'FLOAT'
});
testsql('FLOAT.UNSIGNED', DataTypes.FLOAT.UNSIGNED, {
default: 'FLOAT UNSIGNED',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT'
});
testsql('FLOAT(11)', DataTypes.FLOAT(11), {
default: 'FLOAT(11)',
postgres: 'FLOAT(11)', // 1-24 = 4 bytes; 35-53 = 8 bytes
mssql: 'FLOAT(11)' // 1-24 = 4 bytes; 35-53 = 8 bytes
});
testsql('FLOAT(11).UNSIGNED', DataTypes.FLOAT(11).UNSIGNED, {
default: 'FLOAT(11) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11)',
postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11).UNSIGNED.ZEROFILL, {
default: 'FLOAT(11) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)',
postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11).ZEROFILL', DataTypes.FLOAT(11).ZEROFILL, {
default: 'FLOAT(11) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11)',
postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)',
oracle: 'FLOAT(11)'
});
testsql('FLOAT({ length: 11 }).ZEROFILL', DataTypes.FLOAT({ length: 11 }).ZEROFILL, {
default: 'FLOAT(11) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11)',
postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11).ZEROFILL.UNSIGNED, {
default: 'FLOAT(11) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)',
postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11, 12)', DataTypes.FLOAT(11, 12), {
default: 'FLOAT(11,12)',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11, 12).UNSIGNED', DataTypes.FLOAT(11, 12).UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11,12)',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT(11)'
});
testsql('FLOAT({ length: 11, decimals: 12 }).UNSIGNED', DataTypes.FLOAT({ length: 11, decimals: 12 }).UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11,12)',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11, 12).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11, 12).UNSIGNED.ZEROFILL, {
default: 'FLOAT(11,12) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11, 12).ZEROFILL', DataTypes.FLOAT(11, 12).ZEROFILL, {
default: 'FLOAT(11,12) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11,12)',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT(11)'
});
testsql('FLOAT(11, 12).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11, 12).ZEROFILL.UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)',
postgres: 'FLOAT',
mssql: 'FLOAT',
oracle: 'FLOAT(11)'
});
});
if (current.dialect.supports.NUMERIC) {
testsql('NUMERIC', DataTypes.NUMERIC, {
default: 'DECIMAL'
});
testsql('NUMERIC(15,5)', DataTypes.NUMERIC(15,5), {
default: 'DECIMAL(15,5)',
oracle: 'NUMBER(15,5)'
});
}
suite('DECIMAL', function () {
testsql('DECIMAL', DataTypes.DECIMAL, {
default: 'DECIMAL',
oracle: 'NUMBER'
});
testsql('DECIMAL(10, 2)', DataTypes.DECIMAL(10, 2), {
default: 'DECIMAL(10,2)',
oracle: 'NUMBER(10,2)'
});
testsql('DECIMAL({ precision: 10, scale: 2 })', DataTypes.DECIMAL({ precision: 10, scale: 2 }), {
default: 'DECIMAL(10,2)',
oracle: 'NUMBER(10,2)'
});
testsql('DECIMAL(10)', DataTypes.DECIMAL(10), {
default: 'DECIMAL(10)',
oracle: 'NUMBER(10)'
});
testsql('DECIMAL({ precision: 10 })', DataTypes.DECIMAL({ precision: 10 }), {
default: 'DECIMAL(10)',
oracle: 'NUMBER(10)'
});
});
if (current.dialect.name !== 'oracle') {
// TODO: Fix Enums and add more tests
// suite('ENUM', function () {
// testsql('ENUM("value 1", "value 2")', DataTypes.ENUM('value 1', 'value 2'), {
// default: 'ENUM'
// });
// });
suite('BLOB', function () {
testsql('BLOB', DataTypes.BLOB, {
default: 'BLOB',
mssql: 'VARBINARY(MAX)',
postgres: 'BYTEA'
});
testsql('BLOB("tiny")', DataTypes.BLOB('tiny'), {
default: 'TINYBLOB',
mssql: 'VARBINARY(256)',
postgres: 'BYTEA'
});
testsql('BLOB("medium")', DataTypes.BLOB('medium'), {
default: 'MEDIUMBLOB',
mssql: 'VARBINARY(MAX)',
postgres: 'BYTEA'
});
testsql('BLOB({ length: "medium" })', DataTypes.BLOB({ length: 'medium' }), {
default: 'MEDIUMBLOB',
mssql: 'VARBINARY(MAX)',
postgres: 'BYTEA'
});
testsql('BLOB("long")', DataTypes.BLOB('long'), {
default: 'LONGBLOB',
mssql: 'VARBINARY(MAX)',
postgres: 'BYTEA'
});
});
}
if (current.dialect.supports.ARRAY) {
suite('ARRAY', function () {
testsql('ARRAY(VARCHAR)', DataTypes.ARRAY(DataTypes.STRING), {
postgres: 'VARCHAR(255)[]'
});
testsql('ARRAY(VARCHAR(100))', DataTypes.ARRAY(DataTypes.STRING(100)), {
postgres: 'VARCHAR(100)[]'
});
testsql('ARRAY(INTEGER)', DataTypes.ARRAY(DataTypes.INTEGER), {
postgres: 'INTEGER[]'
});
testsql('ARRAY(HSTORE)', DataTypes.ARRAY(DataTypes.HSTORE), {
postgres: 'HSTORE[]'
});
testsql('ARRAY(ARRAY(VARCHAR(255)))', DataTypes.ARRAY(DataTypes.ARRAY(DataTypes.STRING)), {
postgres: 'VARCHAR(255)[][]'
});
testsql('ARRAY(TEXT)', DataTypes.ARRAY(DataTypes.TEXT), {
postgres: 'TEXT[]'
});
testsql('ARRAY(DATE)', DataTypes.ARRAY(DataTypes.DATE), {
postgres: 'TIMESTAMP WITH TIME ZONE[]'
});
testsql('ARRAY(BOOLEAN)', DataTypes.ARRAY(DataTypes.BOOLEAN), {
postgres: 'BOOLEAN[]'
});
testsql('ARRAY(DECIMAL)', DataTypes.ARRAY(DataTypes.DECIMAL), {
postgres: 'DECIMAL[]'
});
testsql('ARRAY(DECIMAL(6))', DataTypes.ARRAY(DataTypes.DECIMAL(6)), {
postgres: 'DECIMAL(6)[]'
});
testsql('ARRAY(DECIMAL(6,4))', DataTypes.ARRAY(DataTypes.DECIMAL(6,4)), {
postgres: 'DECIMAL(6,4)[]'
});
testsql('ARRAY(DOUBLE)', DataTypes.ARRAY(DataTypes.DOUBLE), {
postgres: 'DOUBLE PRECISION[]'
});
testsql('ARRAY(REAL))', DataTypes.ARRAY(DataTypes.REAL), {
postgres: 'REAL[]'
});
if (current.dialect.supports.JSON) {
testsql('ARRAY(JSON)', DataTypes.ARRAY(DataTypes.JSON), {
postgres: 'JSON[]'
});
}
if (current.dialect.supports.JSONB) {
testsql('ARRAY(JSONB)', DataTypes.ARRAY(DataTypes.JSONB), {
postgres: 'JSONB[]'
});
}
});
}
});
}); |
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var test = 1;
function fail(n, expected, result) { WScript.Echo("failure in test " + test + "; expected " + expected + ", got " + result); }
function test0() {
var x;
var y;
var result;
var check;
// Test 0: both arguments variables
x = 0;
y = 0;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1: both arguments constants
result = (0 >> 0)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 2: LHS constant
y = 0;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 3: RHS constant
x = 0;
result = (x >> 0)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 4: both arguments variables
x = 1;
y = 0;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 5: both arguments constants
result = (1 >> 0)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 6: LHS constant
y = 0;
result = (1 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 7: RHS constant
x = 1;
result = (x >> 0)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 8: both arguments variables
x = -1;
y = 0;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 9: both arguments constants
result = (-1 >> 0)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 10: LHS constant
y = 0;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 11: RHS constant
x = -1;
result = (x >> 0)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 12: both arguments variables
x = 2;
y = 0;
result = (x >> y);
check = 2;
if(result != check) { fail(test, check, result); } ++test;
// Test 13: both arguments constants
result = (2 >> 0)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 14: LHS constant
y = 0;
result = (2 >> y)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 15: RHS constant
x = 2;
result = (x >> 0)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 16: both arguments variables
x = -2;
y = 0;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 17: both arguments constants
result = (-2 >> 0)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 18: LHS constant
y = 0;
result = (-2 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 19: RHS constant
x = -2;
result = (x >> 0)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 20: both arguments variables
x = 3;
y = 0;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 21: both arguments constants
result = (3 >> 0)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 22: LHS constant
y = 0;
result = (3 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 23: RHS constant
x = 3;
result = (x >> 0)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 24: both arguments variables
x = -3;
y = 0;
result = (x >> y);
check = -3;
if(result != check) { fail(test, check, result); } ++test;
// Test 25: both arguments constants
result = (-3 >> 0)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 26: LHS constant
y = 0;
result = (-3 >> y)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 27: RHS constant
x = -3;
result = (x >> 0)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 28: both arguments variables
x = 4;
y = 0;
result = (x >> y);
check = 4;
if(result != check) { fail(test, check, result); } ++test;
// Test 29: both arguments constants
result = (4 >> 0)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 30: LHS constant
y = 0;
result = (4 >> y)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 31: RHS constant
x = 4;
result = (x >> 0)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 32: both arguments variables
x = -4;
y = 0;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 33: both arguments constants
result = (-4 >> 0)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 34: LHS constant
y = 0;
result = (-4 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 35: RHS constant
x = -4;
result = (x >> 0)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 36: both arguments variables
x = 8;
y = 0;
result = (x >> y);
check = 8;
if(result != check) { fail(test, check, result); } ++test;
// Test 37: both arguments constants
result = (8 >> 0)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 38: LHS constant
y = 0;
result = (8 >> y)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 39: RHS constant
x = 8;
result = (x >> 0)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 40: both arguments variables
x = -8;
y = 0;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 41: both arguments constants
result = (-8 >> 0)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 42: LHS constant
y = 0;
result = (-8 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 43: RHS constant
x = -8;
result = (x >> 0)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 44: both arguments variables
x = 1073741822;
y = 0;
result = (x >> y);
check = 1073741822;
if(result != check) { fail(test, check, result); } ++test;
// Test 45: both arguments constants
result = (1073741822 >> 0)
check = 1073741822
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 46: LHS constant
y = 0;
result = (1073741822 >> y)
check = 1073741822
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 47: RHS constant
x = 1073741822;
result = (x >> 0)
check = 1073741822
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 48: both arguments variables
x = 1073741823;
y = 0;
result = (x >> y);
check = 1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 49: both arguments constants
result = (1073741823 >> 0)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 50: LHS constant
y = 0;
result = (1073741823 >> y)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 51: RHS constant
x = 1073741823;
result = (x >> 0)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 52: both arguments variables
x = 1073741824;
y = 0;
result = (x >> y);
check = 1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 53: both arguments constants
result = (1073741824 >> 0)
check = 1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 54: LHS constant
y = 0;
result = (1073741824 >> y)
check = 1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 55: RHS constant
x = 1073741824;
result = (x >> 0)
check = 1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 56: both arguments variables
x = 1073741825;
y = 0;
result = (x >> y);
check = 1073741825;
if(result != check) { fail(test, check, result); } ++test;
// Test 57: both arguments constants
result = (1073741825 >> 0)
check = 1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 58: LHS constant
y = 0;
result = (1073741825 >> y)
check = 1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 59: RHS constant
x = 1073741825;
result = (x >> 0)
check = 1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 60: both arguments variables
x = -1073741823;
y = 0;
result = (x >> y);
check = -1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 61: both arguments constants
result = (-1073741823 >> 0)
check = -1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 62: LHS constant
y = 0;
result = (-1073741823 >> y)
check = -1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 63: RHS constant
x = -1073741823;
result = (x >> 0)
check = -1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 64: both arguments variables
x = (-0x3fffffff-1);
y = 0;
result = (x >> y);
check = -1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 65: both arguments constants
result = ((-0x3fffffff-1) >> 0)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 66: LHS constant
y = 0;
result = ((-0x3fffffff-1) >> y)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 67: RHS constant
x = (-0x3fffffff-1);
result = (x >> 0)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 68: both arguments variables
x = -1073741825;
y = 0;
result = (x >> y);
check = -1073741825;
if(result != check) { fail(test, check, result); } ++test;
// Test 69: both arguments constants
result = (-1073741825 >> 0)
check = -1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 70: LHS constant
y = 0;
result = (-1073741825 >> y)
check = -1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 71: RHS constant
x = -1073741825;
result = (x >> 0)
check = -1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 72: both arguments variables
x = -1073741826;
y = 0;
result = (x >> y);
check = -1073741826;
if(result != check) { fail(test, check, result); } ++test;
// Test 73: both arguments constants
result = (-1073741826 >> 0)
check = -1073741826
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 74: LHS constant
y = 0;
result = (-1073741826 >> y)
check = -1073741826
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 75: RHS constant
x = -1073741826;
result = (x >> 0)
check = -1073741826
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 76: both arguments variables
x = 2147483646;
y = 0;
result = (x >> y);
check = 2147483646;
if(result != check) { fail(test, check, result); } ++test;
// Test 77: both arguments constants
result = (2147483646 >> 0)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 78: LHS constant
y = 0;
result = (2147483646 >> y)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 79: RHS constant
x = 2147483646;
result = (x >> 0)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 80: both arguments variables
x = 2147483647;
y = 0;
result = (x >> y);
check = 2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 81: both arguments constants
result = (2147483647 >> 0)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 82: LHS constant
y = 0;
result = (2147483647 >> y)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 83: RHS constant
x = 2147483647;
result = (x >> 0)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 84: both arguments variables
x = 2147483648;
y = 0;
result = (x >> y);
check = -2147483648;
if(result != check) { fail(test, check, result); } ++test;
// Test 85: both arguments constants
result = (2147483648 >> 0)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 86: LHS constant
y = 0;
result = (2147483648 >> y)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 87: RHS constant
x = 2147483648;
result = (x >> 0)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 88: both arguments variables
x = 2147483649;
y = 0;
result = (x >> y);
check = -2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 89: both arguments constants
result = (2147483649 >> 0)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 90: LHS constant
y = 0;
result = (2147483649 >> y)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 91: RHS constant
x = 2147483649;
result = (x >> 0)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 92: both arguments variables
x = -2147483647;
y = 0;
result = (x >> y);
check = -2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 93: both arguments constants
result = (-2147483647 >> 0)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 94: LHS constant
y = 0;
result = (-2147483647 >> y)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 95: RHS constant
x = -2147483647;
result = (x >> 0)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 96: both arguments variables
x = -2147483648;
y = 0;
result = (x >> y);
check = -2147483648;
if(result != check) { fail(test, check, result); } ++test;
// Test 97: both arguments constants
result = (-2147483648 >> 0)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 98: LHS constant
y = 0;
result = (-2147483648 >> y)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 99: RHS constant
x = -2147483648;
result = (x >> 0)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test1() {
var x;
var y;
var result;
var check;
// Test 100: both arguments variables
x = -2147483649;
y = 0;
result = (x >> y);
check = 2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 101: both arguments constants
result = (-2147483649 >> 0)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 102: LHS constant
y = 0;
result = (-2147483649 >> y)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 103: RHS constant
x = -2147483649;
result = (x >> 0)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 104: both arguments variables
x = -2147483650;
y = 0;
result = (x >> y);
check = 2147483646;
if(result != check) { fail(test, check, result); } ++test;
// Test 105: both arguments constants
result = (-2147483650 >> 0)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 106: LHS constant
y = 0;
result = (-2147483650 >> y)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 107: RHS constant
x = -2147483650;
result = (x >> 0)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 108: both arguments variables
x = 4294967295;
y = 0;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 109: both arguments constants
result = (4294967295 >> 0)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 110: LHS constant
y = 0;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 111: RHS constant
x = 4294967295;
result = (x >> 0)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 112: both arguments variables
x = 4294967296;
y = 0;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 113: both arguments constants
result = (4294967296 >> 0)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 114: LHS constant
y = 0;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 115: RHS constant
x = 4294967296;
result = (x >> 0)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 116: both arguments variables
x = -4294967295;
y = 0;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 117: both arguments constants
result = (-4294967295 >> 0)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 118: LHS constant
y = 0;
result = (-4294967295 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 119: RHS constant
x = -4294967295;
result = (x >> 0)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 120: both arguments variables
x = -4294967296;
y = 0;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 121: both arguments constants
result = (-4294967296 >> 0)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 122: LHS constant
y = 0;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 123: RHS constant
x = -4294967296;
result = (x >> 0)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 124: both arguments variables
x = 0;
y = 1;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 125: both arguments constants
result = (0 >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 126: LHS constant
y = 1;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 127: RHS constant
x = 0;
result = (x >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 128: both arguments variables
x = 1;
y = 1;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 129: both arguments constants
result = (1 >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 130: LHS constant
y = 1;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 131: RHS constant
x = 1;
result = (x >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 132: both arguments variables
x = -1;
y = 1;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 133: both arguments constants
result = (-1 >> 1)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 134: LHS constant
y = 1;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 135: RHS constant
x = -1;
result = (x >> 1)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 136: both arguments variables
x = 2;
y = 1;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 137: both arguments constants
result = (2 >> 1)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 138: LHS constant
y = 1;
result = (2 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 139: RHS constant
x = 2;
result = (x >> 1)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 140: both arguments variables
x = -2;
y = 1;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 141: both arguments constants
result = (-2 >> 1)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 142: LHS constant
y = 1;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 143: RHS constant
x = -2;
result = (x >> 1)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 144: both arguments variables
x = 3;
y = 1;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 145: both arguments constants
result = (3 >> 1)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 146: LHS constant
y = 1;
result = (3 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 147: RHS constant
x = 3;
result = (x >> 1)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 148: both arguments variables
x = -3;
y = 1;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 149: both arguments constants
result = (-3 >> 1)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 150: LHS constant
y = 1;
result = (-3 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 151: RHS constant
x = -3;
result = (x >> 1)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 152: both arguments variables
x = 4;
y = 1;
result = (x >> y);
check = 2;
if(result != check) { fail(test, check, result); } ++test;
// Test 153: both arguments constants
result = (4 >> 1)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 154: LHS constant
y = 1;
result = (4 >> y)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 155: RHS constant
x = 4;
result = (x >> 1)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 156: both arguments variables
x = -4;
y = 1;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 157: both arguments constants
result = (-4 >> 1)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 158: LHS constant
y = 1;
result = (-4 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 159: RHS constant
x = -4;
result = (x >> 1)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 160: both arguments variables
x = 8;
y = 1;
result = (x >> y);
check = 4;
if(result != check) { fail(test, check, result); } ++test;
// Test 161: both arguments constants
result = (8 >> 1)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 162: LHS constant
y = 1;
result = (8 >> y)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 163: RHS constant
x = 8;
result = (x >> 1)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 164: both arguments variables
x = -8;
y = 1;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 165: both arguments constants
result = (-8 >> 1)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 166: LHS constant
y = 1;
result = (-8 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 167: RHS constant
x = -8;
result = (x >> 1)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 168: both arguments variables
x = 1073741822;
y = 1;
result = (x >> y);
check = 536870911;
if(result != check) { fail(test, check, result); } ++test;
// Test 169: both arguments constants
result = (1073741822 >> 1)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 170: LHS constant
y = 1;
result = (1073741822 >> y)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 171: RHS constant
x = 1073741822;
result = (x >> 1)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 172: both arguments variables
x = 1073741823;
y = 1;
result = (x >> y);
check = 536870911;
if(result != check) { fail(test, check, result); } ++test;
// Test 173: both arguments constants
result = (1073741823 >> 1)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 174: LHS constant
y = 1;
result = (1073741823 >> y)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 175: RHS constant
x = 1073741823;
result = (x >> 1)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 176: both arguments variables
x = 1073741824;
y = 1;
result = (x >> y);
check = 536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 177: both arguments constants
result = (1073741824 >> 1)
check = 536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 178: LHS constant
y = 1;
result = (1073741824 >> y)
check = 536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 179: RHS constant
x = 1073741824;
result = (x >> 1)
check = 536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 180: both arguments variables
x = 1073741825;
y = 1;
result = (x >> y);
check = 536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 181: both arguments constants
result = (1073741825 >> 1)
check = 536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 182: LHS constant
y = 1;
result = (1073741825 >> y)
check = 536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 183: RHS constant
x = 1073741825;
result = (x >> 1)
check = 536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 184: both arguments variables
x = -1073741823;
y = 1;
result = (x >> y);
check = -536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 185: both arguments constants
result = (-1073741823 >> 1)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 186: LHS constant
y = 1;
result = (-1073741823 >> y)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 187: RHS constant
x = -1073741823;
result = (x >> 1)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 188: both arguments variables
x = (-0x3fffffff-1);
y = 1;
result = (x >> y);
check = -536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 189: both arguments constants
result = ((-0x3fffffff-1) >> 1)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 190: LHS constant
y = 1;
result = ((-0x3fffffff-1) >> y)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 191: RHS constant
x = (-0x3fffffff-1);
result = (x >> 1)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 192: both arguments variables
x = -1073741825;
y = 1;
result = (x >> y);
check = -536870913;
if(result != check) { fail(test, check, result); } ++test;
// Test 193: both arguments constants
result = (-1073741825 >> 1)
check = -536870913
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 194: LHS constant
y = 1;
result = (-1073741825 >> y)
check = -536870913
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 195: RHS constant
x = -1073741825;
result = (x >> 1)
check = -536870913
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 196: both arguments variables
x = -1073741826;
y = 1;
result = (x >> y);
check = -536870913;
if(result != check) { fail(test, check, result); } ++test;
// Test 197: both arguments constants
result = (-1073741826 >> 1)
check = -536870913
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 198: LHS constant
y = 1;
result = (-1073741826 >> y)
check = -536870913
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 199: RHS constant
x = -1073741826;
result = (x >> 1)
check = -536870913
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test2() {
var x;
var y;
var result;
var check;
// Test 200: both arguments variables
x = 2147483646;
y = 1;
result = (x >> y);
check = 1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 201: both arguments constants
result = (2147483646 >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 202: LHS constant
y = 1;
result = (2147483646 >> y)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 203: RHS constant
x = 2147483646;
result = (x >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 204: both arguments variables
x = 2147483647;
y = 1;
result = (x >> y);
check = 1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 205: both arguments constants
result = (2147483647 >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 206: LHS constant
y = 1;
result = (2147483647 >> y)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 207: RHS constant
x = 2147483647;
result = (x >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 208: both arguments variables
x = 2147483648;
y = 1;
result = (x >> y);
check = -1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 209: both arguments constants
result = (2147483648 >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 210: LHS constant
y = 1;
result = (2147483648 >> y)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 211: RHS constant
x = 2147483648;
result = (x >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 212: both arguments variables
x = 2147483649;
y = 1;
result = (x >> y);
check = -1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 213: both arguments constants
result = (2147483649 >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 214: LHS constant
y = 1;
result = (2147483649 >> y)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 215: RHS constant
x = 2147483649;
result = (x >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 216: both arguments variables
x = -2147483647;
y = 1;
result = (x >> y);
check = -1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 217: both arguments constants
result = (-2147483647 >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 218: LHS constant
y = 1;
result = (-2147483647 >> y)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 219: RHS constant
x = -2147483647;
result = (x >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 220: both arguments variables
x = -2147483648;
y = 1;
result = (x >> y);
check = -1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 221: both arguments constants
result = (-2147483648 >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 222: LHS constant
y = 1;
result = (-2147483648 >> y)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 223: RHS constant
x = -2147483648;
result = (x >> 1)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 224: both arguments variables
x = -2147483649;
y = 1;
result = (x >> y);
check = 1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 225: both arguments constants
result = (-2147483649 >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 226: LHS constant
y = 1;
result = (-2147483649 >> y)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 227: RHS constant
x = -2147483649;
result = (x >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 228: both arguments variables
x = -2147483650;
y = 1;
result = (x >> y);
check = 1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 229: both arguments constants
result = (-2147483650 >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 230: LHS constant
y = 1;
result = (-2147483650 >> y)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 231: RHS constant
x = -2147483650;
result = (x >> 1)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 232: both arguments variables
x = 4294967295;
y = 1;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 233: both arguments constants
result = (4294967295 >> 1)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 234: LHS constant
y = 1;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 235: RHS constant
x = 4294967295;
result = (x >> 1)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 236: both arguments variables
x = 4294967296;
y = 1;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 237: both arguments constants
result = (4294967296 >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 238: LHS constant
y = 1;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 239: RHS constant
x = 4294967296;
result = (x >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 240: both arguments variables
x = -4294967295;
y = 1;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 241: both arguments constants
result = (-4294967295 >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 242: LHS constant
y = 1;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 243: RHS constant
x = -4294967295;
result = (x >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 244: both arguments variables
x = -4294967296;
y = 1;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 245: both arguments constants
result = (-4294967296 >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 246: LHS constant
y = 1;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 247: RHS constant
x = -4294967296;
result = (x >> 1)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 248: both arguments variables
x = 0;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 249: both arguments constants
result = (0 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 250: LHS constant
y = 2;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 251: RHS constant
x = 0;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 252: both arguments variables
x = 1;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 253: both arguments constants
result = (1 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 254: LHS constant
y = 2;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 255: RHS constant
x = 1;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 256: both arguments variables
x = -1;
y = 2;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 257: both arguments constants
result = (-1 >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 258: LHS constant
y = 2;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 259: RHS constant
x = -1;
result = (x >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 260: both arguments variables
x = 2;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 261: both arguments constants
result = (2 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 262: LHS constant
y = 2;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 263: RHS constant
x = 2;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 264: both arguments variables
x = -2;
y = 2;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 265: both arguments constants
result = (-2 >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 266: LHS constant
y = 2;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 267: RHS constant
x = -2;
result = (x >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 268: both arguments variables
x = 3;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 269: both arguments constants
result = (3 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 270: LHS constant
y = 2;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 271: RHS constant
x = 3;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 272: both arguments variables
x = -3;
y = 2;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 273: both arguments constants
result = (-3 >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 274: LHS constant
y = 2;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 275: RHS constant
x = -3;
result = (x >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 276: both arguments variables
x = 4;
y = 2;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 277: both arguments constants
result = (4 >> 2)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 278: LHS constant
y = 2;
result = (4 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 279: RHS constant
x = 4;
result = (x >> 2)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 280: both arguments variables
x = -4;
y = 2;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 281: both arguments constants
result = (-4 >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 282: LHS constant
y = 2;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 283: RHS constant
x = -4;
result = (x >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 284: both arguments variables
x = 8;
y = 2;
result = (x >> y);
check = 2;
if(result != check) { fail(test, check, result); } ++test;
// Test 285: both arguments constants
result = (8 >> 2)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 286: LHS constant
y = 2;
result = (8 >> y)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 287: RHS constant
x = 8;
result = (x >> 2)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 288: both arguments variables
x = -8;
y = 2;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 289: both arguments constants
result = (-8 >> 2)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 290: LHS constant
y = 2;
result = (-8 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 291: RHS constant
x = -8;
result = (x >> 2)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 292: both arguments variables
x = 1073741822;
y = 2;
result = (x >> y);
check = 268435455;
if(result != check) { fail(test, check, result); } ++test;
// Test 293: both arguments constants
result = (1073741822 >> 2)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 294: LHS constant
y = 2;
result = (1073741822 >> y)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 295: RHS constant
x = 1073741822;
result = (x >> 2)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 296: both arguments variables
x = 1073741823;
y = 2;
result = (x >> y);
check = 268435455;
if(result != check) { fail(test, check, result); } ++test;
// Test 297: both arguments constants
result = (1073741823 >> 2)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 298: LHS constant
y = 2;
result = (1073741823 >> y)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 299: RHS constant
x = 1073741823;
result = (x >> 2)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test3() {
var x;
var y;
var result;
var check;
// Test 300: both arguments variables
x = 1073741824;
y = 2;
result = (x >> y);
check = 268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 301: both arguments constants
result = (1073741824 >> 2)
check = 268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 302: LHS constant
y = 2;
result = (1073741824 >> y)
check = 268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 303: RHS constant
x = 1073741824;
result = (x >> 2)
check = 268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 304: both arguments variables
x = 1073741825;
y = 2;
result = (x >> y);
check = 268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 305: both arguments constants
result = (1073741825 >> 2)
check = 268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 306: LHS constant
y = 2;
result = (1073741825 >> y)
check = 268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 307: RHS constant
x = 1073741825;
result = (x >> 2)
check = 268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 308: both arguments variables
x = -1073741823;
y = 2;
result = (x >> y);
check = -268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 309: both arguments constants
result = (-1073741823 >> 2)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 310: LHS constant
y = 2;
result = (-1073741823 >> y)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 311: RHS constant
x = -1073741823;
result = (x >> 2)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 312: both arguments variables
x = (-0x3fffffff-1);
y = 2;
result = (x >> y);
check = -268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 313: both arguments constants
result = ((-0x3fffffff-1) >> 2)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 314: LHS constant
y = 2;
result = ((-0x3fffffff-1) >> y)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 315: RHS constant
x = (-0x3fffffff-1);
result = (x >> 2)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 316: both arguments variables
x = -1073741825;
y = 2;
result = (x >> y);
check = -268435457;
if(result != check) { fail(test, check, result); } ++test;
// Test 317: both arguments constants
result = (-1073741825 >> 2)
check = -268435457
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 318: LHS constant
y = 2;
result = (-1073741825 >> y)
check = -268435457
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 319: RHS constant
x = -1073741825;
result = (x >> 2)
check = -268435457
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 320: both arguments variables
x = -1073741826;
y = 2;
result = (x >> y);
check = -268435457;
if(result != check) { fail(test, check, result); } ++test;
// Test 321: both arguments constants
result = (-1073741826 >> 2)
check = -268435457
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 322: LHS constant
y = 2;
result = (-1073741826 >> y)
check = -268435457
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 323: RHS constant
x = -1073741826;
result = (x >> 2)
check = -268435457
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 324: both arguments variables
x = 2147483646;
y = 2;
result = (x >> y);
check = 536870911;
if(result != check) { fail(test, check, result); } ++test;
// Test 325: both arguments constants
result = (2147483646 >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 326: LHS constant
y = 2;
result = (2147483646 >> y)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 327: RHS constant
x = 2147483646;
result = (x >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 328: both arguments variables
x = 2147483647;
y = 2;
result = (x >> y);
check = 536870911;
if(result != check) { fail(test, check, result); } ++test;
// Test 329: both arguments constants
result = (2147483647 >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 330: LHS constant
y = 2;
result = (2147483647 >> y)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 331: RHS constant
x = 2147483647;
result = (x >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 332: both arguments variables
x = 2147483648;
y = 2;
result = (x >> y);
check = -536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 333: both arguments constants
result = (2147483648 >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 334: LHS constant
y = 2;
result = (2147483648 >> y)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 335: RHS constant
x = 2147483648;
result = (x >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 336: both arguments variables
x = 2147483649;
y = 2;
result = (x >> y);
check = -536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 337: both arguments constants
result = (2147483649 >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 338: LHS constant
y = 2;
result = (2147483649 >> y)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 339: RHS constant
x = 2147483649;
result = (x >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 340: both arguments variables
x = -2147483647;
y = 2;
result = (x >> y);
check = -536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 341: both arguments constants
result = (-2147483647 >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 342: LHS constant
y = 2;
result = (-2147483647 >> y)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 343: RHS constant
x = -2147483647;
result = (x >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 344: both arguments variables
x = -2147483648;
y = 2;
result = (x >> y);
check = -536870912;
if(result != check) { fail(test, check, result); } ++test;
// Test 345: both arguments constants
result = (-2147483648 >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 346: LHS constant
y = 2;
result = (-2147483648 >> y)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 347: RHS constant
x = -2147483648;
result = (x >> 2)
check = -536870912
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 348: both arguments variables
x = -2147483649;
y = 2;
result = (x >> y);
check = 536870911;
if(result != check) { fail(test, check, result); } ++test;
// Test 349: both arguments constants
result = (-2147483649 >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 350: LHS constant
y = 2;
result = (-2147483649 >> y)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 351: RHS constant
x = -2147483649;
result = (x >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 352: both arguments variables
x = -2147483650;
y = 2;
result = (x >> y);
check = 536870911;
if(result != check) { fail(test, check, result); } ++test;
// Test 353: both arguments constants
result = (-2147483650 >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 354: LHS constant
y = 2;
result = (-2147483650 >> y)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 355: RHS constant
x = -2147483650;
result = (x >> 2)
check = 536870911
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 356: both arguments variables
x = 4294967295;
y = 2;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 357: both arguments constants
result = (4294967295 >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 358: LHS constant
y = 2;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 359: RHS constant
x = 4294967295;
result = (x >> 2)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 360: both arguments variables
x = 4294967296;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 361: both arguments constants
result = (4294967296 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 362: LHS constant
y = 2;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 363: RHS constant
x = 4294967296;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 364: both arguments variables
x = -4294967295;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 365: both arguments constants
result = (-4294967295 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 366: LHS constant
y = 2;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 367: RHS constant
x = -4294967295;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 368: both arguments variables
x = -4294967296;
y = 2;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 369: both arguments constants
result = (-4294967296 >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 370: LHS constant
y = 2;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 371: RHS constant
x = -4294967296;
result = (x >> 2)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 372: both arguments variables
x = 0;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 373: both arguments constants
result = (0 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 374: LHS constant
y = 3;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 375: RHS constant
x = 0;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 376: both arguments variables
x = 1;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 377: both arguments constants
result = (1 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 378: LHS constant
y = 3;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 379: RHS constant
x = 1;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 380: both arguments variables
x = -1;
y = 3;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 381: both arguments constants
result = (-1 >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 382: LHS constant
y = 3;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 383: RHS constant
x = -1;
result = (x >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 384: both arguments variables
x = 2;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 385: both arguments constants
result = (2 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 386: LHS constant
y = 3;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 387: RHS constant
x = 2;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 388: both arguments variables
x = -2;
y = 3;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 389: both arguments constants
result = (-2 >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 390: LHS constant
y = 3;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 391: RHS constant
x = -2;
result = (x >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 392: both arguments variables
x = 3;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 393: both arguments constants
result = (3 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 394: LHS constant
y = 3;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 395: RHS constant
x = 3;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 396: both arguments variables
x = -3;
y = 3;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 397: both arguments constants
result = (-3 >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 398: LHS constant
y = 3;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 399: RHS constant
x = -3;
result = (x >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test4() {
var x;
var y;
var result;
var check;
// Test 400: both arguments variables
x = 4;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 401: both arguments constants
result = (4 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 402: LHS constant
y = 3;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 403: RHS constant
x = 4;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 404: both arguments variables
x = -4;
y = 3;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 405: both arguments constants
result = (-4 >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 406: LHS constant
y = 3;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 407: RHS constant
x = -4;
result = (x >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 408: both arguments variables
x = 8;
y = 3;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 409: both arguments constants
result = (8 >> 3)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 410: LHS constant
y = 3;
result = (8 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 411: RHS constant
x = 8;
result = (x >> 3)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 412: both arguments variables
x = -8;
y = 3;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 413: both arguments constants
result = (-8 >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 414: LHS constant
y = 3;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 415: RHS constant
x = -8;
result = (x >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 416: both arguments variables
x = 1073741822;
y = 3;
result = (x >> y);
check = 134217727;
if(result != check) { fail(test, check, result); } ++test;
// Test 417: both arguments constants
result = (1073741822 >> 3)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 418: LHS constant
y = 3;
result = (1073741822 >> y)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 419: RHS constant
x = 1073741822;
result = (x >> 3)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 420: both arguments variables
x = 1073741823;
y = 3;
result = (x >> y);
check = 134217727;
if(result != check) { fail(test, check, result); } ++test;
// Test 421: both arguments constants
result = (1073741823 >> 3)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 422: LHS constant
y = 3;
result = (1073741823 >> y)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 423: RHS constant
x = 1073741823;
result = (x >> 3)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 424: both arguments variables
x = 1073741824;
y = 3;
result = (x >> y);
check = 134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 425: both arguments constants
result = (1073741824 >> 3)
check = 134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 426: LHS constant
y = 3;
result = (1073741824 >> y)
check = 134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 427: RHS constant
x = 1073741824;
result = (x >> 3)
check = 134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 428: both arguments variables
x = 1073741825;
y = 3;
result = (x >> y);
check = 134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 429: both arguments constants
result = (1073741825 >> 3)
check = 134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 430: LHS constant
y = 3;
result = (1073741825 >> y)
check = 134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 431: RHS constant
x = 1073741825;
result = (x >> 3)
check = 134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 432: both arguments variables
x = -1073741823;
y = 3;
result = (x >> y);
check = -134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 433: both arguments constants
result = (-1073741823 >> 3)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 434: LHS constant
y = 3;
result = (-1073741823 >> y)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 435: RHS constant
x = -1073741823;
result = (x >> 3)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 436: both arguments variables
x = (-0x3fffffff-1);
y = 3;
result = (x >> y);
check = -134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 437: both arguments constants
result = ((-0x3fffffff-1) >> 3)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 438: LHS constant
y = 3;
result = ((-0x3fffffff-1) >> y)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 439: RHS constant
x = (-0x3fffffff-1);
result = (x >> 3)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 440: both arguments variables
x = -1073741825;
y = 3;
result = (x >> y);
check = -134217729;
if(result != check) { fail(test, check, result); } ++test;
// Test 441: both arguments constants
result = (-1073741825 >> 3)
check = -134217729
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 442: LHS constant
y = 3;
result = (-1073741825 >> y)
check = -134217729
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 443: RHS constant
x = -1073741825;
result = (x >> 3)
check = -134217729
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 444: both arguments variables
x = -1073741826;
y = 3;
result = (x >> y);
check = -134217729;
if(result != check) { fail(test, check, result); } ++test;
// Test 445: both arguments constants
result = (-1073741826 >> 3)
check = -134217729
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 446: LHS constant
y = 3;
result = (-1073741826 >> y)
check = -134217729
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 447: RHS constant
x = -1073741826;
result = (x >> 3)
check = -134217729
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 448: both arguments variables
x = 2147483646;
y = 3;
result = (x >> y);
check = 268435455;
if(result != check) { fail(test, check, result); } ++test;
// Test 449: both arguments constants
result = (2147483646 >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 450: LHS constant
y = 3;
result = (2147483646 >> y)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 451: RHS constant
x = 2147483646;
result = (x >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 452: both arguments variables
x = 2147483647;
y = 3;
result = (x >> y);
check = 268435455;
if(result != check) { fail(test, check, result); } ++test;
// Test 453: both arguments constants
result = (2147483647 >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 454: LHS constant
y = 3;
result = (2147483647 >> y)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 455: RHS constant
x = 2147483647;
result = (x >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 456: both arguments variables
x = 2147483648;
y = 3;
result = (x >> y);
check = -268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 457: both arguments constants
result = (2147483648 >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 458: LHS constant
y = 3;
result = (2147483648 >> y)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 459: RHS constant
x = 2147483648;
result = (x >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 460: both arguments variables
x = 2147483649;
y = 3;
result = (x >> y);
check = -268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 461: both arguments constants
result = (2147483649 >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 462: LHS constant
y = 3;
result = (2147483649 >> y)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 463: RHS constant
x = 2147483649;
result = (x >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 464: both arguments variables
x = -2147483647;
y = 3;
result = (x >> y);
check = -268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 465: both arguments constants
result = (-2147483647 >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 466: LHS constant
y = 3;
result = (-2147483647 >> y)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 467: RHS constant
x = -2147483647;
result = (x >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 468: both arguments variables
x = -2147483648;
y = 3;
result = (x >> y);
check = -268435456;
if(result != check) { fail(test, check, result); } ++test;
// Test 469: both arguments constants
result = (-2147483648 >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 470: LHS constant
y = 3;
result = (-2147483648 >> y)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 471: RHS constant
x = -2147483648;
result = (x >> 3)
check = -268435456
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 472: both arguments variables
x = -2147483649;
y = 3;
result = (x >> y);
check = 268435455;
if(result != check) { fail(test, check, result); } ++test;
// Test 473: both arguments constants
result = (-2147483649 >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 474: LHS constant
y = 3;
result = (-2147483649 >> y)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 475: RHS constant
x = -2147483649;
result = (x >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 476: both arguments variables
x = -2147483650;
y = 3;
result = (x >> y);
check = 268435455;
if(result != check) { fail(test, check, result); } ++test;
// Test 477: both arguments constants
result = (-2147483650 >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 478: LHS constant
y = 3;
result = (-2147483650 >> y)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 479: RHS constant
x = -2147483650;
result = (x >> 3)
check = 268435455
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 480: both arguments variables
x = 4294967295;
y = 3;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 481: both arguments constants
result = (4294967295 >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 482: LHS constant
y = 3;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 483: RHS constant
x = 4294967295;
result = (x >> 3)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 484: both arguments variables
x = 4294967296;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 485: both arguments constants
result = (4294967296 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 486: LHS constant
y = 3;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 487: RHS constant
x = 4294967296;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 488: both arguments variables
x = -4294967295;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 489: both arguments constants
result = (-4294967295 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 490: LHS constant
y = 3;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 491: RHS constant
x = -4294967295;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 492: both arguments variables
x = -4294967296;
y = 3;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 493: both arguments constants
result = (-4294967296 >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 494: LHS constant
y = 3;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 495: RHS constant
x = -4294967296;
result = (x >> 3)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 496: both arguments variables
x = 0;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 497: both arguments constants
result = (0 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 498: LHS constant
y = 4;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 499: RHS constant
x = 0;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test5() {
var x;
var y;
var result;
var check;
// Test 500: both arguments variables
x = 1;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 501: both arguments constants
result = (1 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 502: LHS constant
y = 4;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 503: RHS constant
x = 1;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 504: both arguments variables
x = -1;
y = 4;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 505: both arguments constants
result = (-1 >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 506: LHS constant
y = 4;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 507: RHS constant
x = -1;
result = (x >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 508: both arguments variables
x = 2;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 509: both arguments constants
result = (2 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 510: LHS constant
y = 4;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 511: RHS constant
x = 2;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 512: both arguments variables
x = -2;
y = 4;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 513: both arguments constants
result = (-2 >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 514: LHS constant
y = 4;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 515: RHS constant
x = -2;
result = (x >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 516: both arguments variables
x = 3;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 517: both arguments constants
result = (3 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 518: LHS constant
y = 4;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 519: RHS constant
x = 3;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 520: both arguments variables
x = -3;
y = 4;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 521: both arguments constants
result = (-3 >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 522: LHS constant
y = 4;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 523: RHS constant
x = -3;
result = (x >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 524: both arguments variables
x = 4;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 525: both arguments constants
result = (4 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 526: LHS constant
y = 4;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 527: RHS constant
x = 4;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 528: both arguments variables
x = -4;
y = 4;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 529: both arguments constants
result = (-4 >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 530: LHS constant
y = 4;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 531: RHS constant
x = -4;
result = (x >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 532: both arguments variables
x = 8;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 533: both arguments constants
result = (8 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 534: LHS constant
y = 4;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 535: RHS constant
x = 8;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 536: both arguments variables
x = -8;
y = 4;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 537: both arguments constants
result = (-8 >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 538: LHS constant
y = 4;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 539: RHS constant
x = -8;
result = (x >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 540: both arguments variables
x = 1073741822;
y = 4;
result = (x >> y);
check = 67108863;
if(result != check) { fail(test, check, result); } ++test;
// Test 541: both arguments constants
result = (1073741822 >> 4)
check = 67108863
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 542: LHS constant
y = 4;
result = (1073741822 >> y)
check = 67108863
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 543: RHS constant
x = 1073741822;
result = (x >> 4)
check = 67108863
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 544: both arguments variables
x = 1073741823;
y = 4;
result = (x >> y);
check = 67108863;
if(result != check) { fail(test, check, result); } ++test;
// Test 545: both arguments constants
result = (1073741823 >> 4)
check = 67108863
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 546: LHS constant
y = 4;
result = (1073741823 >> y)
check = 67108863
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 547: RHS constant
x = 1073741823;
result = (x >> 4)
check = 67108863
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 548: both arguments variables
x = 1073741824;
y = 4;
result = (x >> y);
check = 67108864;
if(result != check) { fail(test, check, result); } ++test;
// Test 549: both arguments constants
result = (1073741824 >> 4)
check = 67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 550: LHS constant
y = 4;
result = (1073741824 >> y)
check = 67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 551: RHS constant
x = 1073741824;
result = (x >> 4)
check = 67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 552: both arguments variables
x = 1073741825;
y = 4;
result = (x >> y);
check = 67108864;
if(result != check) { fail(test, check, result); } ++test;
// Test 553: both arguments constants
result = (1073741825 >> 4)
check = 67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 554: LHS constant
y = 4;
result = (1073741825 >> y)
check = 67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 555: RHS constant
x = 1073741825;
result = (x >> 4)
check = 67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 556: both arguments variables
x = -1073741823;
y = 4;
result = (x >> y);
check = -67108864;
if(result != check) { fail(test, check, result); } ++test;
// Test 557: both arguments constants
result = (-1073741823 >> 4)
check = -67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 558: LHS constant
y = 4;
result = (-1073741823 >> y)
check = -67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 559: RHS constant
x = -1073741823;
result = (x >> 4)
check = -67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 560: both arguments variables
x = (-0x3fffffff-1);
y = 4;
result = (x >> y);
check = -67108864;
if(result != check) { fail(test, check, result); } ++test;
// Test 561: both arguments constants
result = ((-0x3fffffff-1) >> 4)
check = -67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 562: LHS constant
y = 4;
result = ((-0x3fffffff-1) >> y)
check = -67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 563: RHS constant
x = (-0x3fffffff-1);
result = (x >> 4)
check = -67108864
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 564: both arguments variables
x = -1073741825;
y = 4;
result = (x >> y);
check = -67108865;
if(result != check) { fail(test, check, result); } ++test;
// Test 565: both arguments constants
result = (-1073741825 >> 4)
check = -67108865
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 566: LHS constant
y = 4;
result = (-1073741825 >> y)
check = -67108865
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 567: RHS constant
x = -1073741825;
result = (x >> 4)
check = -67108865
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 568: both arguments variables
x = -1073741826;
y = 4;
result = (x >> y);
check = -67108865;
if(result != check) { fail(test, check, result); } ++test;
// Test 569: both arguments constants
result = (-1073741826 >> 4)
check = -67108865
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 570: LHS constant
y = 4;
result = (-1073741826 >> y)
check = -67108865
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 571: RHS constant
x = -1073741826;
result = (x >> 4)
check = -67108865
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 572: both arguments variables
x = 2147483646;
y = 4;
result = (x >> y);
check = 134217727;
if(result != check) { fail(test, check, result); } ++test;
// Test 573: both arguments constants
result = (2147483646 >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 574: LHS constant
y = 4;
result = (2147483646 >> y)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 575: RHS constant
x = 2147483646;
result = (x >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 576: both arguments variables
x = 2147483647;
y = 4;
result = (x >> y);
check = 134217727;
if(result != check) { fail(test, check, result); } ++test;
// Test 577: both arguments constants
result = (2147483647 >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 578: LHS constant
y = 4;
result = (2147483647 >> y)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 579: RHS constant
x = 2147483647;
result = (x >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 580: both arguments variables
x = 2147483648;
y = 4;
result = (x >> y);
check = -134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 581: both arguments constants
result = (2147483648 >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 582: LHS constant
y = 4;
result = (2147483648 >> y)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 583: RHS constant
x = 2147483648;
result = (x >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 584: both arguments variables
x = 2147483649;
y = 4;
result = (x >> y);
check = -134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 585: both arguments constants
result = (2147483649 >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 586: LHS constant
y = 4;
result = (2147483649 >> y)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 587: RHS constant
x = 2147483649;
result = (x >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 588: both arguments variables
x = -2147483647;
y = 4;
result = (x >> y);
check = -134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 589: both arguments constants
result = (-2147483647 >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 590: LHS constant
y = 4;
result = (-2147483647 >> y)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 591: RHS constant
x = -2147483647;
result = (x >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 592: both arguments variables
x = -2147483648;
y = 4;
result = (x >> y);
check = -134217728;
if(result != check) { fail(test, check, result); } ++test;
// Test 593: both arguments constants
result = (-2147483648 >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 594: LHS constant
y = 4;
result = (-2147483648 >> y)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 595: RHS constant
x = -2147483648;
result = (x >> 4)
check = -134217728
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 596: both arguments variables
x = -2147483649;
y = 4;
result = (x >> y);
check = 134217727;
if(result != check) { fail(test, check, result); } ++test;
// Test 597: both arguments constants
result = (-2147483649 >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 598: LHS constant
y = 4;
result = (-2147483649 >> y)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 599: RHS constant
x = -2147483649;
result = (x >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test6() {
var x;
var y;
var result;
var check;
// Test 600: both arguments variables
x = -2147483650;
y = 4;
result = (x >> y);
check = 134217727;
if(result != check) { fail(test, check, result); } ++test;
// Test 601: both arguments constants
result = (-2147483650 >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 602: LHS constant
y = 4;
result = (-2147483650 >> y)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 603: RHS constant
x = -2147483650;
result = (x >> 4)
check = 134217727
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 604: both arguments variables
x = 4294967295;
y = 4;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 605: both arguments constants
result = (4294967295 >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 606: LHS constant
y = 4;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 607: RHS constant
x = 4294967295;
result = (x >> 4)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 608: both arguments variables
x = 4294967296;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 609: both arguments constants
result = (4294967296 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 610: LHS constant
y = 4;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 611: RHS constant
x = 4294967296;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 612: both arguments variables
x = -4294967295;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 613: both arguments constants
result = (-4294967295 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 614: LHS constant
y = 4;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 615: RHS constant
x = -4294967295;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 616: both arguments variables
x = -4294967296;
y = 4;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 617: both arguments constants
result = (-4294967296 >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 618: LHS constant
y = 4;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 619: RHS constant
x = -4294967296;
result = (x >> 4)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 620: both arguments variables
x = 0;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 621: both arguments constants
result = (0 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 622: LHS constant
y = 7;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 623: RHS constant
x = 0;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 624: both arguments variables
x = 1;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 625: both arguments constants
result = (1 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 626: LHS constant
y = 7;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 627: RHS constant
x = 1;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 628: both arguments variables
x = -1;
y = 7;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 629: both arguments constants
result = (-1 >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 630: LHS constant
y = 7;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 631: RHS constant
x = -1;
result = (x >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 632: both arguments variables
x = 2;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 633: both arguments constants
result = (2 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 634: LHS constant
y = 7;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 635: RHS constant
x = 2;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 636: both arguments variables
x = -2;
y = 7;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 637: both arguments constants
result = (-2 >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 638: LHS constant
y = 7;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 639: RHS constant
x = -2;
result = (x >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 640: both arguments variables
x = 3;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 641: both arguments constants
result = (3 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 642: LHS constant
y = 7;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 643: RHS constant
x = 3;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 644: both arguments variables
x = -3;
y = 7;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 645: both arguments constants
result = (-3 >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 646: LHS constant
y = 7;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 647: RHS constant
x = -3;
result = (x >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 648: both arguments variables
x = 4;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 649: both arguments constants
result = (4 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 650: LHS constant
y = 7;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 651: RHS constant
x = 4;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 652: both arguments variables
x = -4;
y = 7;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 653: both arguments constants
result = (-4 >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 654: LHS constant
y = 7;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 655: RHS constant
x = -4;
result = (x >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 656: both arguments variables
x = 8;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 657: both arguments constants
result = (8 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 658: LHS constant
y = 7;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 659: RHS constant
x = 8;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 660: both arguments variables
x = -8;
y = 7;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 661: both arguments constants
result = (-8 >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 662: LHS constant
y = 7;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 663: RHS constant
x = -8;
result = (x >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 664: both arguments variables
x = 1073741822;
y = 7;
result = (x >> y);
check = 8388607;
if(result != check) { fail(test, check, result); } ++test;
// Test 665: both arguments constants
result = (1073741822 >> 7)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 666: LHS constant
y = 7;
result = (1073741822 >> y)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 667: RHS constant
x = 1073741822;
result = (x >> 7)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 668: both arguments variables
x = 1073741823;
y = 7;
result = (x >> y);
check = 8388607;
if(result != check) { fail(test, check, result); } ++test;
// Test 669: both arguments constants
result = (1073741823 >> 7)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 670: LHS constant
y = 7;
result = (1073741823 >> y)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 671: RHS constant
x = 1073741823;
result = (x >> 7)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 672: both arguments variables
x = 1073741824;
y = 7;
result = (x >> y);
check = 8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 673: both arguments constants
result = (1073741824 >> 7)
check = 8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 674: LHS constant
y = 7;
result = (1073741824 >> y)
check = 8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 675: RHS constant
x = 1073741824;
result = (x >> 7)
check = 8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 676: both arguments variables
x = 1073741825;
y = 7;
result = (x >> y);
check = 8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 677: both arguments constants
result = (1073741825 >> 7)
check = 8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 678: LHS constant
y = 7;
result = (1073741825 >> y)
check = 8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 679: RHS constant
x = 1073741825;
result = (x >> 7)
check = 8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 680: both arguments variables
x = -1073741823;
y = 7;
result = (x >> y);
check = -8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 681: both arguments constants
result = (-1073741823 >> 7)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 682: LHS constant
y = 7;
result = (-1073741823 >> y)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 683: RHS constant
x = -1073741823;
result = (x >> 7)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 684: both arguments variables
x = (-0x3fffffff-1);
y = 7;
result = (x >> y);
check = -8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 685: both arguments constants
result = ((-0x3fffffff-1) >> 7)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 686: LHS constant
y = 7;
result = ((-0x3fffffff-1) >> y)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 687: RHS constant
x = (-0x3fffffff-1);
result = (x >> 7)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 688: both arguments variables
x = -1073741825;
y = 7;
result = (x >> y);
check = -8388609;
if(result != check) { fail(test, check, result); } ++test;
// Test 689: both arguments constants
result = (-1073741825 >> 7)
check = -8388609
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 690: LHS constant
y = 7;
result = (-1073741825 >> y)
check = -8388609
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 691: RHS constant
x = -1073741825;
result = (x >> 7)
check = -8388609
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 692: both arguments variables
x = -1073741826;
y = 7;
result = (x >> y);
check = -8388609;
if(result != check) { fail(test, check, result); } ++test;
// Test 693: both arguments constants
result = (-1073741826 >> 7)
check = -8388609
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 694: LHS constant
y = 7;
result = (-1073741826 >> y)
check = -8388609
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 695: RHS constant
x = -1073741826;
result = (x >> 7)
check = -8388609
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 696: both arguments variables
x = 2147483646;
y = 7;
result = (x >> y);
check = 16777215;
if(result != check) { fail(test, check, result); } ++test;
// Test 697: both arguments constants
result = (2147483646 >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 698: LHS constant
y = 7;
result = (2147483646 >> y)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 699: RHS constant
x = 2147483646;
result = (x >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test7() {
var x;
var y;
var result;
var check;
// Test 700: both arguments variables
x = 2147483647;
y = 7;
result = (x >> y);
check = 16777215;
if(result != check) { fail(test, check, result); } ++test;
// Test 701: both arguments constants
result = (2147483647 >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 702: LHS constant
y = 7;
result = (2147483647 >> y)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 703: RHS constant
x = 2147483647;
result = (x >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 704: both arguments variables
x = 2147483648;
y = 7;
result = (x >> y);
check = -16777216;
if(result != check) { fail(test, check, result); } ++test;
// Test 705: both arguments constants
result = (2147483648 >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 706: LHS constant
y = 7;
result = (2147483648 >> y)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 707: RHS constant
x = 2147483648;
result = (x >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 708: both arguments variables
x = 2147483649;
y = 7;
result = (x >> y);
check = -16777216;
if(result != check) { fail(test, check, result); } ++test;
// Test 709: both arguments constants
result = (2147483649 >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 710: LHS constant
y = 7;
result = (2147483649 >> y)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 711: RHS constant
x = 2147483649;
result = (x >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 712: both arguments variables
x = -2147483647;
y = 7;
result = (x >> y);
check = -16777216;
if(result != check) { fail(test, check, result); } ++test;
// Test 713: both arguments constants
result = (-2147483647 >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 714: LHS constant
y = 7;
result = (-2147483647 >> y)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 715: RHS constant
x = -2147483647;
result = (x >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 716: both arguments variables
x = -2147483648;
y = 7;
result = (x >> y);
check = -16777216;
if(result != check) { fail(test, check, result); } ++test;
// Test 717: both arguments constants
result = (-2147483648 >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 718: LHS constant
y = 7;
result = (-2147483648 >> y)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 719: RHS constant
x = -2147483648;
result = (x >> 7)
check = -16777216
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 720: both arguments variables
x = -2147483649;
y = 7;
result = (x >> y);
check = 16777215;
if(result != check) { fail(test, check, result); } ++test;
// Test 721: both arguments constants
result = (-2147483649 >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 722: LHS constant
y = 7;
result = (-2147483649 >> y)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 723: RHS constant
x = -2147483649;
result = (x >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 724: both arguments variables
x = -2147483650;
y = 7;
result = (x >> y);
check = 16777215;
if(result != check) { fail(test, check, result); } ++test;
// Test 725: both arguments constants
result = (-2147483650 >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 726: LHS constant
y = 7;
result = (-2147483650 >> y)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 727: RHS constant
x = -2147483650;
result = (x >> 7)
check = 16777215
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 728: both arguments variables
x = 4294967295;
y = 7;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 729: both arguments constants
result = (4294967295 >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 730: LHS constant
y = 7;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 731: RHS constant
x = 4294967295;
result = (x >> 7)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 732: both arguments variables
x = 4294967296;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 733: both arguments constants
result = (4294967296 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 734: LHS constant
y = 7;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 735: RHS constant
x = 4294967296;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 736: both arguments variables
x = -4294967295;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 737: both arguments constants
result = (-4294967295 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 738: LHS constant
y = 7;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 739: RHS constant
x = -4294967295;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 740: both arguments variables
x = -4294967296;
y = 7;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 741: both arguments constants
result = (-4294967296 >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 742: LHS constant
y = 7;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 743: RHS constant
x = -4294967296;
result = (x >> 7)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 744: both arguments variables
x = 0;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 745: both arguments constants
result = (0 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 746: LHS constant
y = 8;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 747: RHS constant
x = 0;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 748: both arguments variables
x = 1;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 749: both arguments constants
result = (1 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 750: LHS constant
y = 8;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 751: RHS constant
x = 1;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 752: both arguments variables
x = -1;
y = 8;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 753: both arguments constants
result = (-1 >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 754: LHS constant
y = 8;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 755: RHS constant
x = -1;
result = (x >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 756: both arguments variables
x = 2;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 757: both arguments constants
result = (2 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 758: LHS constant
y = 8;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 759: RHS constant
x = 2;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 760: both arguments variables
x = -2;
y = 8;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 761: both arguments constants
result = (-2 >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 762: LHS constant
y = 8;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 763: RHS constant
x = -2;
result = (x >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 764: both arguments variables
x = 3;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 765: both arguments constants
result = (3 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 766: LHS constant
y = 8;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 767: RHS constant
x = 3;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 768: both arguments variables
x = -3;
y = 8;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 769: both arguments constants
result = (-3 >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 770: LHS constant
y = 8;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 771: RHS constant
x = -3;
result = (x >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 772: both arguments variables
x = 4;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 773: both arguments constants
result = (4 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 774: LHS constant
y = 8;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 775: RHS constant
x = 4;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 776: both arguments variables
x = -4;
y = 8;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 777: both arguments constants
result = (-4 >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 778: LHS constant
y = 8;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 779: RHS constant
x = -4;
result = (x >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 780: both arguments variables
x = 8;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 781: both arguments constants
result = (8 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 782: LHS constant
y = 8;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 783: RHS constant
x = 8;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 784: both arguments variables
x = -8;
y = 8;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 785: both arguments constants
result = (-8 >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 786: LHS constant
y = 8;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 787: RHS constant
x = -8;
result = (x >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 788: both arguments variables
x = 1073741822;
y = 8;
result = (x >> y);
check = 4194303;
if(result != check) { fail(test, check, result); } ++test;
// Test 789: both arguments constants
result = (1073741822 >> 8)
check = 4194303
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 790: LHS constant
y = 8;
result = (1073741822 >> y)
check = 4194303
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 791: RHS constant
x = 1073741822;
result = (x >> 8)
check = 4194303
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 792: both arguments variables
x = 1073741823;
y = 8;
result = (x >> y);
check = 4194303;
if(result != check) { fail(test, check, result); } ++test;
// Test 793: both arguments constants
result = (1073741823 >> 8)
check = 4194303
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 794: LHS constant
y = 8;
result = (1073741823 >> y)
check = 4194303
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 795: RHS constant
x = 1073741823;
result = (x >> 8)
check = 4194303
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 796: both arguments variables
x = 1073741824;
y = 8;
result = (x >> y);
check = 4194304;
if(result != check) { fail(test, check, result); } ++test;
// Test 797: both arguments constants
result = (1073741824 >> 8)
check = 4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 798: LHS constant
y = 8;
result = (1073741824 >> y)
check = 4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 799: RHS constant
x = 1073741824;
result = (x >> 8)
check = 4194304
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test8() {
var x;
var y;
var result;
var check;
// Test 800: both arguments variables
x = 1073741825;
y = 8;
result = (x >> y);
check = 4194304;
if(result != check) { fail(test, check, result); } ++test;
// Test 801: both arguments constants
result = (1073741825 >> 8)
check = 4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 802: LHS constant
y = 8;
result = (1073741825 >> y)
check = 4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 803: RHS constant
x = 1073741825;
result = (x >> 8)
check = 4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 804: both arguments variables
x = -1073741823;
y = 8;
result = (x >> y);
check = -4194304;
if(result != check) { fail(test, check, result); } ++test;
// Test 805: both arguments constants
result = (-1073741823 >> 8)
check = -4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 806: LHS constant
y = 8;
result = (-1073741823 >> y)
check = -4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 807: RHS constant
x = -1073741823;
result = (x >> 8)
check = -4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 808: both arguments variables
x = (-0x3fffffff-1);
y = 8;
result = (x >> y);
check = -4194304;
if(result != check) { fail(test, check, result); } ++test;
// Test 809: both arguments constants
result = ((-0x3fffffff-1) >> 8)
check = -4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 810: LHS constant
y = 8;
result = ((-0x3fffffff-1) >> y)
check = -4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 811: RHS constant
x = (-0x3fffffff-1);
result = (x >> 8)
check = -4194304
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 812: both arguments variables
x = -1073741825;
y = 8;
result = (x >> y);
check = -4194305;
if(result != check) { fail(test, check, result); } ++test;
// Test 813: both arguments constants
result = (-1073741825 >> 8)
check = -4194305
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 814: LHS constant
y = 8;
result = (-1073741825 >> y)
check = -4194305
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 815: RHS constant
x = -1073741825;
result = (x >> 8)
check = -4194305
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 816: both arguments variables
x = -1073741826;
y = 8;
result = (x >> y);
check = -4194305;
if(result != check) { fail(test, check, result); } ++test;
// Test 817: both arguments constants
result = (-1073741826 >> 8)
check = -4194305
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 818: LHS constant
y = 8;
result = (-1073741826 >> y)
check = -4194305
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 819: RHS constant
x = -1073741826;
result = (x >> 8)
check = -4194305
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 820: both arguments variables
x = 2147483646;
y = 8;
result = (x >> y);
check = 8388607;
if(result != check) { fail(test, check, result); } ++test;
// Test 821: both arguments constants
result = (2147483646 >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 822: LHS constant
y = 8;
result = (2147483646 >> y)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 823: RHS constant
x = 2147483646;
result = (x >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 824: both arguments variables
x = 2147483647;
y = 8;
result = (x >> y);
check = 8388607;
if(result != check) { fail(test, check, result); } ++test;
// Test 825: both arguments constants
result = (2147483647 >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 826: LHS constant
y = 8;
result = (2147483647 >> y)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 827: RHS constant
x = 2147483647;
result = (x >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 828: both arguments variables
x = 2147483648;
y = 8;
result = (x >> y);
check = -8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 829: both arguments constants
result = (2147483648 >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 830: LHS constant
y = 8;
result = (2147483648 >> y)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 831: RHS constant
x = 2147483648;
result = (x >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 832: both arguments variables
x = 2147483649;
y = 8;
result = (x >> y);
check = -8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 833: both arguments constants
result = (2147483649 >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 834: LHS constant
y = 8;
result = (2147483649 >> y)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 835: RHS constant
x = 2147483649;
result = (x >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 836: both arguments variables
x = -2147483647;
y = 8;
result = (x >> y);
check = -8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 837: both arguments constants
result = (-2147483647 >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 838: LHS constant
y = 8;
result = (-2147483647 >> y)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 839: RHS constant
x = -2147483647;
result = (x >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 840: both arguments variables
x = -2147483648;
y = 8;
result = (x >> y);
check = -8388608;
if(result != check) { fail(test, check, result); } ++test;
// Test 841: both arguments constants
result = (-2147483648 >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 842: LHS constant
y = 8;
result = (-2147483648 >> y)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 843: RHS constant
x = -2147483648;
result = (x >> 8)
check = -8388608
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 844: both arguments variables
x = -2147483649;
y = 8;
result = (x >> y);
check = 8388607;
if(result != check) { fail(test, check, result); } ++test;
// Test 845: both arguments constants
result = (-2147483649 >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 846: LHS constant
y = 8;
result = (-2147483649 >> y)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 847: RHS constant
x = -2147483649;
result = (x >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 848: both arguments variables
x = -2147483650;
y = 8;
result = (x >> y);
check = 8388607;
if(result != check) { fail(test, check, result); } ++test;
// Test 849: both arguments constants
result = (-2147483650 >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 850: LHS constant
y = 8;
result = (-2147483650 >> y)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 851: RHS constant
x = -2147483650;
result = (x >> 8)
check = 8388607
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 852: both arguments variables
x = 4294967295;
y = 8;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 853: both arguments constants
result = (4294967295 >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 854: LHS constant
y = 8;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 855: RHS constant
x = 4294967295;
result = (x >> 8)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 856: both arguments variables
x = 4294967296;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 857: both arguments constants
result = (4294967296 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 858: LHS constant
y = 8;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 859: RHS constant
x = 4294967296;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 860: both arguments variables
x = -4294967295;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 861: both arguments constants
result = (-4294967295 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 862: LHS constant
y = 8;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 863: RHS constant
x = -4294967295;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 864: both arguments variables
x = -4294967296;
y = 8;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 865: both arguments constants
result = (-4294967296 >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 866: LHS constant
y = 8;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 867: RHS constant
x = -4294967296;
result = (x >> 8)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 868: both arguments variables
x = 0;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 869: both arguments constants
result = (0 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 870: LHS constant
y = 15;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 871: RHS constant
x = 0;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 872: both arguments variables
x = 1;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 873: both arguments constants
result = (1 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 874: LHS constant
y = 15;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 875: RHS constant
x = 1;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 876: both arguments variables
x = -1;
y = 15;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 877: both arguments constants
result = (-1 >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 878: LHS constant
y = 15;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 879: RHS constant
x = -1;
result = (x >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 880: both arguments variables
x = 2;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 881: both arguments constants
result = (2 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 882: LHS constant
y = 15;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 883: RHS constant
x = 2;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 884: both arguments variables
x = -2;
y = 15;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 885: both arguments constants
result = (-2 >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 886: LHS constant
y = 15;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 887: RHS constant
x = -2;
result = (x >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 888: both arguments variables
x = 3;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 889: both arguments constants
result = (3 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 890: LHS constant
y = 15;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 891: RHS constant
x = 3;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 892: both arguments variables
x = -3;
y = 15;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 893: both arguments constants
result = (-3 >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 894: LHS constant
y = 15;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 895: RHS constant
x = -3;
result = (x >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 896: both arguments variables
x = 4;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 897: both arguments constants
result = (4 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 898: LHS constant
y = 15;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 899: RHS constant
x = 4;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test9() {
var x;
var y;
var result;
var check;
// Test 900: both arguments variables
x = -4;
y = 15;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 901: both arguments constants
result = (-4 >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 902: LHS constant
y = 15;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 903: RHS constant
x = -4;
result = (x >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 904: both arguments variables
x = 8;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 905: both arguments constants
result = (8 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 906: LHS constant
y = 15;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 907: RHS constant
x = 8;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 908: both arguments variables
x = -8;
y = 15;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 909: both arguments constants
result = (-8 >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 910: LHS constant
y = 15;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 911: RHS constant
x = -8;
result = (x >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 912: both arguments variables
x = 1073741822;
y = 15;
result = (x >> y);
check = 32767;
if(result != check) { fail(test, check, result); } ++test;
// Test 913: both arguments constants
result = (1073741822 >> 15)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 914: LHS constant
y = 15;
result = (1073741822 >> y)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 915: RHS constant
x = 1073741822;
result = (x >> 15)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 916: both arguments variables
x = 1073741823;
y = 15;
result = (x >> y);
check = 32767;
if(result != check) { fail(test, check, result); } ++test;
// Test 917: both arguments constants
result = (1073741823 >> 15)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 918: LHS constant
y = 15;
result = (1073741823 >> y)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 919: RHS constant
x = 1073741823;
result = (x >> 15)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 920: both arguments variables
x = 1073741824;
y = 15;
result = (x >> y);
check = 32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 921: both arguments constants
result = (1073741824 >> 15)
check = 32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 922: LHS constant
y = 15;
result = (1073741824 >> y)
check = 32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 923: RHS constant
x = 1073741824;
result = (x >> 15)
check = 32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 924: both arguments variables
x = 1073741825;
y = 15;
result = (x >> y);
check = 32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 925: both arguments constants
result = (1073741825 >> 15)
check = 32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 926: LHS constant
y = 15;
result = (1073741825 >> y)
check = 32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 927: RHS constant
x = 1073741825;
result = (x >> 15)
check = 32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 928: both arguments variables
x = -1073741823;
y = 15;
result = (x >> y);
check = -32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 929: both arguments constants
result = (-1073741823 >> 15)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 930: LHS constant
y = 15;
result = (-1073741823 >> y)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 931: RHS constant
x = -1073741823;
result = (x >> 15)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 932: both arguments variables
x = (-0x3fffffff-1);
y = 15;
result = (x >> y);
check = -32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 933: both arguments constants
result = ((-0x3fffffff-1) >> 15)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 934: LHS constant
y = 15;
result = ((-0x3fffffff-1) >> y)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 935: RHS constant
x = (-0x3fffffff-1);
result = (x >> 15)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 936: both arguments variables
x = -1073741825;
y = 15;
result = (x >> y);
check = -32769;
if(result != check) { fail(test, check, result); } ++test;
// Test 937: both arguments constants
result = (-1073741825 >> 15)
check = -32769
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 938: LHS constant
y = 15;
result = (-1073741825 >> y)
check = -32769
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 939: RHS constant
x = -1073741825;
result = (x >> 15)
check = -32769
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 940: both arguments variables
x = -1073741826;
y = 15;
result = (x >> y);
check = -32769;
if(result != check) { fail(test, check, result); } ++test;
// Test 941: both arguments constants
result = (-1073741826 >> 15)
check = -32769
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 942: LHS constant
y = 15;
result = (-1073741826 >> y)
check = -32769
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 943: RHS constant
x = -1073741826;
result = (x >> 15)
check = -32769
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 944: both arguments variables
x = 2147483646;
y = 15;
result = (x >> y);
check = 65535;
if(result != check) { fail(test, check, result); } ++test;
// Test 945: both arguments constants
result = (2147483646 >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 946: LHS constant
y = 15;
result = (2147483646 >> y)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 947: RHS constant
x = 2147483646;
result = (x >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 948: both arguments variables
x = 2147483647;
y = 15;
result = (x >> y);
check = 65535;
if(result != check) { fail(test, check, result); } ++test;
// Test 949: both arguments constants
result = (2147483647 >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 950: LHS constant
y = 15;
result = (2147483647 >> y)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 951: RHS constant
x = 2147483647;
result = (x >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 952: both arguments variables
x = 2147483648;
y = 15;
result = (x >> y);
check = -65536;
if(result != check) { fail(test, check, result); } ++test;
// Test 953: both arguments constants
result = (2147483648 >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 954: LHS constant
y = 15;
result = (2147483648 >> y)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 955: RHS constant
x = 2147483648;
result = (x >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 956: both arguments variables
x = 2147483649;
y = 15;
result = (x >> y);
check = -65536;
if(result != check) { fail(test, check, result); } ++test;
// Test 957: both arguments constants
result = (2147483649 >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 958: LHS constant
y = 15;
result = (2147483649 >> y)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 959: RHS constant
x = 2147483649;
result = (x >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 960: both arguments variables
x = -2147483647;
y = 15;
result = (x >> y);
check = -65536;
if(result != check) { fail(test, check, result); } ++test;
// Test 961: both arguments constants
result = (-2147483647 >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 962: LHS constant
y = 15;
result = (-2147483647 >> y)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 963: RHS constant
x = -2147483647;
result = (x >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 964: both arguments variables
x = -2147483648;
y = 15;
result = (x >> y);
check = -65536;
if(result != check) { fail(test, check, result); } ++test;
// Test 965: both arguments constants
result = (-2147483648 >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 966: LHS constant
y = 15;
result = (-2147483648 >> y)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 967: RHS constant
x = -2147483648;
result = (x >> 15)
check = -65536
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 968: both arguments variables
x = -2147483649;
y = 15;
result = (x >> y);
check = 65535;
if(result != check) { fail(test, check, result); } ++test;
// Test 969: both arguments constants
result = (-2147483649 >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 970: LHS constant
y = 15;
result = (-2147483649 >> y)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 971: RHS constant
x = -2147483649;
result = (x >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 972: both arguments variables
x = -2147483650;
y = 15;
result = (x >> y);
check = 65535;
if(result != check) { fail(test, check, result); } ++test;
// Test 973: both arguments constants
result = (-2147483650 >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 974: LHS constant
y = 15;
result = (-2147483650 >> y)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 975: RHS constant
x = -2147483650;
result = (x >> 15)
check = 65535
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 976: both arguments variables
x = 4294967295;
y = 15;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 977: both arguments constants
result = (4294967295 >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 978: LHS constant
y = 15;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 979: RHS constant
x = 4294967295;
result = (x >> 15)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 980: both arguments variables
x = 4294967296;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 981: both arguments constants
result = (4294967296 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 982: LHS constant
y = 15;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 983: RHS constant
x = 4294967296;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 984: both arguments variables
x = -4294967295;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 985: both arguments constants
result = (-4294967295 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 986: LHS constant
y = 15;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 987: RHS constant
x = -4294967295;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 988: both arguments variables
x = -4294967296;
y = 15;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 989: both arguments constants
result = (-4294967296 >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 990: LHS constant
y = 15;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 991: RHS constant
x = -4294967296;
result = (x >> 15)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 992: both arguments variables
x = 0;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 993: both arguments constants
result = (0 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 994: LHS constant
y = 16;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 995: RHS constant
x = 0;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 996: both arguments variables
x = 1;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 997: both arguments constants
result = (1 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 998: LHS constant
y = 16;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 999: RHS constant
x = 1;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test10() {
var x;
var y;
var result;
var check;
// Test 1000: both arguments variables
x = -1;
y = 16;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1001: both arguments constants
result = (-1 >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1002: LHS constant
y = 16;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1003: RHS constant
x = -1;
result = (x >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1004: both arguments variables
x = 2;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1005: both arguments constants
result = (2 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1006: LHS constant
y = 16;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1007: RHS constant
x = 2;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1008: both arguments variables
x = -2;
y = 16;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1009: both arguments constants
result = (-2 >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1010: LHS constant
y = 16;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1011: RHS constant
x = -2;
result = (x >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1012: both arguments variables
x = 3;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1013: both arguments constants
result = (3 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1014: LHS constant
y = 16;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1015: RHS constant
x = 3;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1016: both arguments variables
x = -3;
y = 16;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1017: both arguments constants
result = (-3 >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1018: LHS constant
y = 16;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1019: RHS constant
x = -3;
result = (x >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1020: both arguments variables
x = 4;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1021: both arguments constants
result = (4 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1022: LHS constant
y = 16;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1023: RHS constant
x = 4;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1024: both arguments variables
x = -4;
y = 16;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1025: both arguments constants
result = (-4 >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1026: LHS constant
y = 16;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1027: RHS constant
x = -4;
result = (x >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1028: both arguments variables
x = 8;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1029: both arguments constants
result = (8 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1030: LHS constant
y = 16;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1031: RHS constant
x = 8;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1032: both arguments variables
x = -8;
y = 16;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1033: both arguments constants
result = (-8 >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1034: LHS constant
y = 16;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1035: RHS constant
x = -8;
result = (x >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1036: both arguments variables
x = 1073741822;
y = 16;
result = (x >> y);
check = 16383;
if(result != check) { fail(test, check, result); } ++test;
// Test 1037: both arguments constants
result = (1073741822 >> 16)
check = 16383
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1038: LHS constant
y = 16;
result = (1073741822 >> y)
check = 16383
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1039: RHS constant
x = 1073741822;
result = (x >> 16)
check = 16383
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1040: both arguments variables
x = 1073741823;
y = 16;
result = (x >> y);
check = 16383;
if(result != check) { fail(test, check, result); } ++test;
// Test 1041: both arguments constants
result = (1073741823 >> 16)
check = 16383
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1042: LHS constant
y = 16;
result = (1073741823 >> y)
check = 16383
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1043: RHS constant
x = 1073741823;
result = (x >> 16)
check = 16383
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1044: both arguments variables
x = 1073741824;
y = 16;
result = (x >> y);
check = 16384;
if(result != check) { fail(test, check, result); } ++test;
// Test 1045: both arguments constants
result = (1073741824 >> 16)
check = 16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1046: LHS constant
y = 16;
result = (1073741824 >> y)
check = 16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1047: RHS constant
x = 1073741824;
result = (x >> 16)
check = 16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1048: both arguments variables
x = 1073741825;
y = 16;
result = (x >> y);
check = 16384;
if(result != check) { fail(test, check, result); } ++test;
// Test 1049: both arguments constants
result = (1073741825 >> 16)
check = 16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1050: LHS constant
y = 16;
result = (1073741825 >> y)
check = 16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1051: RHS constant
x = 1073741825;
result = (x >> 16)
check = 16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1052: both arguments variables
x = -1073741823;
y = 16;
result = (x >> y);
check = -16384;
if(result != check) { fail(test, check, result); } ++test;
// Test 1053: both arguments constants
result = (-1073741823 >> 16)
check = -16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1054: LHS constant
y = 16;
result = (-1073741823 >> y)
check = -16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1055: RHS constant
x = -1073741823;
result = (x >> 16)
check = -16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1056: both arguments variables
x = (-0x3fffffff-1);
y = 16;
result = (x >> y);
check = -16384;
if(result != check) { fail(test, check, result); } ++test;
// Test 1057: both arguments constants
result = ((-0x3fffffff-1) >> 16)
check = -16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1058: LHS constant
y = 16;
result = ((-0x3fffffff-1) >> y)
check = -16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1059: RHS constant
x = (-0x3fffffff-1);
result = (x >> 16)
check = -16384
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1060: both arguments variables
x = -1073741825;
y = 16;
result = (x >> y);
check = -16385;
if(result != check) { fail(test, check, result); } ++test;
// Test 1061: both arguments constants
result = (-1073741825 >> 16)
check = -16385
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1062: LHS constant
y = 16;
result = (-1073741825 >> y)
check = -16385
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1063: RHS constant
x = -1073741825;
result = (x >> 16)
check = -16385
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1064: both arguments variables
x = -1073741826;
y = 16;
result = (x >> y);
check = -16385;
if(result != check) { fail(test, check, result); } ++test;
// Test 1065: both arguments constants
result = (-1073741826 >> 16)
check = -16385
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1066: LHS constant
y = 16;
result = (-1073741826 >> y)
check = -16385
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1067: RHS constant
x = -1073741826;
result = (x >> 16)
check = -16385
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1068: both arguments variables
x = 2147483646;
y = 16;
result = (x >> y);
check = 32767;
if(result != check) { fail(test, check, result); } ++test;
// Test 1069: both arguments constants
result = (2147483646 >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1070: LHS constant
y = 16;
result = (2147483646 >> y)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1071: RHS constant
x = 2147483646;
result = (x >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1072: both arguments variables
x = 2147483647;
y = 16;
result = (x >> y);
check = 32767;
if(result != check) { fail(test, check, result); } ++test;
// Test 1073: both arguments constants
result = (2147483647 >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1074: LHS constant
y = 16;
result = (2147483647 >> y)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1075: RHS constant
x = 2147483647;
result = (x >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1076: both arguments variables
x = 2147483648;
y = 16;
result = (x >> y);
check = -32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 1077: both arguments constants
result = (2147483648 >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1078: LHS constant
y = 16;
result = (2147483648 >> y)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1079: RHS constant
x = 2147483648;
result = (x >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1080: both arguments variables
x = 2147483649;
y = 16;
result = (x >> y);
check = -32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 1081: both arguments constants
result = (2147483649 >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1082: LHS constant
y = 16;
result = (2147483649 >> y)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1083: RHS constant
x = 2147483649;
result = (x >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1084: both arguments variables
x = -2147483647;
y = 16;
result = (x >> y);
check = -32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 1085: both arguments constants
result = (-2147483647 >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1086: LHS constant
y = 16;
result = (-2147483647 >> y)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1087: RHS constant
x = -2147483647;
result = (x >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1088: both arguments variables
x = -2147483648;
y = 16;
result = (x >> y);
check = -32768;
if(result != check) { fail(test, check, result); } ++test;
// Test 1089: both arguments constants
result = (-2147483648 >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1090: LHS constant
y = 16;
result = (-2147483648 >> y)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1091: RHS constant
x = -2147483648;
result = (x >> 16)
check = -32768
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1092: both arguments variables
x = -2147483649;
y = 16;
result = (x >> y);
check = 32767;
if(result != check) { fail(test, check, result); } ++test;
// Test 1093: both arguments constants
result = (-2147483649 >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1094: LHS constant
y = 16;
result = (-2147483649 >> y)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1095: RHS constant
x = -2147483649;
result = (x >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1096: both arguments variables
x = -2147483650;
y = 16;
result = (x >> y);
check = 32767;
if(result != check) { fail(test, check, result); } ++test;
// Test 1097: both arguments constants
result = (-2147483650 >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1098: LHS constant
y = 16;
result = (-2147483650 >> y)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1099: RHS constant
x = -2147483650;
result = (x >> 16)
check = 32767
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test11() {
var x;
var y;
var result;
var check;
// Test 1100: both arguments variables
x = 4294967295;
y = 16;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1101: both arguments constants
result = (4294967295 >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1102: LHS constant
y = 16;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1103: RHS constant
x = 4294967295;
result = (x >> 16)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1104: both arguments variables
x = 4294967296;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1105: both arguments constants
result = (4294967296 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1106: LHS constant
y = 16;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1107: RHS constant
x = 4294967296;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1108: both arguments variables
x = -4294967295;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1109: both arguments constants
result = (-4294967295 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1110: LHS constant
y = 16;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1111: RHS constant
x = -4294967295;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1112: both arguments variables
x = -4294967296;
y = 16;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1113: both arguments constants
result = (-4294967296 >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1114: LHS constant
y = 16;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1115: RHS constant
x = -4294967296;
result = (x >> 16)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1116: both arguments variables
x = 0;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1117: both arguments constants
result = (0 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1118: LHS constant
y = 27;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1119: RHS constant
x = 0;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1120: both arguments variables
x = 1;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1121: both arguments constants
result = (1 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1122: LHS constant
y = 27;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1123: RHS constant
x = 1;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1124: both arguments variables
x = -1;
y = 27;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1125: both arguments constants
result = (-1 >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1126: LHS constant
y = 27;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1127: RHS constant
x = -1;
result = (x >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1128: both arguments variables
x = 2;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1129: both arguments constants
result = (2 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1130: LHS constant
y = 27;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1131: RHS constant
x = 2;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1132: both arguments variables
x = -2;
y = 27;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1133: both arguments constants
result = (-2 >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1134: LHS constant
y = 27;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1135: RHS constant
x = -2;
result = (x >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1136: both arguments variables
x = 3;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1137: both arguments constants
result = (3 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1138: LHS constant
y = 27;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1139: RHS constant
x = 3;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1140: both arguments variables
x = -3;
y = 27;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1141: both arguments constants
result = (-3 >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1142: LHS constant
y = 27;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1143: RHS constant
x = -3;
result = (x >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1144: both arguments variables
x = 4;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1145: both arguments constants
result = (4 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1146: LHS constant
y = 27;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1147: RHS constant
x = 4;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1148: both arguments variables
x = -4;
y = 27;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1149: both arguments constants
result = (-4 >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1150: LHS constant
y = 27;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1151: RHS constant
x = -4;
result = (x >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1152: both arguments variables
x = 8;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1153: both arguments constants
result = (8 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1154: LHS constant
y = 27;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1155: RHS constant
x = 8;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1156: both arguments variables
x = -8;
y = 27;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1157: both arguments constants
result = (-8 >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1158: LHS constant
y = 27;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1159: RHS constant
x = -8;
result = (x >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1160: both arguments variables
x = 1073741822;
y = 27;
result = (x >> y);
check = 7;
if(result != check) { fail(test, check, result); } ++test;
// Test 1161: both arguments constants
result = (1073741822 >> 27)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1162: LHS constant
y = 27;
result = (1073741822 >> y)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1163: RHS constant
x = 1073741822;
result = (x >> 27)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1164: both arguments variables
x = 1073741823;
y = 27;
result = (x >> y);
check = 7;
if(result != check) { fail(test, check, result); } ++test;
// Test 1165: both arguments constants
result = (1073741823 >> 27)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1166: LHS constant
y = 27;
result = (1073741823 >> y)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1167: RHS constant
x = 1073741823;
result = (x >> 27)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1168: both arguments variables
x = 1073741824;
y = 27;
result = (x >> y);
check = 8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1169: both arguments constants
result = (1073741824 >> 27)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1170: LHS constant
y = 27;
result = (1073741824 >> y)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1171: RHS constant
x = 1073741824;
result = (x >> 27)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1172: both arguments variables
x = 1073741825;
y = 27;
result = (x >> y);
check = 8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1173: both arguments constants
result = (1073741825 >> 27)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1174: LHS constant
y = 27;
result = (1073741825 >> y)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1175: RHS constant
x = 1073741825;
result = (x >> 27)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1176: both arguments variables
x = -1073741823;
y = 27;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1177: both arguments constants
result = (-1073741823 >> 27)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1178: LHS constant
y = 27;
result = (-1073741823 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1179: RHS constant
x = -1073741823;
result = (x >> 27)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1180: both arguments variables
x = (-0x3fffffff-1);
y = 27;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1181: both arguments constants
result = ((-0x3fffffff-1) >> 27)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1182: LHS constant
y = 27;
result = ((-0x3fffffff-1) >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1183: RHS constant
x = (-0x3fffffff-1);
result = (x >> 27)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1184: both arguments variables
x = -1073741825;
y = 27;
result = (x >> y);
check = -9;
if(result != check) { fail(test, check, result); } ++test;
// Test 1185: both arguments constants
result = (-1073741825 >> 27)
check = -9
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1186: LHS constant
y = 27;
result = (-1073741825 >> y)
check = -9
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1187: RHS constant
x = -1073741825;
result = (x >> 27)
check = -9
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1188: both arguments variables
x = -1073741826;
y = 27;
result = (x >> y);
check = -9;
if(result != check) { fail(test, check, result); } ++test;
// Test 1189: both arguments constants
result = (-1073741826 >> 27)
check = -9
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1190: LHS constant
y = 27;
result = (-1073741826 >> y)
check = -9
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1191: RHS constant
x = -1073741826;
result = (x >> 27)
check = -9
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1192: both arguments variables
x = 2147483646;
y = 27;
result = (x >> y);
check = 15;
if(result != check) { fail(test, check, result); } ++test;
// Test 1193: both arguments constants
result = (2147483646 >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1194: LHS constant
y = 27;
result = (2147483646 >> y)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1195: RHS constant
x = 2147483646;
result = (x >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1196: both arguments variables
x = 2147483647;
y = 27;
result = (x >> y);
check = 15;
if(result != check) { fail(test, check, result); } ++test;
// Test 1197: both arguments constants
result = (2147483647 >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1198: LHS constant
y = 27;
result = (2147483647 >> y)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1199: RHS constant
x = 2147483647;
result = (x >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test12() {
var x;
var y;
var result;
var check;
// Test 1200: both arguments variables
x = 2147483648;
y = 27;
result = (x >> y);
check = -16;
if(result != check) { fail(test, check, result); } ++test;
// Test 1201: both arguments constants
result = (2147483648 >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1202: LHS constant
y = 27;
result = (2147483648 >> y)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1203: RHS constant
x = 2147483648;
result = (x >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1204: both arguments variables
x = 2147483649;
y = 27;
result = (x >> y);
check = -16;
if(result != check) { fail(test, check, result); } ++test;
// Test 1205: both arguments constants
result = (2147483649 >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1206: LHS constant
y = 27;
result = (2147483649 >> y)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1207: RHS constant
x = 2147483649;
result = (x >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1208: both arguments variables
x = -2147483647;
y = 27;
result = (x >> y);
check = -16;
if(result != check) { fail(test, check, result); } ++test;
// Test 1209: both arguments constants
result = (-2147483647 >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1210: LHS constant
y = 27;
result = (-2147483647 >> y)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1211: RHS constant
x = -2147483647;
result = (x >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1212: both arguments variables
x = -2147483648;
y = 27;
result = (x >> y);
check = -16;
if(result != check) { fail(test, check, result); } ++test;
// Test 1213: both arguments constants
result = (-2147483648 >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1214: LHS constant
y = 27;
result = (-2147483648 >> y)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1215: RHS constant
x = -2147483648;
result = (x >> 27)
check = -16
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1216: both arguments variables
x = -2147483649;
y = 27;
result = (x >> y);
check = 15;
if(result != check) { fail(test, check, result); } ++test;
// Test 1217: both arguments constants
result = (-2147483649 >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1218: LHS constant
y = 27;
result = (-2147483649 >> y)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1219: RHS constant
x = -2147483649;
result = (x >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1220: both arguments variables
x = -2147483650;
y = 27;
result = (x >> y);
check = 15;
if(result != check) { fail(test, check, result); } ++test;
// Test 1221: both arguments constants
result = (-2147483650 >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1222: LHS constant
y = 27;
result = (-2147483650 >> y)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1223: RHS constant
x = -2147483650;
result = (x >> 27)
check = 15
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1224: both arguments variables
x = 4294967295;
y = 27;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1225: both arguments constants
result = (4294967295 >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1226: LHS constant
y = 27;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1227: RHS constant
x = 4294967295;
result = (x >> 27)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1228: both arguments variables
x = 4294967296;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1229: both arguments constants
result = (4294967296 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1230: LHS constant
y = 27;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1231: RHS constant
x = 4294967296;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1232: both arguments variables
x = -4294967295;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1233: both arguments constants
result = (-4294967295 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1234: LHS constant
y = 27;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1235: RHS constant
x = -4294967295;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1236: both arguments variables
x = -4294967296;
y = 27;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1237: both arguments constants
result = (-4294967296 >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1238: LHS constant
y = 27;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1239: RHS constant
x = -4294967296;
result = (x >> 27)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1240: both arguments variables
x = 0;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1241: both arguments constants
result = (0 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1242: LHS constant
y = 28;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1243: RHS constant
x = 0;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1244: both arguments variables
x = 1;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1245: both arguments constants
result = (1 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1246: LHS constant
y = 28;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1247: RHS constant
x = 1;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1248: both arguments variables
x = -1;
y = 28;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1249: both arguments constants
result = (-1 >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1250: LHS constant
y = 28;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1251: RHS constant
x = -1;
result = (x >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1252: both arguments variables
x = 2;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1253: both arguments constants
result = (2 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1254: LHS constant
y = 28;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1255: RHS constant
x = 2;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1256: both arguments variables
x = -2;
y = 28;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1257: both arguments constants
result = (-2 >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1258: LHS constant
y = 28;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1259: RHS constant
x = -2;
result = (x >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1260: both arguments variables
x = 3;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1261: both arguments constants
result = (3 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1262: LHS constant
y = 28;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1263: RHS constant
x = 3;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1264: both arguments variables
x = -3;
y = 28;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1265: both arguments constants
result = (-3 >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1266: LHS constant
y = 28;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1267: RHS constant
x = -3;
result = (x >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1268: both arguments variables
x = 4;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1269: both arguments constants
result = (4 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1270: LHS constant
y = 28;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1271: RHS constant
x = 4;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1272: both arguments variables
x = -4;
y = 28;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1273: both arguments constants
result = (-4 >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1274: LHS constant
y = 28;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1275: RHS constant
x = -4;
result = (x >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1276: both arguments variables
x = 8;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1277: both arguments constants
result = (8 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1278: LHS constant
y = 28;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1279: RHS constant
x = 8;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1280: both arguments variables
x = -8;
y = 28;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1281: both arguments constants
result = (-8 >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1282: LHS constant
y = 28;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1283: RHS constant
x = -8;
result = (x >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1284: both arguments variables
x = 1073741822;
y = 28;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1285: both arguments constants
result = (1073741822 >> 28)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1286: LHS constant
y = 28;
result = (1073741822 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1287: RHS constant
x = 1073741822;
result = (x >> 28)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1288: both arguments variables
x = 1073741823;
y = 28;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1289: both arguments constants
result = (1073741823 >> 28)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1290: LHS constant
y = 28;
result = (1073741823 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1291: RHS constant
x = 1073741823;
result = (x >> 28)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1292: both arguments variables
x = 1073741824;
y = 28;
result = (x >> y);
check = 4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1293: both arguments constants
result = (1073741824 >> 28)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1294: LHS constant
y = 28;
result = (1073741824 >> y)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1295: RHS constant
x = 1073741824;
result = (x >> 28)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1296: both arguments variables
x = 1073741825;
y = 28;
result = (x >> y);
check = 4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1297: both arguments constants
result = (1073741825 >> 28)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1298: LHS constant
y = 28;
result = (1073741825 >> y)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1299: RHS constant
x = 1073741825;
result = (x >> 28)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test13() {
var x;
var y;
var result;
var check;
// Test 1300: both arguments variables
x = -1073741823;
y = 28;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1301: both arguments constants
result = (-1073741823 >> 28)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1302: LHS constant
y = 28;
result = (-1073741823 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1303: RHS constant
x = -1073741823;
result = (x >> 28)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1304: both arguments variables
x = (-0x3fffffff-1);
y = 28;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1305: both arguments constants
result = ((-0x3fffffff-1) >> 28)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1306: LHS constant
y = 28;
result = ((-0x3fffffff-1) >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1307: RHS constant
x = (-0x3fffffff-1);
result = (x >> 28)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1308: both arguments variables
x = -1073741825;
y = 28;
result = (x >> y);
check = -5;
if(result != check) { fail(test, check, result); } ++test;
// Test 1309: both arguments constants
result = (-1073741825 >> 28)
check = -5
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1310: LHS constant
y = 28;
result = (-1073741825 >> y)
check = -5
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1311: RHS constant
x = -1073741825;
result = (x >> 28)
check = -5
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1312: both arguments variables
x = -1073741826;
y = 28;
result = (x >> y);
check = -5;
if(result != check) { fail(test, check, result); } ++test;
// Test 1313: both arguments constants
result = (-1073741826 >> 28)
check = -5
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1314: LHS constant
y = 28;
result = (-1073741826 >> y)
check = -5
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1315: RHS constant
x = -1073741826;
result = (x >> 28)
check = -5
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1316: both arguments variables
x = 2147483646;
y = 28;
result = (x >> y);
check = 7;
if(result != check) { fail(test, check, result); } ++test;
// Test 1317: both arguments constants
result = (2147483646 >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1318: LHS constant
y = 28;
result = (2147483646 >> y)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1319: RHS constant
x = 2147483646;
result = (x >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1320: both arguments variables
x = 2147483647;
y = 28;
result = (x >> y);
check = 7;
if(result != check) { fail(test, check, result); } ++test;
// Test 1321: both arguments constants
result = (2147483647 >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1322: LHS constant
y = 28;
result = (2147483647 >> y)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1323: RHS constant
x = 2147483647;
result = (x >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1324: both arguments variables
x = 2147483648;
y = 28;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1325: both arguments constants
result = (2147483648 >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1326: LHS constant
y = 28;
result = (2147483648 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1327: RHS constant
x = 2147483648;
result = (x >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1328: both arguments variables
x = 2147483649;
y = 28;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1329: both arguments constants
result = (2147483649 >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1330: LHS constant
y = 28;
result = (2147483649 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1331: RHS constant
x = 2147483649;
result = (x >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1332: both arguments variables
x = -2147483647;
y = 28;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1333: both arguments constants
result = (-2147483647 >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1334: LHS constant
y = 28;
result = (-2147483647 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1335: RHS constant
x = -2147483647;
result = (x >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1336: both arguments variables
x = -2147483648;
y = 28;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1337: both arguments constants
result = (-2147483648 >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1338: LHS constant
y = 28;
result = (-2147483648 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1339: RHS constant
x = -2147483648;
result = (x >> 28)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1340: both arguments variables
x = -2147483649;
y = 28;
result = (x >> y);
check = 7;
if(result != check) { fail(test, check, result); } ++test;
// Test 1341: both arguments constants
result = (-2147483649 >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1342: LHS constant
y = 28;
result = (-2147483649 >> y)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1343: RHS constant
x = -2147483649;
result = (x >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1344: both arguments variables
x = -2147483650;
y = 28;
result = (x >> y);
check = 7;
if(result != check) { fail(test, check, result); } ++test;
// Test 1345: both arguments constants
result = (-2147483650 >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1346: LHS constant
y = 28;
result = (-2147483650 >> y)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1347: RHS constant
x = -2147483650;
result = (x >> 28)
check = 7
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1348: both arguments variables
x = 4294967295;
y = 28;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1349: both arguments constants
result = (4294967295 >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1350: LHS constant
y = 28;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1351: RHS constant
x = 4294967295;
result = (x >> 28)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1352: both arguments variables
x = 4294967296;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1353: both arguments constants
result = (4294967296 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1354: LHS constant
y = 28;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1355: RHS constant
x = 4294967296;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1356: both arguments variables
x = -4294967295;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1357: both arguments constants
result = (-4294967295 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1358: LHS constant
y = 28;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1359: RHS constant
x = -4294967295;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1360: both arguments variables
x = -4294967296;
y = 28;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1361: both arguments constants
result = (-4294967296 >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1362: LHS constant
y = 28;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1363: RHS constant
x = -4294967296;
result = (x >> 28)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1364: both arguments variables
x = 0;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1365: both arguments constants
result = (0 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1366: LHS constant
y = 29;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1367: RHS constant
x = 0;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1368: both arguments variables
x = 1;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1369: both arguments constants
result = (1 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1370: LHS constant
y = 29;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1371: RHS constant
x = 1;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1372: both arguments variables
x = -1;
y = 29;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1373: both arguments constants
result = (-1 >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1374: LHS constant
y = 29;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1375: RHS constant
x = -1;
result = (x >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1376: both arguments variables
x = 2;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1377: both arguments constants
result = (2 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1378: LHS constant
y = 29;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1379: RHS constant
x = 2;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1380: both arguments variables
x = -2;
y = 29;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1381: both arguments constants
result = (-2 >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1382: LHS constant
y = 29;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1383: RHS constant
x = -2;
result = (x >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1384: both arguments variables
x = 3;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1385: both arguments constants
result = (3 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1386: LHS constant
y = 29;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1387: RHS constant
x = 3;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1388: both arguments variables
x = -3;
y = 29;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1389: both arguments constants
result = (-3 >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1390: LHS constant
y = 29;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1391: RHS constant
x = -3;
result = (x >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1392: both arguments variables
x = 4;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1393: both arguments constants
result = (4 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1394: LHS constant
y = 29;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1395: RHS constant
x = 4;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1396: both arguments variables
x = -4;
y = 29;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1397: both arguments constants
result = (-4 >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1398: LHS constant
y = 29;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1399: RHS constant
x = -4;
result = (x >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test14() {
var x;
var y;
var result;
var check;
// Test 1400: both arguments variables
x = 8;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1401: both arguments constants
result = (8 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1402: LHS constant
y = 29;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1403: RHS constant
x = 8;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1404: both arguments variables
x = -8;
y = 29;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1405: both arguments constants
result = (-8 >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1406: LHS constant
y = 29;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1407: RHS constant
x = -8;
result = (x >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1408: both arguments variables
x = 1073741822;
y = 29;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1409: both arguments constants
result = (1073741822 >> 29)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1410: LHS constant
y = 29;
result = (1073741822 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1411: RHS constant
x = 1073741822;
result = (x >> 29)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1412: both arguments variables
x = 1073741823;
y = 29;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1413: both arguments constants
result = (1073741823 >> 29)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1414: LHS constant
y = 29;
result = (1073741823 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1415: RHS constant
x = 1073741823;
result = (x >> 29)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1416: both arguments variables
x = 1073741824;
y = 29;
result = (x >> y);
check = 2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1417: both arguments constants
result = (1073741824 >> 29)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1418: LHS constant
y = 29;
result = (1073741824 >> y)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1419: RHS constant
x = 1073741824;
result = (x >> 29)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1420: both arguments variables
x = 1073741825;
y = 29;
result = (x >> y);
check = 2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1421: both arguments constants
result = (1073741825 >> 29)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1422: LHS constant
y = 29;
result = (1073741825 >> y)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1423: RHS constant
x = 1073741825;
result = (x >> 29)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1424: both arguments variables
x = -1073741823;
y = 29;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1425: both arguments constants
result = (-1073741823 >> 29)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1426: LHS constant
y = 29;
result = (-1073741823 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1427: RHS constant
x = -1073741823;
result = (x >> 29)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1428: both arguments variables
x = (-0x3fffffff-1);
y = 29;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1429: both arguments constants
result = ((-0x3fffffff-1) >> 29)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1430: LHS constant
y = 29;
result = ((-0x3fffffff-1) >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1431: RHS constant
x = (-0x3fffffff-1);
result = (x >> 29)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1432: both arguments variables
x = -1073741825;
y = 29;
result = (x >> y);
check = -3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1433: both arguments constants
result = (-1073741825 >> 29)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1434: LHS constant
y = 29;
result = (-1073741825 >> y)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1435: RHS constant
x = -1073741825;
result = (x >> 29)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1436: both arguments variables
x = -1073741826;
y = 29;
result = (x >> y);
check = -3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1437: both arguments constants
result = (-1073741826 >> 29)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1438: LHS constant
y = 29;
result = (-1073741826 >> y)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1439: RHS constant
x = -1073741826;
result = (x >> 29)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1440: both arguments variables
x = 2147483646;
y = 29;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1441: both arguments constants
result = (2147483646 >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1442: LHS constant
y = 29;
result = (2147483646 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1443: RHS constant
x = 2147483646;
result = (x >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1444: both arguments variables
x = 2147483647;
y = 29;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1445: both arguments constants
result = (2147483647 >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1446: LHS constant
y = 29;
result = (2147483647 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1447: RHS constant
x = 2147483647;
result = (x >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1448: both arguments variables
x = 2147483648;
y = 29;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1449: both arguments constants
result = (2147483648 >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1450: LHS constant
y = 29;
result = (2147483648 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1451: RHS constant
x = 2147483648;
result = (x >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1452: both arguments variables
x = 2147483649;
y = 29;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1453: both arguments constants
result = (2147483649 >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1454: LHS constant
y = 29;
result = (2147483649 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1455: RHS constant
x = 2147483649;
result = (x >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1456: both arguments variables
x = -2147483647;
y = 29;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1457: both arguments constants
result = (-2147483647 >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1458: LHS constant
y = 29;
result = (-2147483647 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1459: RHS constant
x = -2147483647;
result = (x >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1460: both arguments variables
x = -2147483648;
y = 29;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1461: both arguments constants
result = (-2147483648 >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1462: LHS constant
y = 29;
result = (-2147483648 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1463: RHS constant
x = -2147483648;
result = (x >> 29)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1464: both arguments variables
x = -2147483649;
y = 29;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1465: both arguments constants
result = (-2147483649 >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1466: LHS constant
y = 29;
result = (-2147483649 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1467: RHS constant
x = -2147483649;
result = (x >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1468: both arguments variables
x = -2147483650;
y = 29;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1469: both arguments constants
result = (-2147483650 >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1470: LHS constant
y = 29;
result = (-2147483650 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1471: RHS constant
x = -2147483650;
result = (x >> 29)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1472: both arguments variables
x = 4294967295;
y = 29;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1473: both arguments constants
result = (4294967295 >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1474: LHS constant
y = 29;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1475: RHS constant
x = 4294967295;
result = (x >> 29)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1476: both arguments variables
x = 4294967296;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1477: both arguments constants
result = (4294967296 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1478: LHS constant
y = 29;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1479: RHS constant
x = 4294967296;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1480: both arguments variables
x = -4294967295;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1481: both arguments constants
result = (-4294967295 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1482: LHS constant
y = 29;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1483: RHS constant
x = -4294967295;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1484: both arguments variables
x = -4294967296;
y = 29;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1485: both arguments constants
result = (-4294967296 >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1486: LHS constant
y = 29;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1487: RHS constant
x = -4294967296;
result = (x >> 29)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1488: both arguments variables
x = 0;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1489: both arguments constants
result = (0 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1490: LHS constant
y = 30;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1491: RHS constant
x = 0;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1492: both arguments variables
x = 1;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1493: both arguments constants
result = (1 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1494: LHS constant
y = 30;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1495: RHS constant
x = 1;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1496: both arguments variables
x = -1;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1497: both arguments constants
result = (-1 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1498: LHS constant
y = 30;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1499: RHS constant
x = -1;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test15() {
var x;
var y;
var result;
var check;
// Test 1500: both arguments variables
x = 2;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1501: both arguments constants
result = (2 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1502: LHS constant
y = 30;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1503: RHS constant
x = 2;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1504: both arguments variables
x = -2;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1505: both arguments constants
result = (-2 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1506: LHS constant
y = 30;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1507: RHS constant
x = -2;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1508: both arguments variables
x = 3;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1509: both arguments constants
result = (3 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1510: LHS constant
y = 30;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1511: RHS constant
x = 3;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1512: both arguments variables
x = -3;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1513: both arguments constants
result = (-3 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1514: LHS constant
y = 30;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1515: RHS constant
x = -3;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1516: both arguments variables
x = 4;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1517: both arguments constants
result = (4 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1518: LHS constant
y = 30;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1519: RHS constant
x = 4;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1520: both arguments variables
x = -4;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1521: both arguments constants
result = (-4 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1522: LHS constant
y = 30;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1523: RHS constant
x = -4;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1524: both arguments variables
x = 8;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1525: both arguments constants
result = (8 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1526: LHS constant
y = 30;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1527: RHS constant
x = 8;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1528: both arguments variables
x = -8;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1529: both arguments constants
result = (-8 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1530: LHS constant
y = 30;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1531: RHS constant
x = -8;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1532: both arguments variables
x = 1073741822;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1533: both arguments constants
result = (1073741822 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1534: LHS constant
y = 30;
result = (1073741822 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1535: RHS constant
x = 1073741822;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1536: both arguments variables
x = 1073741823;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1537: both arguments constants
result = (1073741823 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1538: LHS constant
y = 30;
result = (1073741823 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1539: RHS constant
x = 1073741823;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1540: both arguments variables
x = 1073741824;
y = 30;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1541: both arguments constants
result = (1073741824 >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1542: LHS constant
y = 30;
result = (1073741824 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1543: RHS constant
x = 1073741824;
result = (x >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1544: both arguments variables
x = 1073741825;
y = 30;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1545: both arguments constants
result = (1073741825 >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1546: LHS constant
y = 30;
result = (1073741825 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1547: RHS constant
x = 1073741825;
result = (x >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1548: both arguments variables
x = -1073741823;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1549: both arguments constants
result = (-1073741823 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1550: LHS constant
y = 30;
result = (-1073741823 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1551: RHS constant
x = -1073741823;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1552: both arguments variables
x = (-0x3fffffff-1);
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1553: both arguments constants
result = ((-0x3fffffff-1) >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1554: LHS constant
y = 30;
result = ((-0x3fffffff-1) >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1555: RHS constant
x = (-0x3fffffff-1);
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1556: both arguments variables
x = -1073741825;
y = 30;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1557: both arguments constants
result = (-1073741825 >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1558: LHS constant
y = 30;
result = (-1073741825 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1559: RHS constant
x = -1073741825;
result = (x >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1560: both arguments variables
x = -1073741826;
y = 30;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1561: both arguments constants
result = (-1073741826 >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1562: LHS constant
y = 30;
result = (-1073741826 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1563: RHS constant
x = -1073741826;
result = (x >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1564: both arguments variables
x = 2147483646;
y = 30;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1565: both arguments constants
result = (2147483646 >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1566: LHS constant
y = 30;
result = (2147483646 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1567: RHS constant
x = 2147483646;
result = (x >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1568: both arguments variables
x = 2147483647;
y = 30;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1569: both arguments constants
result = (2147483647 >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1570: LHS constant
y = 30;
result = (2147483647 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1571: RHS constant
x = 2147483647;
result = (x >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1572: both arguments variables
x = 2147483648;
y = 30;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1573: both arguments constants
result = (2147483648 >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1574: LHS constant
y = 30;
result = (2147483648 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1575: RHS constant
x = 2147483648;
result = (x >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1576: both arguments variables
x = 2147483649;
y = 30;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1577: both arguments constants
result = (2147483649 >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1578: LHS constant
y = 30;
result = (2147483649 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1579: RHS constant
x = 2147483649;
result = (x >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1580: both arguments variables
x = -2147483647;
y = 30;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1581: both arguments constants
result = (-2147483647 >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1582: LHS constant
y = 30;
result = (-2147483647 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1583: RHS constant
x = -2147483647;
result = (x >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1584: both arguments variables
x = -2147483648;
y = 30;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1585: both arguments constants
result = (-2147483648 >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1586: LHS constant
y = 30;
result = (-2147483648 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1587: RHS constant
x = -2147483648;
result = (x >> 30)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1588: both arguments variables
x = -2147483649;
y = 30;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1589: both arguments constants
result = (-2147483649 >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1590: LHS constant
y = 30;
result = (-2147483649 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1591: RHS constant
x = -2147483649;
result = (x >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1592: both arguments variables
x = -2147483650;
y = 30;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1593: both arguments constants
result = (-2147483650 >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1594: LHS constant
y = 30;
result = (-2147483650 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1595: RHS constant
x = -2147483650;
result = (x >> 30)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1596: both arguments variables
x = 4294967295;
y = 30;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1597: both arguments constants
result = (4294967295 >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1598: LHS constant
y = 30;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1599: RHS constant
x = 4294967295;
result = (x >> 30)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test16() {
var x;
var y;
var result;
var check;
// Test 1600: both arguments variables
x = 4294967296;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1601: both arguments constants
result = (4294967296 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1602: LHS constant
y = 30;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1603: RHS constant
x = 4294967296;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1604: both arguments variables
x = -4294967295;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1605: both arguments constants
result = (-4294967295 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1606: LHS constant
y = 30;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1607: RHS constant
x = -4294967295;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1608: both arguments variables
x = -4294967296;
y = 30;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1609: both arguments constants
result = (-4294967296 >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1610: LHS constant
y = 30;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1611: RHS constant
x = -4294967296;
result = (x >> 30)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1612: both arguments variables
x = 0;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1613: both arguments constants
result = (0 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1614: LHS constant
y = 31;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1615: RHS constant
x = 0;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1616: both arguments variables
x = 1;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1617: both arguments constants
result = (1 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1618: LHS constant
y = 31;
result = (1 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1619: RHS constant
x = 1;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1620: both arguments variables
x = -1;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1621: both arguments constants
result = (-1 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1622: LHS constant
y = 31;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1623: RHS constant
x = -1;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1624: both arguments variables
x = 2;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1625: both arguments constants
result = (2 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1626: LHS constant
y = 31;
result = (2 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1627: RHS constant
x = 2;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1628: both arguments variables
x = -2;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1629: both arguments constants
result = (-2 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1630: LHS constant
y = 31;
result = (-2 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1631: RHS constant
x = -2;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1632: both arguments variables
x = 3;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1633: both arguments constants
result = (3 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1634: LHS constant
y = 31;
result = (3 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1635: RHS constant
x = 3;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1636: both arguments variables
x = -3;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1637: both arguments constants
result = (-3 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1638: LHS constant
y = 31;
result = (-3 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1639: RHS constant
x = -3;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1640: both arguments variables
x = 4;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1641: both arguments constants
result = (4 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1642: LHS constant
y = 31;
result = (4 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1643: RHS constant
x = 4;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1644: both arguments variables
x = -4;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1645: both arguments constants
result = (-4 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1646: LHS constant
y = 31;
result = (-4 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1647: RHS constant
x = -4;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1648: both arguments variables
x = 8;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1649: both arguments constants
result = (8 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1650: LHS constant
y = 31;
result = (8 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1651: RHS constant
x = 8;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1652: both arguments variables
x = -8;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1653: both arguments constants
result = (-8 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1654: LHS constant
y = 31;
result = (-8 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1655: RHS constant
x = -8;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1656: both arguments variables
x = 1073741822;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1657: both arguments constants
result = (1073741822 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1658: LHS constant
y = 31;
result = (1073741822 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1659: RHS constant
x = 1073741822;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1660: both arguments variables
x = 1073741823;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1661: both arguments constants
result = (1073741823 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1662: LHS constant
y = 31;
result = (1073741823 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1663: RHS constant
x = 1073741823;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1664: both arguments variables
x = 1073741824;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1665: both arguments constants
result = (1073741824 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1666: LHS constant
y = 31;
result = (1073741824 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1667: RHS constant
x = 1073741824;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1668: both arguments variables
x = 1073741825;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1669: both arguments constants
result = (1073741825 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1670: LHS constant
y = 31;
result = (1073741825 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1671: RHS constant
x = 1073741825;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1672: both arguments variables
x = -1073741823;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1673: both arguments constants
result = (-1073741823 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1674: LHS constant
y = 31;
result = (-1073741823 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1675: RHS constant
x = -1073741823;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1676: both arguments variables
x = (-0x3fffffff-1);
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1677: both arguments constants
result = ((-0x3fffffff-1) >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1678: LHS constant
y = 31;
result = ((-0x3fffffff-1) >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1679: RHS constant
x = (-0x3fffffff-1);
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1680: both arguments variables
x = -1073741825;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1681: both arguments constants
result = (-1073741825 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1682: LHS constant
y = 31;
result = (-1073741825 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1683: RHS constant
x = -1073741825;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1684: both arguments variables
x = -1073741826;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1685: both arguments constants
result = (-1073741826 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1686: LHS constant
y = 31;
result = (-1073741826 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1687: RHS constant
x = -1073741826;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1688: both arguments variables
x = 2147483646;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1689: both arguments constants
result = (2147483646 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1690: LHS constant
y = 31;
result = (2147483646 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1691: RHS constant
x = 2147483646;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1692: both arguments variables
x = 2147483647;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1693: both arguments constants
result = (2147483647 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1694: LHS constant
y = 31;
result = (2147483647 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1695: RHS constant
x = 2147483647;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1696: both arguments variables
x = 2147483648;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1697: both arguments constants
result = (2147483648 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1698: LHS constant
y = 31;
result = (2147483648 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1699: RHS constant
x = 2147483648;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test17() {
var x;
var y;
var result;
var check;
// Test 1700: both arguments variables
x = 2147483649;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1701: both arguments constants
result = (2147483649 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1702: LHS constant
y = 31;
result = (2147483649 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1703: RHS constant
x = 2147483649;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1704: both arguments variables
x = -2147483647;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1705: both arguments constants
result = (-2147483647 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1706: LHS constant
y = 31;
result = (-2147483647 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1707: RHS constant
x = -2147483647;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1708: both arguments variables
x = -2147483648;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1709: both arguments constants
result = (-2147483648 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1710: LHS constant
y = 31;
result = (-2147483648 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1711: RHS constant
x = -2147483648;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1712: both arguments variables
x = -2147483649;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1713: both arguments constants
result = (-2147483649 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1714: LHS constant
y = 31;
result = (-2147483649 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1715: RHS constant
x = -2147483649;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1716: both arguments variables
x = -2147483650;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1717: both arguments constants
result = (-2147483650 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1718: LHS constant
y = 31;
result = (-2147483650 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1719: RHS constant
x = -2147483650;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1720: both arguments variables
x = 4294967295;
y = 31;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1721: both arguments constants
result = (4294967295 >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1722: LHS constant
y = 31;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1723: RHS constant
x = 4294967295;
result = (x >> 31)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1724: both arguments variables
x = 4294967296;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1725: both arguments constants
result = (4294967296 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1726: LHS constant
y = 31;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1727: RHS constant
x = 4294967296;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1728: both arguments variables
x = -4294967295;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1729: both arguments constants
result = (-4294967295 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1730: LHS constant
y = 31;
result = (-4294967295 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1731: RHS constant
x = -4294967295;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1732: both arguments variables
x = -4294967296;
y = 31;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1733: both arguments constants
result = (-4294967296 >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1734: LHS constant
y = 31;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1735: RHS constant
x = -4294967296;
result = (x >> 31)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1736: both arguments variables
x = 0;
y = 32;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1737: both arguments constants
result = (0 >> 32)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1738: LHS constant
y = 32;
result = (0 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1739: RHS constant
x = 0;
result = (x >> 32)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1740: both arguments variables
x = 1;
y = 32;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1741: both arguments constants
result = (1 >> 32)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1742: LHS constant
y = 32;
result = (1 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1743: RHS constant
x = 1;
result = (x >> 32)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1744: both arguments variables
x = -1;
y = 32;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1745: both arguments constants
result = (-1 >> 32)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1746: LHS constant
y = 32;
result = (-1 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1747: RHS constant
x = -1;
result = (x >> 32)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1748: both arguments variables
x = 2;
y = 32;
result = (x >> y);
check = 2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1749: both arguments constants
result = (2 >> 32)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1750: LHS constant
y = 32;
result = (2 >> y)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1751: RHS constant
x = 2;
result = (x >> 32)
check = 2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1752: both arguments variables
x = -2;
y = 32;
result = (x >> y);
check = -2;
if(result != check) { fail(test, check, result); } ++test;
// Test 1753: both arguments constants
result = (-2 >> 32)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1754: LHS constant
y = 32;
result = (-2 >> y)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1755: RHS constant
x = -2;
result = (x >> 32)
check = -2
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1756: both arguments variables
x = 3;
y = 32;
result = (x >> y);
check = 3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1757: both arguments constants
result = (3 >> 32)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1758: LHS constant
y = 32;
result = (3 >> y)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1759: RHS constant
x = 3;
result = (x >> 32)
check = 3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1760: both arguments variables
x = -3;
y = 32;
result = (x >> y);
check = -3;
if(result != check) { fail(test, check, result); } ++test;
// Test 1761: both arguments constants
result = (-3 >> 32)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1762: LHS constant
y = 32;
result = (-3 >> y)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1763: RHS constant
x = -3;
result = (x >> 32)
check = -3
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1764: both arguments variables
x = 4;
y = 32;
result = (x >> y);
check = 4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1765: both arguments constants
result = (4 >> 32)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1766: LHS constant
y = 32;
result = (4 >> y)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1767: RHS constant
x = 4;
result = (x >> 32)
check = 4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1768: both arguments variables
x = -4;
y = 32;
result = (x >> y);
check = -4;
if(result != check) { fail(test, check, result); } ++test;
// Test 1769: both arguments constants
result = (-4 >> 32)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1770: LHS constant
y = 32;
result = (-4 >> y)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1771: RHS constant
x = -4;
result = (x >> 32)
check = -4
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1772: both arguments variables
x = 8;
y = 32;
result = (x >> y);
check = 8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1773: both arguments constants
result = (8 >> 32)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1774: LHS constant
y = 32;
result = (8 >> y)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1775: RHS constant
x = 8;
result = (x >> 32)
check = 8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1776: both arguments variables
x = -8;
y = 32;
result = (x >> y);
check = -8;
if(result != check) { fail(test, check, result); } ++test;
// Test 1777: both arguments constants
result = (-8 >> 32)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1778: LHS constant
y = 32;
result = (-8 >> y)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1779: RHS constant
x = -8;
result = (x >> 32)
check = -8
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1780: both arguments variables
x = 1073741822;
y = 32;
result = (x >> y);
check = 1073741822;
if(result != check) { fail(test, check, result); } ++test;
// Test 1781: both arguments constants
result = (1073741822 >> 32)
check = 1073741822
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1782: LHS constant
y = 32;
result = (1073741822 >> y)
check = 1073741822
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1783: RHS constant
x = 1073741822;
result = (x >> 32)
check = 1073741822
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1784: both arguments variables
x = 1073741823;
y = 32;
result = (x >> y);
check = 1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 1785: both arguments constants
result = (1073741823 >> 32)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1786: LHS constant
y = 32;
result = (1073741823 >> y)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1787: RHS constant
x = 1073741823;
result = (x >> 32)
check = 1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1788: both arguments variables
x = 1073741824;
y = 32;
result = (x >> y);
check = 1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 1789: both arguments constants
result = (1073741824 >> 32)
check = 1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1790: LHS constant
y = 32;
result = (1073741824 >> y)
check = 1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1791: RHS constant
x = 1073741824;
result = (x >> 32)
check = 1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1792: both arguments variables
x = 1073741825;
y = 32;
result = (x >> y);
check = 1073741825;
if(result != check) { fail(test, check, result); } ++test;
// Test 1793: both arguments constants
result = (1073741825 >> 32)
check = 1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1794: LHS constant
y = 32;
result = (1073741825 >> y)
check = 1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1795: RHS constant
x = 1073741825;
result = (x >> 32)
check = 1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1796: both arguments variables
x = -1073741823;
y = 32;
result = (x >> y);
check = -1073741823;
if(result != check) { fail(test, check, result); } ++test;
// Test 1797: both arguments constants
result = (-1073741823 >> 32)
check = -1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1798: LHS constant
y = 32;
result = (-1073741823 >> y)
check = -1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1799: RHS constant
x = -1073741823;
result = (x >> 32)
check = -1073741823
if(result != check) {{ fail(test, check, result); }} ++test;
}
function test18() {
var x;
var y;
var result;
var check;
// Test 1800: both arguments variables
x = (-0x3fffffff-1);
y = 32;
result = (x >> y);
check = -1073741824;
if(result != check) { fail(test, check, result); } ++test;
// Test 1801: both arguments constants
result = ((-0x3fffffff-1) >> 32)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1802: LHS constant
y = 32;
result = ((-0x3fffffff-1) >> y)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1803: RHS constant
x = (-0x3fffffff-1);
result = (x >> 32)
check = -1073741824
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1804: both arguments variables
x = -1073741825;
y = 32;
result = (x >> y);
check = -1073741825;
if(result != check) { fail(test, check, result); } ++test;
// Test 1805: both arguments constants
result = (-1073741825 >> 32)
check = -1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1806: LHS constant
y = 32;
result = (-1073741825 >> y)
check = -1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1807: RHS constant
x = -1073741825;
result = (x >> 32)
check = -1073741825
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1808: both arguments variables
x = -1073741826;
y = 32;
result = (x >> y);
check = -1073741826;
if(result != check) { fail(test, check, result); } ++test;
// Test 1809: both arguments constants
result = (-1073741826 >> 32)
check = -1073741826
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1810: LHS constant
y = 32;
result = (-1073741826 >> y)
check = -1073741826
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1811: RHS constant
x = -1073741826;
result = (x >> 32)
check = -1073741826
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1812: both arguments variables
x = 2147483646;
y = 32;
result = (x >> y);
check = 2147483646;
if(result != check) { fail(test, check, result); } ++test;
// Test 1813: both arguments constants
result = (2147483646 >> 32)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1814: LHS constant
y = 32;
result = (2147483646 >> y)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1815: RHS constant
x = 2147483646;
result = (x >> 32)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1816: both arguments variables
x = 2147483647;
y = 32;
result = (x >> y);
check = 2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 1817: both arguments constants
result = (2147483647 >> 32)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1818: LHS constant
y = 32;
result = (2147483647 >> y)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1819: RHS constant
x = 2147483647;
result = (x >> 32)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1820: both arguments variables
x = 2147483648;
y = 32;
result = (x >> y);
check = -2147483648;
if(result != check) { fail(test, check, result); } ++test;
// Test 1821: both arguments constants
result = (2147483648 >> 32)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1822: LHS constant
y = 32;
result = (2147483648 >> y)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1823: RHS constant
x = 2147483648;
result = (x >> 32)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1824: both arguments variables
x = 2147483649;
y = 32;
result = (x >> y);
check = -2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 1825: both arguments constants
result = (2147483649 >> 32)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1826: LHS constant
y = 32;
result = (2147483649 >> y)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1827: RHS constant
x = 2147483649;
result = (x >> 32)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1828: both arguments variables
x = -2147483647;
y = 32;
result = (x >> y);
check = -2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 1829: both arguments constants
result = (-2147483647 >> 32)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1830: LHS constant
y = 32;
result = (-2147483647 >> y)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1831: RHS constant
x = -2147483647;
result = (x >> 32)
check = -2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1832: both arguments variables
x = -2147483648;
y = 32;
result = (x >> y);
check = -2147483648;
if(result != check) { fail(test, check, result); } ++test;
// Test 1833: both arguments constants
result = (-2147483648 >> 32)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1834: LHS constant
y = 32;
result = (-2147483648 >> y)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1835: RHS constant
x = -2147483648;
result = (x >> 32)
check = -2147483648
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1836: both arguments variables
x = -2147483649;
y = 32;
result = (x >> y);
check = 2147483647;
if(result != check) { fail(test, check, result); } ++test;
// Test 1837: both arguments constants
result = (-2147483649 >> 32)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1838: LHS constant
y = 32;
result = (-2147483649 >> y)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1839: RHS constant
x = -2147483649;
result = (x >> 32)
check = 2147483647
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1840: both arguments variables
x = -2147483650;
y = 32;
result = (x >> y);
check = 2147483646;
if(result != check) { fail(test, check, result); } ++test;
// Test 1841: both arguments constants
result = (-2147483650 >> 32)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1842: LHS constant
y = 32;
result = (-2147483650 >> y)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1843: RHS constant
x = -2147483650;
result = (x >> 32)
check = 2147483646
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1844: both arguments variables
x = 4294967295;
y = 32;
result = (x >> y);
check = -1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1845: both arguments constants
result = (4294967295 >> 32)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1846: LHS constant
y = 32;
result = (4294967295 >> y)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1847: RHS constant
x = 4294967295;
result = (x >> 32)
check = -1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1848: both arguments variables
x = 4294967296;
y = 32;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1849: both arguments constants
result = (4294967296 >> 32)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1850: LHS constant
y = 32;
result = (4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1851: RHS constant
x = 4294967296;
result = (x >> 32)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1852: both arguments variables
x = -4294967295;
y = 32;
result = (x >> y);
check = 1;
if(result != check) { fail(test, check, result); } ++test;
// Test 1853: both arguments constants
result = (-4294967295 >> 32)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1854: LHS constant
y = 32;
result = (-4294967295 >> y)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1855: RHS constant
x = -4294967295;
result = (x >> 32)
check = 1
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1856: both arguments variables
x = -4294967296;
y = 32;
result = (x >> y);
check = 0;
if(result != check) { fail(test, check, result); } ++test;
// Test 1857: both arguments constants
result = (-4294967296 >> 32)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1858: LHS constant
y = 32;
result = (-4294967296 >> y)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
// Test 1859: RHS constant
x = -4294967296;
result = (x >> 32)
check = 0
if(result != check) {{ fail(test, check, result); }} ++test;
}
test0();
test1();
test2();
test3();
test4();
test5();
test6();
test7();
test8();
test9();
test10();
test11();
test12();
test13();
test14();
test15();
test16();
test17();
test18();
WScript.Echo("done");
|
/*!
* node-feedparser
* Copyright(c) 2012 Dan MacTough <danmactough@gmail.com>
* MIT Licensed
*/
var feedparser = require(__dirname+'/..');
var req = {
uri: 'http://cyber.law.harvard.edu/rss/examples/rss2sample.xml',
headers: {
'If-Modified-Since': 'Fri, 06 Apr 2007 15:11:55 GMT',
'If-None-Match': '"d46a5b-9e0-42d731ba304c0"'
}
};
feedparser.parseUrl(req)
.on('response', function (response) {
console.log(response.statusCode);
});
|
import React from 'react'
import 'jquery-knob'
export default class Timepicker extends React.Component {
componentDidMount() {
$(this.refs.input).knob(this.props.options)
}
render() {
const {options, ...props} = {...this.props}
return (
<input type="text" ref="input" {...props}/>
)
}
} |
import Ember from 'ember';
import { moduleForComponent, test } from 'ember-qunit';
import { componentDisabledTest } from './-general-helpers';
moduleForComponent('mdl-radio', 'Unit | Component | mdl radio', {
// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
unit: true
});
test('it renders', function(assert) {
assert.expect(2);
// Creates the component instance
const component = this.subject();
assert.equal(component._state, 'preRender');
// Renders the component to the page
this.render();
assert.equal(component._state, 'inDOM');
});
test('Component disables properly', componentDisabledTest('input'));
test('checked property is set', function(assert) {
assert.expect(1);
// Creates the component instance
const component = this.subject({ checked: true });
// Renders the component to the page
this.render();
// Test the checked state
assert.equal(this.$('input').is(':checked'), true);
});
|
import { createSelector } from 'reselect';
const foo = createSelector(
getIds,
getObjects,
(ids, objects) => ids.map(id => objects[id])
);
const bar = createSelector(
[getIds, getObjects],
(ids, objects) => ids.map(id => objects[id])
);
|
'use strict';
angular.module("ngLocale", [], ["$provide", function ($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u03c0.\u03bc.",
"\u03bc.\u03bc."
],
"DAY": [
"\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae",
"\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1",
"\u03a4\u03c1\u03af\u03c4\u03b7",
"\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7",
"\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7",
"\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae",
"\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"
],
"MONTH": [
"\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5",
"\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5",
"\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5",
"\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5",
"\u039c\u03b1\u0390\u03bf\u03c5",
"\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5",
"\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5",
"\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5",
"\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5",
"\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5",
"\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5",
"\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5"
],
"SHORTDAY": [
"\u039a\u03c5\u03c1",
"\u0394\u03b5\u03c5",
"\u03a4\u03c1\u03b9",
"\u03a4\u03b5\u03c4",
"\u03a0\u03b5\u03bc",
"\u03a0\u03b1\u03c1",
"\u03a3\u03b1\u03b2"
],
"SHORTMONTH": [
"\u0399\u03b1\u03bd",
"\u03a6\u03b5\u03b2",
"\u039c\u03b1\u03c1",
"\u0391\u03c0\u03c1",
"\u039c\u03b1\u03ca",
"\u0399\u03bf\u03c5\u03bd",
"\u0399\u03bf\u03c5\u03bb",
"\u0391\u03c5\u03b3",
"\u03a3\u03b5\u03c0",
"\u039f\u03ba\u03c4",
"\u039d\u03bf\u03b5",
"\u0394\u03b5\u03ba"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "d/M/yy h:mm a",
"shortDate": "d/M/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "el",
"pluralCat": function (n) {
if (n == 1) {
return PLURAL_CATEGORY.ONE;
}
return PLURAL_CATEGORY.OTHER;
}
});
}]); |
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function(fun /*, thisArg */)
{
'use strict';
if (this === void 0 || this === null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (typeof fun !== "function") {
throw new TypeError();
}
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++) {
if (i in t) {
fun.call(thisArg, t[i], i, t);
}
}
};
} |
exports.rules = {
"import/no-extraneous-dependencies": [2, {"devDependencies": true}]
};
exports.env = {
mocha: true,
};
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
var models = require('./index');
var util = require('util');
/**
* @class
* Initializes a new instance of the ExpressRouteCircuitPeering class.
* @constructor
* Peering in a ExpressRouteCircuit resource
*
* @member {string} [peeringType] Gets or sets PeeringType. Possible values
* include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'
*
* @member {string} [state] Gets or sets state of Peering. Possible values
* include: 'Disabled', 'Enabled'
*
* @member {number} [azureASN] Gets or sets the azure ASN
*
* @member {number} [peerASN] Gets or sets the peer ASN
*
* @member {string} [primaryPeerAddressPrefix] Gets or sets the primary
* address prefix
*
* @member {string} [secondaryPeerAddressPrefix] Gets or sets the secondary
* address prefix
*
* @member {string} [primaryAzurePort] Gets or sets the primary port
*
* @member {string} [secondaryAzurePort] Gets or sets the secondary port
*
* @member {string} [sharedKey] Gets or sets the shared key
*
* @member {number} [vlanId] Gets or sets the vlan id
*
* @member {object} [microsoftPeeringConfig] Gets or sets the mircosoft
* peering config
*
* @member {array} [microsoftPeeringConfig.advertisedPublicPrefixes] Gets or
* sets the reference of AdvertisedPublicPrefixes
*
* @member {string} [microsoftPeeringConfig.advertisedPublicPrefixesState]
* Gets or sets AdvertisedPublicPrefixState of the Peering resource .
* Possible values include: 'NotConfigured', 'Configuring', 'Configured',
* 'ValidationNeeded'
*
* @member {number} [microsoftPeeringConfig.customerASN] Gets or Sets
* CustomerAsn of the peering.
*
* @member {string} [microsoftPeeringConfig.routingRegistryName] Gets or Sets
* RoutingRegistryName of the config.
*
* @member {object} [stats] Gets or peering stats
*
* @member {number} [stats.primarybytesIn] Gets BytesIn of the peering.
*
* @member {number} [stats.primarybytesOut] Gets BytesOut of the peering.
*
* @member {number} [stats.secondarybytesIn] Gets BytesIn of the peering.
*
* @member {number} [stats.secondarybytesOut] Gets BytesOut of the peering.
*
* @member {string} [provisioningState] Gets provisioning state of the
* PublicIP resource Updating/Deleting/Failed
*
* @member {string} [gatewayManagerEtag] Gets or sets the GatewayManager Etag
*
* @member {string} [lastModifiedBy] Gets whether the provider or the customer
* last modified the peering
*
* @member {string} [name] Gets name of the resource that is unique within a
* resource group. This name can be used to access the resource
*
* @member {string} [etag] A unique read-only string that changes whenever the
* resource is updated
*
*/
function ExpressRouteCircuitPeering() {
ExpressRouteCircuitPeering['super_'].call(this);
}
util.inherits(ExpressRouteCircuitPeering, models['SubResource']);
/**
* Defines the metadata of ExpressRouteCircuitPeering
*
* @returns {object} metadata of ExpressRouteCircuitPeering
*
*/
ExpressRouteCircuitPeering.prototype.mapper = function () {
return {
required: false,
serializedName: 'ExpressRouteCircuitPeering',
type: {
name: 'Composite',
className: 'ExpressRouteCircuitPeering',
modelProperties: {
id: {
required: false,
serializedName: 'id',
type: {
name: 'String'
}
},
peeringType: {
required: false,
serializedName: 'properties.peeringType',
type: {
name: 'String'
}
},
state: {
required: false,
serializedName: 'properties.state',
type: {
name: 'String'
}
},
azureASN: {
required: false,
serializedName: 'properties.azureASN',
type: {
name: 'Number'
}
},
peerASN: {
required: false,
serializedName: 'properties.peerASN',
type: {
name: 'Number'
}
},
primaryPeerAddressPrefix: {
required: false,
serializedName: 'properties.primaryPeerAddressPrefix',
type: {
name: 'String'
}
},
secondaryPeerAddressPrefix: {
required: false,
serializedName: 'properties.secondaryPeerAddressPrefix',
type: {
name: 'String'
}
},
primaryAzurePort: {
required: false,
serializedName: 'properties.primaryAzurePort',
type: {
name: 'String'
}
},
secondaryAzurePort: {
required: false,
serializedName: 'properties.secondaryAzurePort',
type: {
name: 'String'
}
},
sharedKey: {
required: false,
serializedName: 'properties.sharedKey',
type: {
name: 'String'
}
},
vlanId: {
required: false,
serializedName: 'properties.vlanId',
type: {
name: 'Number'
}
},
microsoftPeeringConfig: {
required: false,
serializedName: 'properties.microsoftPeeringConfig',
type: {
name: 'Composite',
className: 'ExpressRouteCircuitPeeringConfig'
}
},
stats: {
required: false,
serializedName: 'properties.stats',
type: {
name: 'Composite',
className: 'ExpressRouteCircuitStats'
}
},
provisioningState: {
required: false,
serializedName: 'properties.provisioningState',
type: {
name: 'String'
}
},
gatewayManagerEtag: {
required: false,
serializedName: 'properties.gatewayManagerEtag',
type: {
name: 'String'
}
},
lastModifiedBy: {
required: false,
serializedName: 'properties.lastModifiedBy',
type: {
name: 'String'
}
},
name: {
required: false,
serializedName: 'name',
type: {
name: 'String'
}
},
etag: {
required: false,
serializedName: 'etag',
type: {
name: 'String'
}
}
}
}
};
};
module.exports = ExpressRouteCircuitPeering;
|
import React from 'react';
import Loading from 'client/components/common/loading';
import moment from 'moment';
export default (props)=>{
return(
<div className="container-full" style={{ paddingTop: '60px'}}>
<div >
<div className="col-lg-12">
{
props.customer ?
<div className="hpanel blog-article-box">
<div className="panel-footer" style={styles.mLR15}>
<h2 style={styles.mLR15}>{props.customer.index}-{props.customer.title}</h2>
<hr />
<p style={styles.mLR15}>当前状态:{props.customer.schedule}</p>
<p style={styles.mLR15}>跟单人:{props.customer.salesName}</p>
<p style={styles.mLR15}>更新于 {showTimeAgo(props.customer.updatedAt||props.customer.createdAt)}</p>
<hr />
<h3 style={styles.mLR15}>{props.customer.project}</h3>
<p style={styles.mLR15}>项目描述:<br/> <textarea className="form-control" rows="3">{props.customer.desc}</textarea> </p>
<p style={styles.mLR15}>客户类别:{props.customer.category}</p>
<p style={styles.mLR15}>客户联系人:{props.customer.customerName}</p>
<hr />
<p style={styles.mLR15}>创建者:{props.customer.author}</p>
<p style={styles.mLR15}>创建于 {showPrettyTimestamp(props.customer.createdAt)}</p>
<p style={styles.mLR15}>签单金额:{props.customer.amount}元</p>
<br /><br />
</div>
</div> :
<Loading />
}
</div>
</div>
</div>
)
}
const styles = {
mLR15: {
marginLeft: '15px',
marginRight: '15px',
color: '#333333'
}
}
const showTimeAgo = function(date) {
return !date ? "" : moment(date).fromNow();
}
const showPrettyTimestamp = function(date) {
return !date ? "" : moment(date).format("MMMM Do YYYY, h:mm:ss a")
}
|
'use strict';
exports.hook_init_master = function (next) {
next();
};
|
var get = Ember.get;
var set = Ember.set;
var run = Ember.run;
var Person, store, env;
module("unit/model - DS.Model", {
setup: function() {
Person = DS.Model.extend({
name: DS.attr('string'),
isDrugAddict: DS.attr('boolean')
});
env = setupStore({
person: Person
});
store = env.store;
},
teardown: function() {
run(function() {
store.destroy();
});
Person = null;
store = null;
}
});
test("can have a property set on it", function() {
var record;
run(function() {
record = store.createRecord('person');
set(record, 'name', 'bar');
});
equal(get(record, 'name'), 'bar', "property was set on the record");
});
test("setting a property on a record that has not changed does not cause it to become dirty", function() {
expect(2);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.push({
data: {
type: 'person',
id: '1',
attributes: {
name: 'Peter',
isDrugAddict: true
}
}
});
store.findRecord('person', 1).then(function(person) {
equal(person.get('hasDirtyAttributes'), false, "precond - person record should not be dirty");
person.set('name', "Peter");
person.set('isDrugAddict', true);
equal(person.get('hasDirtyAttributes'), false, "record does not become dirty after setting property to old value");
});
});
});
test("resetting a property on a record cause it to become clean again", function() {
expect(3);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.push({
data: {
type: 'person',
id: '1',
attributes: {
name: 'Peter',
isDrugAddict: true
}
}
});
store.findRecord('person', 1).then(function(person) {
equal(person.get('hasDirtyAttributes'), false, "precond - person record should not be dirty");
person.set('isDrugAddict', false);
equal(person.get('hasDirtyAttributes'), true, "record becomes dirty after setting property to a new value");
person.set('isDrugAddict', true);
equal(person.get('hasDirtyAttributes'), false, "record becomes clean after resetting property to the old value");
});
});
});
test("a record becomes clean again only if all changed properties are reset", function() {
expect(5);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.push({
data: {
type: 'person',
id: '1',
attributes: {
name: 'Peter',
isDrugAddict: true
}
}
});
store.findRecord('person', 1).then(function(person) {
equal(person.get('hasDirtyAttributes'), false, "precond - person record should not be dirty");
person.set('isDrugAddict', false);
equal(person.get('hasDirtyAttributes'), true, "record becomes dirty after setting one property to a new value");
person.set('name', 'Mark');
equal(person.get('hasDirtyAttributes'), true, "record stays dirty after setting another property to a new value");
person.set('isDrugAddict', true);
equal(person.get('hasDirtyAttributes'), true, "record stays dirty after resetting only one property to the old value");
person.set('name', 'Peter');
equal(person.get('hasDirtyAttributes'), false, "record becomes clean after resetting both properties to the old value");
});
});
});
test("a record reports its unique id via the `id` property", function() {
expect(1);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.push({
data: {
type: 'person',
id: '1'
}
});
store.findRecord('person', 1).then(function(record) {
equal(get(record, 'id'), 1, "reports id as id by default");
});
});
});
test("a record's id is included in its toString representation", function() {
expect(1);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.push({
data: {
type: 'person',
id: '1'
}
});
store.findRecord('person', 1).then(function(record) {
equal(record.toString(), '<(subclass of DS.Model):'+Ember.guidFor(record)+':1>', "reports id in toString");
});
});
});
test("trying to set an `id` attribute should raise", function() {
Person = DS.Model.extend({
id: DS.attr('number'),
name: DS.attr('string')
});
var store = createStore({
person: Person
});
expectAssertion(function() {
run(function() {
store.push({
data: {
type: 'person',
id: '1',
attributes: {
name: 'Scumdale'
}
}
});
store.findRecord('person', 1);
});
}, /You may not set `id`/);
});
test("a collision of a record's id with object function's name", function() {
expect(1);
env.adapter.shouldBackgroundReloadRecord = () => false;
var hasWatchMethod = Object.prototype.watch;
try {
if (!hasWatchMethod) {
Object.prototype.watch = function() {};
}
run(function() {
store.push({
data: {
type: 'person',
id: 'watch'
}
});
store.findRecord('person', 'watch').then(function(record) {
equal(get(record, 'id'), 'watch', "record is successfully created and could be found by its id");
});
});
} finally {
if (!hasWatchMethod) {
delete Object.prototype.watch;
}
}
});
/*
test("it should use `_internalModel` and not `internalModel` to store its internalModel", function() {
expect(1);
run(function() {
store.push('person', { id: 1 });
store.findRecord(Person, 1).then(function(record) {
equal(record.get('_internalModel'), undefined, "doesn't shadow internalModel key");
});
});
});
*/
test("it should cache attributes", function() {
expect(2);
var Post = DS.Model.extend({
updatedAt: DS.attr('string')
});
var store = createStore({
post: Post
});
var dateString = "Sat, 31 Dec 2011 00:08:16 GMT";
var date = new Date(dateString);
run(function() {
store.push({
data: {
type: 'post',
id: '1'
}
});
store.findRecord('post', 1).then(function(record) {
run(function() {
record.set('updatedAt', date);
});
deepEqual(date, get(record, 'updatedAt'), "setting a date returns the same date");
strictEqual(get(record, 'updatedAt'), get(record, 'updatedAt'), "second get still returns the same object");
}).finally(function() {
run(store, 'destroy');
});
});
});
test("changedAttributes() return correct values", function() {
expect(4);
var Mascot = DS.Model.extend({
name: DS.attr('string'),
likes: DS.attr('string'),
isMascot: DS.attr('boolean')
});
var store = createStore({
mascot: Mascot
});
var mascot;
run(function() {
store.push({
data: {
type: 'mascot',
id: '1',
attributes: {
likes: 'JavaScript',
isMascot: true
}
}
});
mascot = store.peekRecord('mascot', 1);
});
equal(Object.keys(mascot.changedAttributes()).length, 0, 'there are no initial changes');
run(function() {
mascot.set('name', 'Tomster'); // new value
mascot.set('likes', 'Ember.js'); // changed value
mascot.set('isMascot', true); // same value
});
var changedAttributes = mascot.changedAttributes();
deepEqual(changedAttributes.name, [undefined, 'Tomster']);
deepEqual(changedAttributes.likes, ['JavaScript', 'Ember.js']);
run(function() {
mascot.rollbackAttributes();
});
equal(Object.keys(mascot.changedAttributes()).length, 0, 'after rollback attributes there are no changes');
});
test("changedAttributes() works while the record is being saved", function() {
expect(1);
var cat;
var adapter = DS.Adapter.extend({
createRecord(store, model, snapshot) {
deepEqual(cat.changedAttributes(), { name: [undefined, 'Argon'], likes: [undefined, 'Cheese'] });
return {};
}
});
var Mascot = DS.Model.extend({
name: DS.attr('string'),
likes: DS.attr('string'),
isMascot: DS.attr('boolean')
});
var store = createStore({
mascot: Mascot,
adapter: adapter
});
run(function() {
cat = store.createRecord('mascot');
cat.setProperties({ name: 'Argon', likes: 'Cheese' });
cat.save();
});
});
test("changedAttributes() works while the record is being updated", function() {
expect(1);
var cat;
var adapter = DS.Adapter.extend({
updateRecord(store, model, snapshot) {
deepEqual(cat.changedAttributes(), { name: ['Argon', 'Helia'], likes: ['Cheese', 'Mussels'] });
return { id: '1', type: 'mascot' };
}
});
var Mascot = DS.Model.extend({
name: DS.attr('string'),
likes: DS.attr('string'),
isMascot: DS.attr('boolean')
});
var store = createStore({
mascot: Mascot,
adapter: adapter
});
run(function() {
store.push({
data: {
type: 'mascot',
id: '1',
attributes: {
name: 'Argon',
likes: 'Cheese'
}
}
});
cat = store.peekRecord('mascot', 1);
cat.setProperties({ name: 'Helia', likes: 'Mussels' });
cat.save();
});
});
test("a DS.Model does not require an attribute type", function() {
var Tag = DS.Model.extend({
name: DS.attr()
});
var store = createStore({
tag: Tag
});
var tag;
run(function() {
tag = store.createRecord('tag', { name: "test" });
});
equal(get(tag, 'name'), "test", "the value is persisted");
});
test("a DS.Model can have a defaultValue without an attribute type", function() {
var Tag = DS.Model.extend({
name: DS.attr({ defaultValue: "unknown" })
});
var store = createStore({
tag: Tag
});
var tag;
run(function() {
tag = store.createRecord('tag');
});
equal(get(tag, 'name'), "unknown", "the default value is found");
});
test("Calling attr(), belongsTo() or hasMany() throws a warning", function() {
expect(3);
var Person = DS.Model.extend({
name: DS.attr('string')
});
var store = createStore({
person: Person
});
run(function() {
var person = store.createRecord('person', { id: 1, name: 'TomHuda' });
throws(function() {
person.attr();
}, /The `attr` method is not available on DS.Model, a DS.Snapshot was probably expected/, "attr() throws a warning");
throws(function() {
person.belongsTo();
}, /The `belongsTo` method is not available on DS.Model, a DS.Snapshot was probably expected/, "belongTo() throws a warning");
throws(function() {
person.hasMany();
}, /The `hasMany` method is not available on DS.Model, a DS.Snapshot was probably expected/, "hasMany() throws a warning");
});
});
test("supports pushedData in root.deleted.uncommitted", function() {
var record;
var hash = {
data: {
type: 'person',
id: '1'
}
};
run(function() {
record = store.push(hash);
record.deleteRecord();
store.push(hash);
equal(get(record, 'currentState.stateName'), 'root.deleted.uncommitted',
'record accepts pushedData is in root.deleted.uncommitted state');
});
});
test("currentState is accessible when the record is created", function() {
var record;
var hash = {
data: {
type: 'person',
id: '1'
}
};
run(function() {
record = store.push(hash);
equal(get(record, 'currentState.stateName'), 'root.loaded.saved',
'records pushed into the store start in the loaded state');
});
});
module("unit/model - DS.Model updating", {
setup: function() {
Person = DS.Model.extend({ name: DS.attr('string') });
env = setupStore({
person: Person
});
store = env.store;
run(function() {
store.push({
data: [{
type: 'person',
id: '1',
attributes: {
name: 'Scumbag Dale'
}
}, {
type: 'person',
id: '2',
attributes: {
name: 'Scumbag Katz'
}
}, {
type: 'person',
id: '3',
attributes: {
name: 'Scumbag Bryn'
}
}]
});
});
},
teardown: function() {
run(function() {
store.destroy();
Person = null;
store = null;
});
}
});
test("a DS.Model can update its attributes", function() {
expect(1);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.findRecord('person', 2).then(function(person) {
set(person, 'name', "Brohuda Katz");
equal(get(person, 'name'), "Brohuda Katz", "setting took hold");
});
});
});
test("a DS.Model can have a defaultValue", function() {
var Tag = DS.Model.extend({
name: DS.attr('string', { defaultValue: "unknown" })
});
var tag;
var store = createStore({
tag: Tag
});
run(function() {
tag = store.createRecord('tag');
});
equal(get(tag, 'name'), "unknown", "the default value is found");
run(function() {
set(tag, 'name', null);
});
equal(get(tag, 'name'), null, "null doesn't shadow defaultValue");
});
test("a DS.model can define 'setUnknownProperty'", function() {
var tag;
var Tag = DS.Model.extend({
name: DS.attr("string"),
setUnknownProperty: function(key, value) {
if (key === "title") {
this.set("name", value);
}
}
});
var store = createStore({
tag: Tag
});
run(function() {
tag = store.createRecord('tag', { name: "old" });
set(tag, "title", "new");
});
equal(get(tag, "name"), "new", "setUnknownProperty not triggered");
});
test("a defaultValue for an attribute can be a function", function() {
var Tag = DS.Model.extend({
createdAt: DS.attr('string', {
defaultValue: function() {
return "le default value";
}
})
});
var tag;
var store = createStore({
tag: Tag
});
run(function() {
tag = store.createRecord('tag');
});
equal(get(tag, 'createdAt'), "le default value", "the defaultValue function is evaluated");
});
test("a defaultValue function gets the record, options, and key", function() {
expect(2);
var Tag = DS.Model.extend({
createdAt: DS.attr('string', {
defaultValue: function(record, options, key) {
deepEqual(record, tag, "the record is passed in properly");
equal(key, 'createdAt', "the attribute being defaulted is passed in properly");
return "le default value";
}
})
});
var store = createStore({
tag: Tag
});
var tag;
run(function() {
tag = store.createRecord('tag');
});
get(tag, 'createdAt');
});
test("setting a property to undefined on a newly created record should not impact the current state", function() {
var Tag = DS.Model.extend({
name: DS.attr('string')
});
var store = createStore({
tag: Tag
});
var tag;
run(function() {
tag = store.createRecord('tag');
set(tag, 'name', 'testing');
set(tag, 'name', undefined);
});
equal(get(tag, 'currentState.stateName'), "root.loaded.created.uncommitted");
run(function() {
tag = store.createRecord('tag', { name: undefined });
});
equal(get(tag, 'currentState.stateName'), "root.loaded.created.uncommitted");
});
// NOTE: this is a 'backdoor' test that ensures internal consistency, and should be
// thrown out if/when the current `_attributes` hash logic is removed.
test("setting a property back to its original value removes the property from the `_attributes` hash", function() {
expect(3);
env.adapter.shouldBackgroundReloadRecord = () => false;
run(function() {
store.findRecord('person', 1).then(function(person) {
equal(person._internalModel._attributes.name, undefined, "the `_attributes` hash is clean");
set(person, 'name', "Niceguy Dale");
equal(person._internalModel._attributes.name, "Niceguy Dale", "the `_attributes` hash contains the changed value");
set(person, 'name', "Scumbag Dale");
equal(person._internalModel._attributes.name, undefined, "the `_attributes` hash is reset");
});
});
});
module("unit/model - with a simple Person model", {
setup: function() {
Person = DS.Model.extend({
name: DS.attr('string')
});
store = createStore({
person: Person
});
run(function() {
store.push({
data: [{
type: 'person',
id: '1',
attributes: {
name: 'Scumbag Dale'
}
}, {
type: 'person',
id: '2',
attributes: {
name: 'Scumbag Katz'
}
}, {
type: 'person',
id: '3',
attributes: {
name: 'Scumbag Bryn'
}
}]
});
});
},
teardown: function() {
run(function() {
store.destroy();
Person = null;
store = null;
});
}
});
test("can ask if record with a given id is loaded", function() {
equal(store.recordIsLoaded('person', 1), true, 'should have person with id 1');
equal(store.recordIsLoaded('person', 1), true, 'should have person with id 1');
equal(store.recordIsLoaded('person', 4), false, 'should not have person with id 4');
equal(store.recordIsLoaded('person', 4), false, 'should not have person with id 4');
});
test("a listener can be added to a record", function() {
var count = 0;
var F = function() { count++; };
var record;
run(function() {
record = store.createRecord('person');
});
record.on('event!', F);
run(function() {
record.trigger('event!');
});
equal(count, 1, "the event was triggered");
run(function() {
record.trigger('event!');
});
equal(count, 2, "the event was triggered");
});
test("when an event is triggered on a record the method with the same name is invoked with arguments", function() {
var count = 0;
var F = function() { count++; };
var record;
run(function() {
record = store.createRecord('person');
});
record.eventNamedMethod = F;
run(function() {
record.trigger('eventNamedMethod');
});
equal(count, 1, "the corresponding method was called");
});
test("when a method is invoked from an event with the same name the arguments are passed through", function() {
var eventMethodArgs = null;
var F = function() {
eventMethodArgs = arguments;
};
var record;
run(function() {
record = store.createRecord('person');
});
record.eventThatTriggersMethod = F;
run(function() {
record.trigger('eventThatTriggersMethod', 1, 2);
});
equal(eventMethodArgs[0], 1);
equal(eventMethodArgs[1], 2);
});
var converts = function(type, provided, expected) {
var Model = DS.Model.extend({
name: DS.attr(type)
});
var registry, container;
if (Ember.Registry) {
registry = new Ember.Registry();
container = registry.container();
} else {
container = new Ember.Container();
registry = container;
}
var testStore = createStore({ model: Model });
run(function() {
testStore.push(testStore.normalize('model', { id: 1, name: provided }));
testStore.push(testStore.normalize('model', { id: 2 }));
var record = testStore.peekRecord('model', 1);
deepEqual(get(record, 'name'), expected, type + " coerces " + provided + " to " + expected);
});
// See: Github issue #421
// record = testStore.find(Model, 2);
// set(record, 'name', provided);
// deepEqual(get(record, 'name'), expected, type + " coerces " + provided + " to " + expected);
};
var convertsFromServer = function(type, provided, expected) {
var Model = DS.Model.extend({
name: DS.attr(type)
});
var registry, container;
if (Ember.Registry) {
registry = new Ember.Registry();
container = registry.container();
} else {
container = new Ember.Container();
registry = container;
}
var testStore = createStore({
model: Model,
adapter: DS.Adapter.extend({
shouldBackgroundReloadRecord: () => false
})
});
run(function() {
testStore.push(testStore.normalize('model', { id: "1", name: provided }));
testStore.findRecord('model', 1).then(function(record) {
deepEqual(get(record, 'name'), expected, type + " coerces " + provided + " to " + expected);
});
});
};
var convertsWhenSet = function(type, provided, expected) {
var Model = DS.Model.extend({
name: DS.attr(type)
});
var testStore = createStore({
model: Model,
adapter: DS.Adapter.extend({
shouldBackgroundReloadRecord: () => false
})
});
run(function() {
testStore.push({
data: {
type: 'model',
id: '2'
}
});
testStore.findRecord('model', 2).then(function(record) {
set(record, 'name', provided);
deepEqual(record.serialize().name, expected, type + " saves " + provided + " as " + expected);
});
});
};
test("a DS.Model can describe String attributes", function() {
expect(6);
converts('string', "Scumbag Tom", "Scumbag Tom");
converts('string', 1, "1");
converts('string', "", "");
converts('string', null, null);
converts('string', undefined, null);
convertsFromServer('string', undefined, null);
});
test("a DS.Model can describe Number attributes", function() {
expect(9);
converts('number', "1", 1);
converts('number', "0", 0);
converts('number', 1, 1);
converts('number', 0, 0);
converts('number', "", null);
converts('number', null, null);
converts('number', undefined, null);
converts('number', true, 1);
converts('number', false, 0);
});
test("a DS.Model can describe Boolean attributes", function() {
expect(7);
converts('boolean', "1", true);
converts('boolean', "", false);
converts('boolean', 1, true);
converts('boolean', 0, false);
converts('boolean', null, false);
converts('boolean', true, true);
converts('boolean', false, false);
});
test("a DS.Model can describe Date attributes", function() {
expect(5);
converts('date', null, null);
converts('date', undefined, undefined);
var dateString = "2011-12-31T00:08:16.000Z";
var date = new Date(Ember.Date.parse(dateString));
var Person = DS.Model.extend({
updatedAt: DS.attr('date')
});
var store = createStore({
person: Person,
adapter: DS.Adapter.extend({
shouldBackgroundReloadRecord: () => false
})
});
run(function() {
store.push({
data: {
type: 'person',
id: '1'
}
});
store.findRecord('person', 1).then(function(record) {
run(function() {
record.set('updatedAt', date);
});
deepEqual(date, get(record, 'updatedAt'), "setting a date returns the same date");
});
});
convertsFromServer('date', dateString, date);
convertsWhenSet('date', date, dateString);
});
test("don't allow setting", function() {
var Person = DS.Model.extend();
var record;
var store = createStore({
person: Person
});
run(function() {
record = store.createRecord('person');
});
raises(function() {
run(function() {
record.set('isLoaded', true);
});
}, "raised error when trying to set an unsettable record");
});
test("ensure model exits loading state, materializes data and fulfills promise only after data is available", function () {
expect(2);
var store = createStore({
adapter: DS.Adapter.extend({
findRecord: function(store, type, id, snapshot) {
return Ember.RSVP.resolve({ id: 1, name: "John" });
}
}),
person: Person
});
run(function() {
store.findRecord('person', 1).then(function(person) {
equal(get(person, 'currentState.stateName'), 'root.loaded.saved', 'model is in loaded state');
equal(get(person, 'isLoaded'), true, 'model is loaded');
});
});
});
test("A DS.Model can be JSONified", function() {
var Person = DS.Model.extend({
name: DS.attr('string')
});
var store = createStore({ person: Person });
var record;
run(function() {
record = store.createRecord('person', { name: "TomHuda" });
});
deepEqual(record.toJSON(), { name: "TomHuda" });
});
test("A subclass of DS.Model can not use the `data` property", function() {
var Person = DS.Model.extend({
data: DS.attr('string'),
name: DS.attr('string')
});
var store = createStore({ person: Person });
expectAssertion(function() {
run(function() {
store.createRecord('person', { name: "TomHuda" });
});
}, /`data` is a reserved property name on DS.Model objects/);
});
test("A subclass of DS.Model can not use the `store` property", function() {
var Retailer = DS.Model.extend({
store: DS.attr(),
name: DS.attr()
});
var store = createStore({ retailer: Retailer });
expectAssertion(function() {
run(function() {
store.createRecord('retailer', { name: "Buy n Large" });
});
}, /`store` is a reserved property name on DS.Model objects/);
});
test("A subclass of DS.Model can not use reserved properties", function() {
expect(3);
[
'currentState', 'data', 'store'
].forEach(function(reservedProperty) {
var invalidExtendObject = {};
invalidExtendObject[reservedProperty] = DS.attr();
var Post = DS.Model.extend(invalidExtendObject);
var store = createStore({ post: Post });
expectAssertion(function() {
run(function() {
store.createRecord('post', {});
});
}, /is a reserved property name on DS.Model objects/);
});
});
test("Pushing a record into the store should transition it to the loaded state", function() {
var Person = DS.Model.extend({
name: DS.attr('string')
});
var store = createStore({ person: Person });
run(function() {
var person = store.createRecord('person', { id: 1, name: 'TomHuda' });
equal(person.get('isNew'), true, 'createRecord should put records into the new state');
store.push({
data: {
type: 'person',
id: '1',
attributes: {
name: 'TomHuda'
}
}
});
equal(person.get('isNew'), false, 'push should put records into the loaded state');
});
});
test("A subclass of DS.Model throws an error when calling create() directly", function() {
throws(function() {
Person.create();
}, /You should not call `create` on a model/, "Throws an error when calling create() on model");
});
test('toJSON looks up the JSONSerializer using the store instead of using JSONSerializer.create', function() {
var Person = DS.Model.extend({
posts: DS.hasMany('post', { async: false })
});
var Post = DS.Model.extend({
person: DS.belongsTo('person', { async: false })
});
var env = setupStore({
person: Person,
post: Post
});
var store = env.store;
var person, json;
// Loading the person without explicitly
// loading its relationships seems to trigger the
// original bug where `this.store` was not
// present on the serializer due to using .create
// instead of `store.serializerFor`.
run(() => {
person = store.push({
data: {
type: 'person',
id: '1'
}
});
});
var errorThrown = false;
try {
json = run(person, 'toJSON');
} catch (e) {
errorThrown = true;
}
ok(!errorThrown, 'error not thrown due to missing store');
deepEqual(json, {});
});
test('accessing attributes in the initializer should not throw an error', function() {
expect(1);
var Person = DS.Model.extend({
name: DS.attr('string'),
init: function() {
this._super.apply(this, arguments);
ok(!this.get('name'));
}
});
var env = setupStore({
person: Person
});
var store = env.store;
run(() => store.createRecord('person'));
});
|
/*
Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dojox.data.CssRuleStore"]){
dojo._hasResource["dojox.data.CssRuleStore"]=true;
dojo.provide("dojox.data.CssRuleStore");
dojo.require("dojo.data.util.filter");
dojo.require("dojo.data.util.sorter");
dojo.require("dojox.data.css");
dojo.declare("dojox.data.CssRuleStore",null,{_storeRef:"_S",_labelAttribute:"selector",_cache:null,_browserMap:null,_cName:"dojox.data.CssRuleStore",constructor:function(_1){
if(_1){
dojo.mixin(this,_1);
}
this._cache={};
this._allItems=null;
this._waiting=[];
this.gatherHandle=null;
var _2=this;
function _3(){
try{
_2.context=dojox.data.css.determineContext(_2.context);
if(_2.gatherHandle){
clearInterval(_2.gatherHandle);
_2.gatherHandle=null;
}
while(_2._waiting.length){
var _4=_2._waiting.pop();
dojox.data.css.rules.forEach(_4.forFunc,null,_2.context);
_4.finishFunc();
}
}
catch(e){
}
};
this.gatherHandle=setInterval(_3,250);
},setContext:function(_5){
if(_5){
this.close();
this.context=dojox.data.css.determineContext(_5);
}
},getFeatures:function(){
return {"dojo.data.api.Read":true};
},isItem:function(_6){
if(_6&&_6[this._storeRef]==this){
return true;
}
return false;
},hasAttribute:function(_7,_8){
this._assertIsItem(_7);
this._assertIsAttribute(_8);
var _9=this.getAttributes(_7);
if(dojo.indexOf(_9,_8)!=-1){
return true;
}
return false;
},getAttributes:function(_a){
this._assertIsItem(_a);
var _b=["selector","classes","rule","style","cssText","styleSheet","parentStyleSheet","parentStyleSheetHref"];
var _c=_a.rule.style;
if(_c){
var _d;
for(_d in _c){
_b.push("style."+_d);
}
}
return _b;
},getValue:function(_e,_f,_10){
var _11=this.getValues(_e,_f);
var _12=_10;
if(_11&&_11.length>0){
return _11[0];
}
return _10;
},getValues:function(_13,_14){
this._assertIsItem(_13);
this._assertIsAttribute(_14);
var _15=null;
if(_14==="selector"){
_15=_13.rule["selectorText"];
if(_15&&dojo.isString(_15)){
_15=_15.split(",");
}
}else{
if(_14==="classes"){
_15=_13.classes;
}else{
if(_14==="rule"){
_15=_13.rule.rule;
}else{
if(_14==="style"){
_15=_13.rule.style;
}else{
if(_14==="cssText"){
if(dojo.isIE){
if(_13.rule.style){
_15=_13.rule.style.cssText;
if(_15){
_15="{ "+_15.toLowerCase()+" }";
}
}
}else{
_15=_13.rule.cssText;
if(_15){
_15=_15.substring(_15.indexOf("{"),_15.length);
}
}
}else{
if(_14==="styleSheet"){
_15=_13.rule.styleSheet;
}else{
if(_14==="parentStyleSheet"){
_15=_13.rule.parentStyleSheet;
}else{
if(_14==="parentStyleSheetHref"){
if(_13.href){
_15=_13.href;
}
}else{
if(_14.indexOf("style.")===0){
var _16=_14.substring(_14.indexOf("."),_14.length);
_15=_13.rule.style[_16];
}else{
_15=[];
}
}
}
}
}
}
}
}
}
if(_15!==undefined){
if(!dojo.isArray(_15)){
_15=[_15];
}
}
return _15;
},getLabel:function(_17){
this._assertIsItem(_17);
return this.getValue(_17,this._labelAttribute);
},getLabelAttributes:function(_18){
return [this._labelAttribute];
},containsValue:function(_19,_1a,_1b){
var _1c=undefined;
if(typeof _1b==="string"){
_1c=dojo.data.util.filter.patternToRegExp(_1b,false);
}
return this._containsValue(_19,_1a,_1b,_1c);
},isItemLoaded:function(_1d){
return this.isItem(_1d);
},loadItem:function(_1e){
this._assertIsItem(_1e.item);
},fetch:function(_1f){
_1f=_1f||{};
if(!_1f.store){
_1f.store=this;
}
var _20=_1f.scope||dojo.global;
if(this._pending&&this._pending.length>0){
this._pending.push({request:_1f,fetch:true});
}else{
this._pending=[{request:_1f,fetch:true}];
this._fetch(_1f);
}
return _1f;
},_fetch:function(_21){
var _22=_21.scope||dojo.global;
if(this._allItems===null){
this._allItems={};
try{
if(this.gatherHandle){
this._waiting.push({"forFunc":dojo.hitch(this,this._handleRule),"finishFunc":dojo.hitch(this,this._handleReturn)});
}else{
dojox.data.css.rules.forEach(dojo.hitch(this,this._handleRule),null,this.context);
this._handleReturn();
}
}
catch(e){
if(_21.onError){
_21.onError.call(_22,e,_21);
}
}
}else{
this._handleReturn();
}
},_handleRule:function(_23,_24,_25){
var _26=_23["selectorText"];
var s=_26.split(" ");
var _27=[];
for(var j=0;j<s.length;j++){
var tmp=s[j];
var _28=tmp.indexOf(".");
if(tmp&&tmp.length>0&&_28!==-1){
var _29=tmp.indexOf(",")||tmp.indexOf("[");
tmp=tmp.substring(_28,((_29!==-1&&_29>_28)?_29:tmp.length));
_27.push(tmp);
}
}
var _2a={};
_2a.rule=_23;
_2a.styleSheet=_24;
_2a.href=_25;
_2a.classes=_27;
_2a[this._storeRef]=this;
if(!this._allItems[_26]){
this._allItems[_26]=[];
}
this._allItems[_26].push(_2a);
},_handleReturn:function(){
var _2b=[];
var _2c=[];
var _2d=null;
for(var i in this._allItems){
_2d=this._allItems[i];
for(var j in _2d){
_2c.push(_2d[j]);
}
}
var _2e;
while(this._pending.length){
_2e=this._pending.pop();
_2e.request._items=_2c;
_2b.push(_2e);
}
while(_2b.length){
_2e=_2b.pop();
this._handleFetchReturn(_2e.request);
}
},_handleFetchReturn:function(_2f){
var _30=_2f.scope||dojo.global;
var _31=[];
var _32="all";
var i;
if(_2f.query){
_32=dojo.toJson(_2f.query);
}
if(this._cache[_32]){
_31=this._cache[_32];
}else{
if(_2f.query){
for(i in _2f._items){
var _33=_2f._items[i];
var _34=dojo.isWebKit?true:(_2f.queryOptions?_2f.queryOptions.ignoreCase:false);
var _35={};
var key;
var _36;
for(key in _2f.query){
_36=_2f.query[key];
if(typeof _36==="string"){
_35[key]=dojo.data.util.filter.patternToRegExp(_36,_34);
}
}
var _37=true;
for(key in _2f.query){
_36=_2f.query[key];
if(!this._containsValue(_33,key,_36,_35[key])){
_37=false;
}
}
if(_37){
_31.push(_33);
}
}
this._cache[_32]=_31;
}else{
for(i in _2f._items){
_31.push(_2f._items[i]);
}
}
}
var _38=_31.length;
if(_2f.sort){
_31.sort(dojo.data.util.sorter.createSortFunction(_2f.sort,this));
}
var _39=0;
var _3a=_31.length;
if(_2f.start>0&&_2f.start<_31.length){
_39=_2f.start;
}
if(_2f.count&&_2f.count){
_3a=_2f.count;
}
var _3b=_39+_3a;
if(_3b>_31.length){
_3b=_31.length;
}
_31=_31.slice(_39,_3b);
if(_2f.onBegin){
_2f.onBegin.call(_30,_38,_2f);
}
if(_2f.onItem){
if(dojo.isArray(_31)){
for(i=0;i<_31.length;i++){
_2f.onItem.call(_30,_31[i],_2f);
}
if(_2f.onComplete){
_2f.onComplete.call(_30,null,_2f);
}
}
}else{
if(_2f.onComplete){
_2f.onComplete.call(_30,_31,_2f);
}
}
return _2f;
},close:function(){
this._cache={};
this._allItems=null;
},_assertIsItem:function(_3c){
if(!this.isItem(_3c)){
throw new Error(this._cName+": Invalid item argument.");
}
},_assertIsAttribute:function(_3d){
if(typeof _3d!=="string"){
throw new Error(this._cName+": Invalid attribute argument.");
}
},_containsValue:function(_3e,_3f,_40,_41){
return dojo.some(this.getValues(_3e,_3f),function(_42){
if(_42!==null&&!dojo.isObject(_42)&&_41){
if(_42.toString().match(_41)){
return true;
}
}else{
if(_40===_42){
return true;
}
}
return false;
});
}});
}
|
async function p(x) {
const y = do {
let z;
await x;
};
return y;
}
const promise = Promise.resolve(5);
expect(p(promise)).resolves.toBe(5); |
// @flow
/* The code in this test has a confusing error and should be improved.
* Bindings that result from destructuring an annotation should themselves
* behave like annotations. In some cases, annotations are not recursively
* annotations, like the class example below.
*
* For now, we use some sketchy unification logic to pin things down, but it
* does not behave sensibly for tvars with incompatible lower bounds.
*
* Ideally annotations would be recursively annotations, instead of shallowly.
* Another possibility would be to forego the annotation behavior for these
* kinds of destructurings.
*/
class C {
p;
m(cond: boolean) {
if (cond) {
this.p = 0;
} else {
this.p = "";
}
}
}
function f({
p // weird: string ~/~> number. C#p is inferred, with both number and string inflows
}: C) {
p = null; // weird: null ~/~> number. we pinned `p` to `number`
}
|
/**
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @jsx React.DOM
*/
var ReactPropTypes = React.PropTypes;
var ENTER_KEY_CODE = 13;
var TodoTextInput = React.createClass({displayName: 'TodoTextInput',
propTypes: {
className: ReactPropTypes.string,
id: ReactPropTypes.string,
placeholder: ReactPropTypes.string,
onSave: ReactPropTypes.func.isRequired,
value: ReactPropTypes.string
},
getInitialState: function() {
return {
value: this.props.value || ''
};
},
/**
* @return {object}
*/
render: function() /*object*/ {
return (
React.DOM.input(
{className:this.props.className,
id:this.props.id,
placeholder:this.props.placeholder,
onBlur:this._save,
onChange:this._onChange,
onKeyDown:this._onKeyDown,
value:this.state.value,
autoFocus:true}
)
);
},
/**
* Invokes the callback passed in as onSave, allowing this component to be
* used in different ways.
*/
_save: function() {
this.props.onSave(this.state.value);
this.setState({
value: ''
});
},
/**
* @param {object} event
*/
_onChange: function(/*object*/ event) {
this.setState({
value: event.target.value
});
},
/**
* @param {object} event
*/
_onKeyDown: function(event) {
if (event.keyCode === ENTER_KEY_CODE) {
this._save();
}
}
});
|
import HomeContainer from './containers/HomeContainer'
// Sync route definition
export default {
component: HomeContainer
}
|
(function() {
/**
* The goal of this file is to provide the basic understanding of
* 1. Old way to Subscribe/Unsubscribe a custom event
* 2. Old way to Subscribe a custom event onces
* 3. Trigger a subscribed event
*/
var MasterView = Backbone.View.extend({
initialize: function() {
/**
* Subscribe `alarm` event forever till it is manually off
*/
this.on('alarm', this.doSomething);
/**
* Subscribe `greeting` event once
*/
this.once('greeting', this.doSomethingOnce);
},
doSomething: function(name) {
console.log("Wake up, " + name);
},
doSomethingOnce: function(name) {
console.log("Good Morning, " + name);
},
el: '.workspace',
events: {
'click input[id=triggerOnAlarm]': 'triggerOnAlarm',
'click input[id=triggerOffAlarm]': 'triggerOffAlarm',
'click input[id=triggerOnce]': 'triggerOnce'
},
triggerOnAlarm: function() {
/**
* Trigger the event by specifing event name
*/
this.trigger('alarm', 'Ashwin');
},
triggerOffAlarm: function() {
/**
* Unsubscribe the event
*/
this.off('alarm');
},
triggerOnce: function() {
this.trigger('greeting', 'Ashwin');
}
});
new MasterView();
})(); |
// Copyright (C) 2014 Baudouin Feildel
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
const Main = imports.ui.main;
const Lang = imports.lang;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
/*
* Debug tool
* To debug this extension you can start a gnome-shell instance
* from a terminal :
*
* $ gnome-shell --replace
*
* And then use debug() function to display message in the console.
*/
function debug(msg, level) {
/*if (typeof level == 'string')
level = ' ' + level + ' **: ';
else
level = '';
global.log('DynamicTopBar: ' + level + msg);*/
}
/*
* Panel transparency manager
*/
const PanelTransparencyManager = new Lang.Class({
Name: 'PanelTransparencyManager',
/**
* Constructor
* @param {Object} panel The panel to manage
* @param {String} style The style to use, could be 'transparency' or 'gradient'
*/
_init: function(panel, style, transparencyLevel, buttonShadow, showActivity) {
this._panel = panel.actor;
this._leftCorner = panel._leftCorner.actor;
this._rightCorner = panel._rightCorner.actor;
this._style = style || 'transparency';
this._activityBtn = panel._leftBox.get_children()[0];
this._showActivity = showActivity;
this._isTransp = true;
this._btnShadow = buttonShadow;
this._color = {
'r': 0,
'g': 0,
'b': 0,
'a': transparencyLevel
};
},
/**
* Change the transparency style of the panel
* @param {String} newStyle The new style to use, could be 'transparency' or 'gradient'
*/
updateStyle: function(newStyle) {
let retransp = false;
if (this._isTransp) {
this.setSolid();
retransp = true;
}
if (newStyle == 'transparency' || newStyle == 'gradient')
this._style = newStyle;
if (retransp) this.setTransparent();
},
updateTransparencyLevel: function(newLevel) {
let retransp = false;
if(this._isTransp) {
this.setSolid();
retransp = true;
}
if(newLevel >= 0 && newLevel <= 1)
this._color.a = newLevel;
if(retransp) this.setTransparent();
},
updateButtonShadow: function(newBool) {
let retransp = false;
if(this._isTransp) {
this.setSolid();
retransp = true;
}
this._btnShadow = newBool;
if(retransp) this.setTransparent();
},
updateShowActivity: function(newBool) {
this._showActivity = newBool;
this._updateActivityBtnState();
},
/**
* Set the panel transparent
*/
setTransparent: function() {
// Add transparency
debug('Style used : ' + this._style, 'Notice');
this._isTransp = true;
this._applyStyle();
},
/**
* The the panel solid
*/
setSolid: function() {
// Restore opacity
debug('Style used : solid', 'Notice');
this._isTransp = false;
this._resetStyle();
},
/**
* Force activity button text state
*/
_showActivityBtn: function() {
this._panel.remove_style_class_name('dynamic-top-bar-hide-activity-btn');
},
_hideActivityBtn: function() {
this._panel.add_style_class_name('dynamic-top-bar-hide-activity-btn');
},
_updateActivityBtnState: function() {
if(this._showActivity) this._showActivityBtn();
else this._hideActivityBtn();
},
_setStyle: function(styles) {
for (var i = 0; i < styles.length; i++) {
if (typeof styles[i][0].set_style == 'function') {
if (typeof styles[i][1] == 'string')
styles[i][0].set_style(styles[i][1]);
else
styles[i][0].set_style('');
} else
debug('styles[' + i + '][0].set_style is not a function, it is : ' + typeof styles[i][0].set_style, 'Warning');
}
},
_resetStyle: function() {
this._panel.set_style('');
this._leftCorner.set_style('');
this._rightCorner.set_style('');
this._panel.remove_style_class_name('dynamic-top-bar-white-btn');
this._panel.remove_style_class_name('dynamic-top-bar-btn-shadow');
},
_applyStyle: function() {
let style = '';
let corner_style = '';
switch (this._style) {
case 'gradient':
style = 'background-color: transparent;';
style += 'background-gradient-start: rgba(0,0,0,0.8);';
style += 'background-gradient-end: rgba(0,0,0,0);';
style += 'background-gradient-direction: vertical;';
corner_style = '-panel-corner-background-color: transparent;';
corner_style += '-panel-corner-border-color: transparent;';
break;
case 'transparency':
default:
style = 'background-color: rgba('+this._color.r+','+this._color.g+','+this._color.b+','+this._color.a+');';
corner_style = '-panel-corner-background-color: rgba('+this._color.r+','+this._color.g+','+this._color.b+','+this._color.a+');';
corner_style += '-panel-corner-border-color: transparent;';
break;
}
this._panel.add_style_class_name('dynamic-top-bar-white-btn');
if(this._btnShadow)
this._panel.add_style_class_name('dynamic-top-bar-btn-shadow');
else
this._panel.remove_style_class_name('dynamic-top-bar-btn-shadow');
this._setStyle([
[this._panel, style],
[this._leftCorner, corner_style],
[this._rightCorner, corner_style]
]);
}
});
/*
* Window Manager
* This class provide interface to work with windows
*/
const WindowManager = new Lang.Class({
Name: 'WindowManager',
/**
* Constructor
* @param {Object} window The window to manage
* @param {Object} workspace The workspace containing the window
*/
_init: function(window, workspace) {
this._metaWindow = window;
this._workspace = workspace;
this._notifyMinimizeId = this._metaWindow.connect('notify::minimized', Lang.bind(this, this._update));
this._notifyMaximizeVId = this._metaWindow.connect('notify::maximized-vertically', Lang.bind(this, this._update));
this._notifyMaximizeHId = this._metaWindow.connect('notify::maximized-horizontally', Lang.bind(this, this._update));
},
/**
* Require the workspace to update it's state
* This function is called on maximize, minize and restore events
*/
_update: function() {
this._workspace.updatePanelTransparency();
},
/**
* Test if the window is maximized
* @return {Boolean} true is window is maximized, false otherwise
*/
isMaximized: function() {
return this._metaWindow.maximized_vertically && !this._metaWindow.minimized;
},
/**
* Get the monitor index which contain the window
* @return {Number} The monitor index
*/
getMonitorIndex: function() {
return global.screen.get_monitor_index_for_rect(this._metaWindow.get_frame_rect());
},
/**
* Test if the object manage metaWindow
* @param {Object} metaWindow The window to test
* @return {Boolean} true if metaWindow is managed by the object, false otherwise
*/
equals: function(metaWindow) {
return metaWindow == this._metaWindow;
},
/**
* Destructor, removes event manager
*/
destroy: function() {
this._metaWindow.disconnect(this._notifyMinimizeId);
this._metaWindow.disconnect(this._notifyMaximizeHId);
this._metaWindow.disconnect(this._notifyMaximizeVId);
}
});
/*
* Workspace Manager
*/
const WorkspaceManager = new Lang.Class({
Name: 'WorkspaceManager',
_init: function(transparencyManager, metaWorkspace) {
this._transparencyManager = transparencyManager;
this._metaWorkspace = metaWorkspace;
this._windowList = this.getWindowList();
this._primaryMonitor = Main.layoutManager.primaryMonitor.index;
this._notifyWindowAddedId = this._metaWorkspace.connect('window-added', Lang.bind(this, this._addWindow));
this._notifyWindowRemovedId = this._metaWorkspace.connect('window-removed', Lang.bind(this, this._removeWindow));
},
getWindowList: function() {
let tmpList = this._metaWorkspace.list_windows();
let outList = [];
for (let i = 0; i < tmpList.length; i++)
outList.push(new WindowManager(tmpList[i], this));
return outList;
},
isAnyWindowMaximized: function() {
for (let i = 0; i < this._windowList.length; i++) {
if (this._windowList[i].isMaximized() && this._windowList[i].getMonitorIndex() == this._primaryMonitor)
return true;
// Support DropDownTerminal https://github.com/zzrough/gs-extensions-drop-down-terminal
if (this._windowList[i]._metaWindow.get_wm_class() == 'DropDownTerminalWindow')
return true;
}
return false;
},
updatePanelTransparency: function() {
if (this.isAnyWindowMaximized())
this._transparencyManager.setSolid();
else
this._transparencyManager.setTransparent();
},
_haveWindow: function(metaWindow) {
for (let i = 0; i < this._windowList.length; i++)
if (this._windowList[i].equals(metaWindow))
return true;
return false;
},
_addWindow: function(metaWorkspace, metaWindow) {
if (!this._haveWindow(metaWindow))
this._windowList.push(new WindowManager(metaWindow, this));
this.updatePanelTransparency();
},
_removeWindow: function(metaWorkspace, metaWindow) {
for (let i = 0; i < this._windowList.length; i++)
if (this._windowList[i].equals(metaWindow)) {
this._windowList[i].destroy();
this._windowList.splice(i, 1);
}
this.updatePanelTransparency();
},
_onDestroy: function() {
for (let i = 0; i < this._windowList.length; i++)
this._windowList[i].destroy();
this._metaWorkspace.disconnect(this._notifyWindowAddedId);
this._metaWorkspace.disconnect(this._notifyWindowRemovedId);
},
destroy: function() {
this._onDestroy();
this._transparencyManager = null;
this._metaWorkspace = null;
this._windowList = null;
}
});
const ShellManager = new Lang.Class({
Name: 'ShellManager',
_init: function(transparencyManager, settings) {
this._settings = settings;
this._transparencyManager = transparencyManager;
this._currentWorkspace = new WorkspaceManager(transparencyManager, global.screen.get_active_workspace());
this._currentWorkspace.updatePanelTransparency();
this._notifySwitchId = global.window_manager.connect('switch-workspace', Lang.bind(this, this._switchWorkspace));
this._notifyShowOverviewId = Main.overview.connect('showing', Lang.bind(this, this._showOverview));
this._notifyHideOverviewId = Main.overview.connect('hiding', Lang.bind(this, this._hideOverview));
this._overviewOpen = false;
this._notifySettingsId = this._settings.connect('changed', Lang.bind(this, this._settingsUpdate));
},
_switchWorkspace: function(winManager, previousWkId, newWkId) {
this._currentWorkspace.destroy();
delete this._currentWorkspace;
this._currentWorkspace = new WorkspaceManager(this._transparencyManager, global.screen.get_workspace_by_index(newWkId));
if (this._overviewOpen)
this._transparencyManager.setTransparent();
else
this._currentWorkspace.updatePanelTransparency();
},
_showOverview: function() {
this._transparencyManager.setTransparent();
this._overviewOpen = true;
},
_hideOverview: function() {
this._currentWorkspace.updatePanelTransparency();
this._overviewOpen = false;
},
_onDestroy: function() {
global.window_manager.disconnect(this._notifySwitchId);
Main.overview.disconnect(this._notifyShowOverviewId);
Main.overview.disconnect(this._notifyHideOverviewId);
this._settings.disconnect(this._notifySettingsId);
},
_settingsUpdate: function() {
debug('New style value ' + this._settings.get_string('style'), 'Notice');
this._transparencyManager.updateStyle(this._settings.get_string('style'));
this._transparencyManager.updateTransparencyLevel(this._settings.get_double('transparency-level'));
this._transparencyManager.updateButtonShadow(this._settings.get_boolean('button-shadow'));
this._transparencyManager.updateShowActivity(this._settings.get_boolean('show-activity'));
this._currentWorkspace.updatePanelTransparency();
}
});
/*
* Global variables
*/
let topPanelTransparencyManager;
let globalManager;
let preferences;
/*
* Extensions standard functions
*/
function init() {
}
function enable() {
preferences = Convenience.getSettings();
topPanelTransparencyManager = new PanelTransparencyManager(
Main.panel,
preferences.get_string('style'),
preferences.get_double('transparency-level'),
preferences.get_boolean('button-shadow'),
preferences.get_boolean('show-activity')
);
new ShellManager(topPanelTransparencyManager, preferences);
}
function disable() {
if (!topPanelTransparencyManager)
{
topPanelTransparencyManager = new PanelTransparencyManager(Main.panel);
topPanelTransparencyManager.setSolid();
}
else
topPanelTransparencyManager.setSolid();
topPanelTransparencyManager = null;
}
|
/**
* @module 101/is-regexp
*/
/**
* Check if a value is an instance of RegExp
* @function module:101/is-regexp
* @param {*} val - value checked to be an instance of RegExp
* @return {boolean} Whether the value is an object or not
*/
module.exports = function isRegExp (val) {
return Object.prototype.toString.call(val) == '[object RegExp]';
};
|
import '../style.css'
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp
|
"use strict";
const Constants = require("../../../Constants");
const Events = Constants.Events;
const Endpoints = Constants.Endpoints;
const apiRequest = require("../../../core/ApiRequest");
module.exports = function(channelId) {
return new Promise((rs, rj) => {
var request = apiRequest
.get(this, Endpoints.CHANNEL_WEBHOOKS(channelId));
this._queueManager.put(request, (err, res) => {
return (!err && res.ok) ? rs(res.body) : rj(err);
});
});
};
|
angular.module('orderCloud')
.config(ProductFacetsConfig)
.controller('ProductFacetsCtrl', ProductFacetsController)
.controller('ProductFacetsManageCtrl', FacetedProductManageController)
;
function ProductFacetsConfig($stateProvider) {
$stateProvider
.state('productFacets', {
parent: 'base',
templateUrl: 'facets/productFacets/templates/productFacets.tpl.html',
controller: 'ProductFacetsCtrl',
controllerAs: 'facetedProd',
url: '/productfacets?from&to&search&page&pageSize&searchOn&sortBy&filters',
data: {componentName: 'Product Facets'},
resolve: {
Parameters: function($stateParams, OrderCloudParameters) {
return OrderCloudParameters.Get($stateParams);
},
ProductList: function(OrderCloud, Parameters) {
return OrderCloud.Products.List(Parameters.search, Parameters.page, Parameters.pageSize || 12, Parameters.searchOn, Parameters.sortBy, Parameters.filters);
}
}
})
.state('productFacets.manage', {
url: '/:productid/manage',
templateUrl: 'facets/productFacets/templates/productFacetsManage.tpl.html',
controller: 'ProductFacetsManageCtrl',
controllerAs: 'facetedProdManage',
data: {componentName: 'Product Facets'},
resolve: {
Product: function($stateParams, OrderCloud) {
return OrderCloud.Products.Get($stateParams.productid);
},
AssignedCategories: function($q, $stateParams, OrderCloud) {
var dfd = $q.defer();
var assignedCategories = [];
OrderCloud.Categories.ListProductAssignments(null, $stateParams.productid)
.then(function(categories) {
angular.forEach(categories.Items, function(cat) {
assignedCategories.push(OrderCloud.Categories.Get(cat.CategoryID))
});
$q.all(assignedCategories)
.then(function(results) {
dfd.resolve(results);
});
});
return dfd.promise
}
}
})
;
}
function ProductFacetsController($state, $ocMedia, OrderCloud, OrderCloudParameters, ProductList, Parameters) {
var vm = this;
vm.list = ProductList;
vm.parameters = Parameters;
vm.sortSelection = Parameters.sortBy ? (Parameters.sortBy.indexOf('!') == 0 ? Parameters.sortBy.split('!')[1] : Parameters.sortBy) : null;
//Check if filters are applied
vm.filtersApplied = vm.parameters.filters || vm.parameters.from || vm.parameters.to || ($ocMedia('max-width:767px') && vm.sortSelection); //Sort by is a filter on mobile devices
vm.showFilters = vm.filtersApplied;
//Check if search was used
vm.searchResults = Parameters.search && Parameters.search.length > 0;
//Reload the state with new parameters
vm.filter = function(resetPage) {
$state.go('.', OrderCloudParameters.Create(vm.parameters, resetPage));
};
//Reload the state with new search parameter & reset the page
vm.search = function() {
vm.filter(true);
};
//Clear the search parameter, reload the state & reset the page
vm.clearSearch = function() {
vm.parameters.search = null;
vm.filter(true);
};
//Clear relevant filters, reload the state & reset the page
vm.clearFilters = function() {
vm.parameters.filters = null;
vm.parameters.from = null;
vm.parameters.to = null;
$ocMedia('max-width:767px') ? vm.parameters.sortBy = null : angular.noop(); //Clear out sort by on mobile devices
vm.filter(true);
};
//Conditionally set, reverse, remove the sortBy parameter & reload the state
vm.updateSort = function(value) {
value ? angular.noop() : value = vm.sortSelection;
switch(vm.parameters.sortBy) {
case value:
vm.parameters.sortBy = '!' + value;
break;
case '!' + value:
vm.parameters.sortBy = null;
break;
default:
vm.parameters.sortBy = value;
}
vm.filter(false);
};
//Used on mobile devices
vm.reverseSort = function() {
Parameters.sortBy.indexOf('!') == 0 ? vm.parameters.sortBy = Parameters.sortBy.split('!')[1] : vm.parameters.sortBy = '!' + Parameters.sortBy;
vm.filter(false);
};
//Reload the state with the incremented page parameter
vm.pageChanged = function() {
$state.go('.', {page:vm.list.Meta.Page});
};
//Load the next page of results with all of the same parameters
vm.loadMore = function() {
return OrderCloud.Products.List(Parameters.search, vm.list.Meta.Page + 1, Parameters.pageSize || vm.list.Meta.PageSize, Parameters.searchOn, Parameters.sortBy, Parameters.filters)
.then(function(data) {
vm.list.Items = vm.list.Items.concat(data.Items);
vm.list.Meta = data.Meta;
});
};
}
function FacetedProductManageController ($state, toastr, OrderCloud, Product, AssignedCategories) {
var vm = this;
vm.assignedCategories = AssignedCategories;
vm.product = Product;
if (vm.product.xp == null) vm.product.xp = {OC_Facets: {}};
if (vm.product.xp && !vm.product.xp.OC_Facets) vm.product.xp.OC_Facets = {};
vm.setSelected = function(cat, facetName, facetValue) {
var selected = false;
if (vm.product.xp.OC_Facets[cat.ID] && vm.product.xp.OC_Facets[cat.ID][facetName]) {
selected = vm.product.xp.OC_Facets[cat.ID][facetName].indexOf(facetValue) > -1
}
return selected;
};
vm.toggleSelection = function(cat, facetName, facetValue) {
var selected = vm.setSelected(cat, facetName, facetValue);
selected = !selected;
if (selected && vm.product.xp.OC_Facets[cat.ID]) {
if (vm.product.xp.OC_Facets[cat.ID][facetName]) {
vm.product.xp.OC_Facets[cat.ID][facetName].push(facetValue);
} else if (!vm.product.xp.OC_Facets[cat.ID][facetName]) {
vm.product.xp.OC_Facets[cat.ID][facetName] = [];
vm.product.xp.OC_Facets[cat.ID][facetName].push(facetValue);
}
} else if (selected && !vm.product.xp.OC_Facets[cat.ID]) {
vm.product.xp.OC_Facets[cat.ID] = {};
vm.product.xp.OC_Facets[cat.ID][facetName] = [];
vm.product.xp.OC_Facets[cat.ID][facetName].push(facetValue);
}
else {
vm.product.xp.OC_Facets[cat.ID][facetName].splice(vm.product.xp.OC_Facets[cat.ID][facetName].indexOf(facetValue), 1);
}
};
vm.requiredFacet = function(cat) {
var disabled = false;
if (cat.xp && cat.xp.OC_Facets) {
angular.forEach((cat.xp.OC_Facets), function(facetValues, facet) {
if (facetValues.isRequired && vm.product.xp.OC_Facets[cat.ID] && vm.product.xp.OC_Facets[cat.ID][facet] && vm.product.xp.OC_Facets[cat.ID][facet].length == 0) {
disabled = true;
}
});
}
return disabled;
};
vm.saveSelections = function() {
(OrderCloud.Products.Update(vm.product.ID, vm.product))
.then(function() {
toastr.success('Your product facets have been saved successfully');
$state.go($state.current, {}, {reload: true});
});
};
vm.addValueExisting = function(cat, facetName) {
cat.xp.OC_Facets[facetName].Values.push(vm.newFacetValue[facetName].toLowerCase());
OrderCloud.Categories.Update(cat.ID, cat)
.then(function() {
if (!vm.product.xp.OC_Facets) vm.product.xp.OC_Facets = {};
if (!vm.product.xp.OC_Facets[cat.ID]) vm.product.xp.OC_Facets[cat.ID] = {};
if (!vm.product.xp.OC_Facets[cat.ID][facetName]) vm.product.xp.OC_Facets[cat.ID][facetName] = [];
vm.product.xp.OC_Facets[cat.ID][facetName].push(vm.newFacetValue[facetName].toLowerCase());
OrderCloud.Products.Update(vm.product.ID, vm.product)
.then(function() {
vm.newFacetValue[facetName] = null;
$state.go($state.current, {}, {reload: true});
});
});
};
}
|
(function ($) {
$.mobiscroll.i18n.de = $.extend($.mobiscroll.i18n.de, {
// Core
setText: 'OK',
cancelText: 'Abbrechen',
clearText: 'Löschen',
selectedText: 'Ausgewählt',
// Datetime component
dateFormat: 'dd.mm.yy',
dateOrder: 'ddmmyy',
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
dayNamesMin: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
dayText: 'Tag',
delimiter: '.',
hourText: 'Stunde',
minuteText: 'Minuten',
monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
monthText: 'Monat',
secText: 'Sekunden',
timeFormat: 'HH:ii',
timeWheels: 'HHii',
yearText: 'Jahr',
nowText: 'Jetzt',
pmText: 'nachm.',
amText: 'vorm.',
// Calendar component
dateText: 'Datum',
timeText: 'Zeit',
calendarText: 'Kalender',
closeText: 'Schließen',
// Daterange component
fromText: 'Von',
toText: 'Um',
// Measurement components
wholeText: 'Ganze Zahl',
fractionText: 'Bruchzahl',
unitText: 'Maßeinheit',
// Time / Timespan component
labels: ['Jahre', 'Monate', 'Tage', 'Stunden', 'Minuten', 'Sekunden', ''],
labelsShort: ['Yrs', 'Mths', 'Days', 'Hrs', 'Mins', 'Secs', ''],
// Timer component
startText: 'Starten',
stopText: 'Stoppen',
resetText: 'Zurücksetzen',
lapText: 'Lap',
hideText: 'Ausblenden'
});
})(jQuery);
|
/*
* Author: Abdullah A Almsaeed (Modified by Kevin Willms)
* Date: 4 Jan 2014 (modified on Aug. 5, 2016)
* Description:
* Data pull for main dashboard index.html
*/
$(function () {
"use strict";
$('#heading').text("Where Are The Churches?"); //Take most recent value
var graphCount = 0;
var graphTotal = 0;
//PopulateGraphDaily(365, 1, true, 2, '/api/stats/logins/total', 'Type', 'loginChart', 'loginChartLegend', 0, 'line', '', 'CB15', function(cb){ graphCount++ })
//PopulateGraphDaily(365, 1, true, 2, '/api/stats/logins/bydc?days=366', 'LocationName', 'COLOvsAWS', 'COLOvsAWSLegend', 0, 'line', '', 'CB15', function(cb){ graphCount++ })
//PopulateGraphMonthly(36, 30, 100, false, 1, '/api/stats/Availability?years=3', 'Location', 'Availability', 'AvailabilityLegend', 3, 'line', '', 'CB15', function(cb){ graphCount++ })
//PopulatePieGraph('/api/stats/logins/lastXDays/bydc?days=30', 'pieChart', '', 3, 1, 'LocationName', 'Percentage', 'doughnut', 'CB15', '%')
var areGraphsDone = function(){
if (graphCount == graphTotal){
$(".chart-legend-item").click(function(){
updateDataset($(this))
});
}
else {
setTimeout(areGraphsDone , 250)
}
}
setTimeout(areGraphsDone , 250)
$.get('/api/churchProvince' + document.location.search, function (res) {
console.log(res)
$('#numChurchProvince').text(numberWithCommas(res.count));
});
$.get('/api/churchCity' + document.location.search, function (res) {
console.log(res)
$('#numChurchCity').text(numberWithCommas(res.count));
});
$.get('/api/churchType' + document.location.search, function (res) {
$('#numChurchLeast').text(numberWithCommas(res[0].count));
$('#numChurchMost').text(numberWithCommas(res[res.length -1].count));
});
//-----------------
//- SPARKLINE BAR -
//-----------------
// $.get('/api/churchProvince' , function (res) {
// /* jVector Maps
// * ------------
// * Create a world map with markers
// */
// var dcs = [
// {latLng: [43.60, -81.53], name: 'Cogeco', style: {fill: 'rgba(160,208,224,0.5)', r:5}, value: numberWithCommas(loginbydcXdays['Cogeco'])},
// {latLng: [43.64, -77.41], name: 'Bell', style: {fill: 'rgba(160,208,224,0.5)', r:5}, value: numberWithCommas(loginbydcXdays['Bell'])},
// {latLng: [-33.91, 151.19], name: 'Sydney', style: {fill: 'rgba(160,208,224,0.5)', r:5}, value: numberWithCommas(loginbydcXdays['Sydney'])},
// {latLng: [53.35, -6.26], name: 'AWS - EMEA', style: {fill: 'rgba(0,166,90,0.5)', r:5}, value: numberWithCommas(loginbydcXdays['AWS - EMEA'])},
// {latLng: [1.34, 103.83], name: 'AWS - Singapore', style: {fill: 'rgba(0,166,90,0.5)', r:5}, value: numberWithCommas(loginbydcXdays['AWS - Singapore'])},
// {latLng: [38.89, -77.42], name: 'AWS - US2', style: {fill: 'rgba(0,166,90,0.5)', r:5}, value: numberWithCommas(loginbydcXdays['AWS - US2'])},
// ];
//
// $('#world-map-markers').vectorMap({
// map: 'world_mill_en',
// normalizeFunction: 'polynomial',
// hoverOpacity: 0.7,
// hoverColor: false,
// backgroundColor: 'transparent',
// regionStyle: {
// initial: {
// fill: 'rgba(210, 214, 222, 1)',
// "fill-opacity": 1,
// stroke: 'none',
// "stroke-width": 0,
// "stroke-opacity": 1
// },
// hover: {
// "fill-opacity": 0.7,
// cursor: 'pointer'
// },
// selected: {
// fill: 'yellow'
// },
// selectedHover: {}
// },
// markerStyle: {
// initial: {
// fill: '#00a65a',
// stroke: '#111'
// }
// },
// markers: dcs.map(function(h){ return {name: h.name+' - '+ h.value, latLng: h.latLng, style: h.style, r: h.r} })
// });
// });
});
|
/**
* @module zrender/tool/color
*/
define(function(require) {
var kCSSColorTable = {
'transparent': [0,0,0,0], 'aliceblue': [240,248,255,1],
'antiquewhite': [250,235,215,1], 'aqua': [0,255,255,1],
'aquamarine': [127,255,212,1], 'azure': [240,255,255,1],
'beige': [245,245,220,1], 'bisque': [255,228,196,1],
'black': [0,0,0,1], 'blanchedalmond': [255,235,205,1],
'blue': [0,0,255,1], 'blueviolet': [138,43,226,1],
'brown': [165,42,42,1], 'burlywood': [222,184,135,1],
'cadetblue': [95,158,160,1], 'chartreuse': [127,255,0,1],
'chocolate': [210,105,30,1], 'coral': [255,127,80,1],
'cornflowerblue': [100,149,237,1], 'cornsilk': [255,248,220,1],
'crimson': [220,20,60,1], 'cyan': [0,255,255,1],
'darkblue': [0,0,139,1], 'darkcyan': [0,139,139,1],
'darkgoldenrod': [184,134,11,1], 'darkgray': [169,169,169,1],
'darkgreen': [0,100,0,1], 'darkgrey': [169,169,169,1],
'darkkhaki': [189,183,107,1], 'darkmagenta': [139,0,139,1],
'darkolivegreen': [85,107,47,1], 'darkorange': [255,140,0,1],
'darkorchid': [153,50,204,1], 'darkred': [139,0,0,1],
'darksalmon': [233,150,122,1], 'darkseagreen': [143,188,143,1],
'darkslateblue': [72,61,139,1], 'darkslategray': [47,79,79,1],
'darkslategrey': [47,79,79,1], 'darkturquoise': [0,206,209,1],
'darkviolet': [148,0,211,1], 'deeppink': [255,20,147,1],
'deepskyblue': [0,191,255,1], 'dimgray': [105,105,105,1],
'dimgrey': [105,105,105,1], 'dodgerblue': [30,144,255,1],
'firebrick': [178,34,34,1], 'floralwhite': [255,250,240,1],
'forestgreen': [34,139,34,1], 'fuchsia': [255,0,255,1],
'gainsboro': [220,220,220,1], 'ghostwhite': [248,248,255,1],
'gold': [255,215,0,1], 'goldenrod': [218,165,32,1],
'gray': [128,128,128,1], 'green': [0,128,0,1],
'greenyellow': [173,255,47,1], 'grey': [128,128,128,1],
'honeydew': [240,255,240,1], 'hotpink': [255,105,180,1],
'indianred': [205,92,92,1], 'indigo': [75,0,130,1],
'ivory': [255,255,240,1], 'khaki': [240,230,140,1],
'lavender': [230,230,250,1], 'lavenderblush': [255,240,245,1],
'lawngreen': [124,252,0,1], 'lemonchiffon': [255,250,205,1],
'lightblue': [173,216,230,1], 'lightcoral': [240,128,128,1],
'lightcyan': [224,255,255,1], 'lightgoldenrodyellow': [250,250,210,1],
'lightgray': [211,211,211,1], 'lightgreen': [144,238,144,1],
'lightgrey': [211,211,211,1], 'lightpink': [255,182,193,1],
'lightsalmon': [255,160,122,1], 'lightseagreen': [32,178,170,1],
'lightskyblue': [135,206,250,1], 'lightslategray': [119,136,153,1],
'lightslategrey': [119,136,153,1], 'lightsteelblue': [176,196,222,1],
'lightyellow': [255,255,224,1], 'lime': [0,255,0,1],
'limegreen': [50,205,50,1], 'linen': [250,240,230,1],
'magenta': [255,0,255,1], 'maroon': [128,0,0,1],
'mediumaquamarine': [102,205,170,1], 'mediumblue': [0,0,205,1],
'mediumorchid': [186,85,211,1], 'mediumpurple': [147,112,219,1],
'mediumseagreen': [60,179,113,1], 'mediumslateblue': [123,104,238,1],
'mediumspringgreen': [0,250,154,1], 'mediumturquoise': [72,209,204,1],
'mediumvioletred': [199,21,133,1], 'midnightblue': [25,25,112,1],
'mintcream': [245,255,250,1], 'mistyrose': [255,228,225,1],
'moccasin': [255,228,181,1], 'navajowhite': [255,222,173,1],
'navy': [0,0,128,1], 'oldlace': [253,245,230,1],
'olive': [128,128,0,1], 'olivedrab': [107,142,35,1],
'orange': [255,165,0,1], 'orangered': [255,69,0,1],
'orchid': [218,112,214,1], 'palegoldenrod': [238,232,170,1],
'palegreen': [152,251,152,1], 'paleturquoise': [175,238,238,1],
'palevioletred': [219,112,147,1], 'papayawhip': [255,239,213,1],
'peachpuff': [255,218,185,1], 'peru': [205,133,63,1],
'pink': [255,192,203,1], 'plum': [221,160,221,1],
'powderblue': [176,224,230,1], 'purple': [128,0,128,1],
'red': [255,0,0,1], 'rosybrown': [188,143,143,1],
'royalblue': [65,105,225,1], 'saddlebrown': [139,69,19,1],
'salmon': [250,128,114,1], 'sandybrown': [244,164,96,1],
'seagreen': [46,139,87,1], 'seashell': [255,245,238,1],
'sienna': [160,82,45,1], 'silver': [192,192,192,1],
'skyblue': [135,206,235,1], 'slateblue': [106,90,205,1],
'slategray': [112,128,144,1], 'slategrey': [112,128,144,1],
'snow': [255,250,250,1], 'springgreen': [0,255,127,1],
'steelblue': [70,130,180,1], 'tan': [210,180,140,1],
'teal': [0,128,128,1], 'thistle': [216,191,216,1],
'tomato': [255,99,71,1], 'turquoise': [64,224,208,1],
'violet': [238,130,238,1], 'wheat': [245,222,179,1],
'white': [255,255,255,1], 'whitesmoke': [245,245,245,1],
'yellow': [255,255,0,1], 'yellowgreen': [154,205,50,1]
};
function clampCssByte(i) { // Clamp to integer 0 .. 255.
i = Math.round(i); // Seems to be what Chrome does (vs truncation).
return i < 0 ? 0 : i > 255 ? 255 : i;
}
function clampCssAngle(i) { // Clamp to integer 0 .. 360.
i = Math.round(i); // Seems to be what Chrome does (vs truncation).
return i < 0 ? 0 : i > 360 ? 360 : i;
}
function clampCssFloat(f) { // Clamp to float 0.0 .. 1.0.
return f < 0 ? 0 : f > 1 ? 1 : f;
}
function parseCssInt(str) { // int or percentage.
if (str.length && str.charAt(str.length - 1) === '%') {
return clampCssByte(parseFloat(str) / 100 * 255);
}
return clampCssByte(parseInt(str, 10));
}
function parseCssFloat(str) { // float or percentage.
if (str.length && str.charAt(str.length - 1) === '%') {
return clampCssFloat(parseFloat(str) / 100);
}
return clampCssFloat(parseFloat(str));
}
function cssHueToRgb(m1, m2, h) {
if (h < 0) {
h += 1;
}
else if (h > 1) {
h -= 1;
}
if (h * 6 < 1) {
return m1 + (m2 - m1) * h * 6;
}
if (h * 2 < 1) {
return m2;
}
if (h * 3 < 2) {
return m1 + (m2 - m1) * (2/3 - h) * 6;
}
return m1;
}
function lerp(a, b, p) {
return a + (b - a) * p;
}
/**
* @param {string} colorStr
* @return {Array.<number>}
* @memberOf module:zrender/util/color
*/
function parse(colorStr) {
if (!colorStr) {
return;
}
// colorStr may be not string
colorStr = colorStr + '';
// Remove all whitespace, not compliant, but should just be more accepting.
var str = colorStr.replace(/ /g, '').toLowerCase();
// Color keywords (and transparent) lookup.
if (str in kCSSColorTable) {
return kCSSColorTable[str].slice(); // dup.
}
// #abc and #abc123 syntax.
if (str.charAt(0) === '#') {
if (str.length === 4) {
var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.
if (!(iv >= 0 && iv <= 0xfff)) {
return; // Covers NaN.
}
return [
((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),
(iv & 0xf0) | ((iv & 0xf0) >> 4),
(iv & 0xf) | ((iv & 0xf) << 4),
1
];
}
else if (str.length === 7) {
var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.
if (!(iv >= 0 && iv <= 0xffffff)) {
return; // Covers NaN.
}
return [
(iv & 0xff0000) >> 16,
(iv & 0xff00) >> 8,
iv & 0xff,
1
];
}
return;
}
var op = str.indexOf('('), ep = str.indexOf(')');
if (op !== -1 && ep + 1 === str.length) {
var fname = str.substr(0, op);
var params = str.substr(op + 1, ep - (op + 1)).split(',');
var alpha = 1; // To allow case fallthrough.
switch (fname) {
case 'rgba':
if (params.length !== 4) {
return;
}
alpha = parseCssFloat(params.pop()); // jshint ignore:line
// Fall through.
case 'rgb':
if (params.length !== 3) {
return;
}
return [
parseCssInt(params[0]),
parseCssInt(params[1]),
parseCssInt(params[2]),
alpha
];
case 'hsla':
if (params.length !== 4) {
return;
}
params[3] = parseCssFloat(params[3]);
return hsla2rgba(params);
case 'hsl':
if (params.length !== 3) {
return;
}
return hsla2rgba(params);
default:
return;
}
}
return;
}
/**
* @param {Array.<number>} hsla
* @return {Array.<number>} rgba
*/
function hsla2rgba(hsla) {
var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360; // 0 .. 1
// NOTE(deanm): According to the CSS spec s/l should only be
// percentages, but we don't bother and let float or percentage.
var s = parseCssFloat(hsla[1]);
var l = parseCssFloat(hsla[2]);
var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
var m1 = l * 2 - m2;
var rgba = [
clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255),
clampCssByte(cssHueToRgb(m1, m2, h) * 255),
clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255)
];
if (hsla.length === 4) {
rgba[3] = hsla[3];
}
return rgba;
}
/**
* @param {Array.<number>} rgba
* @return {Array.<number>} hsla
*/
function rgba2hsla(rgba) {
if (!rgba) {
return;
}
// RGB from 0 to 255
var R = rgba[0] / 255;
var G = rgba[1] / 255;
var B = rgba[2] / 255;
var vMin = Math.min(R, G, B); // Min. value of RGB
var vMax = Math.max(R, G, B); // Max. value of RGB
var delta = vMax - vMin; // Delta RGB value
var L = (vMax + vMin) / 2;
var H;
var S;
// HSL results from 0 to 1
if (delta === 0) {
H = 0;
S = 0;
}
else {
if (L < 0.5) {
S = delta / (vMax + vMin);
}
else {
S = delta / (2 - vMax - vMin);
}
var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;
var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;
var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;
if (R === vMax) {
H = deltaB - deltaG;
}
else if (G === vMax) {
H = (1 / 3) + deltaR - deltaB;
}
else if (B === vMax) {
H = (2 / 3) + deltaG - deltaR;
}
if (H < 0) {
H += 1;
}
if (H > 1) {
H -= 1;
}
}
var hsla = [H * 360, S, L];
if (rgba[3] != null) {
hsla.push(rgba[3]);
}
return hsla;
}
/**
* @param {string} color
* @param {number} level
* @return {string}
* @memberOf module:zrender/util/color
*/
function lift(color, level) {
var colorArr = parse(color);
if (colorArr) {
for (var i = 0; i < 3; i++) {
if (level < 0) {
colorArr[i] = colorArr[i] * (1 - level) | 0;
}
else {
colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;
}
}
return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');
}
}
/**
* @param {string} color
* @return {string}
* @memberOf module:zrender/util/color
*/
function toHex(color, level) {
var colorArr = parse(color);
if (colorArr) {
return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);
}
}
/**
* Map value to color. Faster than mapToColor methods because color is represented by rgba array
* @param {number} normalizedValue A float between 0 and 1.
* @param {Array.<Array.<number>>} colors List of rgba color array
* @param {Array.<number>} [out] Mapped gba color array
* @return {Array.<number>}
*/
function fastMapToColor(normalizedValue, colors, out) {
if (!(colors && colors.length)
|| !(normalizedValue >= 0 && normalizedValue <= 1)
) {
return;
}
out = out || [0, 0, 0, 0];
var value = normalizedValue * (colors.length - 1);
var leftIndex = Math.floor(value);
var rightIndex = Math.ceil(value);
var leftColor = colors[leftIndex];
var rightColor = colors[rightIndex];
var dv = value - leftIndex;
out[0] = clampCssByte(lerp(leftColor[0], rightColor[0], dv));
out[1] = clampCssByte(lerp(leftColor[1], rightColor[1], dv));
out[2] = clampCssByte(lerp(leftColor[2], rightColor[2], dv));
out[3] = clampCssByte(lerp(leftColor[3], rightColor[3], dv));
return out;
}
/**
* @param {number} normalizedValue A float between 0 and 1.
* @param {Array.<string>} colors Color list.
* @param {boolean=} fullOutput Default false.
* @return {(string|Object)} Result color. If fullOutput,
* return {color: ..., leftIndex: ..., rightIndex: ..., value: ...},
* @memberOf module:zrender/util/color
*/
function mapToColor(normalizedValue, colors, fullOutput) {
if (!(colors && colors.length)
|| !(normalizedValue >= 0 && normalizedValue <= 1)
) {
return;
}
var value = normalizedValue * (colors.length - 1);
var leftIndex = Math.floor(value);
var rightIndex = Math.ceil(value);
var leftColor = parse(colors[leftIndex]);
var rightColor = parse(colors[rightIndex]);
var dv = value - leftIndex;
var color = stringify(
[
clampCssByte(lerp(leftColor[0], rightColor[0], dv)),
clampCssByte(lerp(leftColor[1], rightColor[1], dv)),
clampCssByte(lerp(leftColor[2], rightColor[2], dv)),
clampCssFloat(lerp(leftColor[3], rightColor[3], dv))
],
'rgba'
);
return fullOutput
? {
color: color,
leftIndex: leftIndex,
rightIndex: rightIndex,
value: value
}
: color;
}
/**
* @param {string} color
* @param {number=} h 0 ~ 360, ignore when null.
* @param {number=} s 0 ~ 1, ignore when null.
* @param {number=} l 0 ~ 1, ignore when null.
* @return {string} Color string in rgba format.
* @memberOf module:zrender/util/color
*/
function modifyHSL(color, h, s, l) {
color = parse(color);
if (color) {
color = rgba2hsla(color);
h != null && (color[0] = clampCssAngle(h));
s != null && (color[1] = parseCssFloat(s));
l != null && (color[2] = parseCssFloat(l));
return stringify(hsla2rgba(color), 'rgba');
}
}
/**
* @param {string} color
* @param {number=} alpha 0 ~ 1
* @return {string} Color string in rgba format.
* @memberOf module:zrender/util/color
*/
function modifyAlpha(color, alpha) {
color = parse(color);
if (color && alpha != null) {
color[3] = clampCssFloat(alpha);
return stringify(color, 'rgba');
}
}
/**
* @param {Array.<string>} colors Color list.
* @param {string} type 'rgba', 'hsva', ...
* @return {string} Result color.
*/
function stringify(arrColor, type) {
if (type === 'rgb' || type === 'hsv' || type === 'hsl') {
arrColor = arrColor.slice(0, 3);
}
return type + '(' + arrColor.join(',') + ')';
}
return {
parse: parse,
lift: lift,
toHex: toHex,
fastMapToColor: fastMapToColor,
mapToColor: mapToColor,
modifyHSL: modifyHSL,
modifyAlpha: modifyAlpha,
stringify: stringify
};
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
If F contains any character other than 'g', 'i', or 'm', or if it
contains the same one more than once, then throw a SyntaxError exception
es5id: 15.10.4.1_A5_T8
description: >
Checking if using "true" as F leads to throwing the correct
exception
---*/
//CHECK#1
try {
$ERROR('#1.1: new RegExp("|",true) throw SyntaxError. Actual: ' + (new RegExp("|",true)));
} catch (e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: new RegExp("|",true) throw SyntaxError. Actual: ' + (e));
}
}
|
"use strict";
/*!
* Copyright 2016 The ANTLR Project. All rights reserved.
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CodePointBuffer = void 0;
const assert = require("assert");
const Character = require("./misc/Character");
/**
* Wrapper for `Uint8Array` / `Uint16Array` / `Int32Array`.
*/
class CodePointBuffer {
constructor(buffer, size) {
this.buffer = buffer;
this._position = 0;
this._size = size;
}
static withArray(buffer) {
return new CodePointBuffer(buffer, buffer.length);
}
get position() {
return this._position;
}
set position(newPosition) {
if (newPosition < 0 || newPosition > this._size) {
throw new RangeError();
}
this._position = newPosition;
}
get remaining() {
return this._size - this.position;
}
get(offset) {
return this.buffer[offset];
}
array() {
return this.buffer.slice(0, this._size);
}
static builder(initialBufferSize) {
return new CodePointBuffer.Builder(initialBufferSize);
}
}
exports.CodePointBuffer = CodePointBuffer;
(function (CodePointBuffer) {
let Type;
(function (Type) {
Type[Type["BYTE"] = 0] = "BYTE";
Type[Type["CHAR"] = 1] = "CHAR";
Type[Type["INT"] = 2] = "INT";
})(Type || (Type = {}));
class Builder {
constructor(initialBufferSize) {
this.type = 0 /* BYTE */;
this.buffer = new Uint8Array(initialBufferSize);
this.prevHighSurrogate = -1;
this.position = 0;
}
build() {
return new CodePointBuffer(this.buffer, this.position);
}
static roundUpToNextPowerOfTwo(i) {
let nextPowerOfTwo = 32 - Math.clz32(i - 1);
return Math.pow(2, nextPowerOfTwo);
}
ensureRemaining(remainingNeeded) {
switch (this.type) {
case 0 /* BYTE */:
if (this.buffer.length - this.position < remainingNeeded) {
let newCapacity = Builder.roundUpToNextPowerOfTwo(this.buffer.length + remainingNeeded);
let newBuffer = new Uint8Array(newCapacity);
newBuffer.set(this.buffer.subarray(0, this.position), 0);
this.buffer = newBuffer;
}
break;
case 1 /* CHAR */:
if (this.buffer.length - this.position < remainingNeeded) {
let newCapacity = Builder.roundUpToNextPowerOfTwo(this.buffer.length + remainingNeeded);
let newBuffer = new Uint16Array(newCapacity);
newBuffer.set(this.buffer.subarray(0, this.position), 0);
this.buffer = newBuffer;
}
break;
case 2 /* INT */:
if (this.buffer.length - this.position < remainingNeeded) {
let newCapacity = Builder.roundUpToNextPowerOfTwo(this.buffer.length + remainingNeeded);
let newBuffer = new Int32Array(newCapacity);
newBuffer.set(this.buffer.subarray(0, this.position), 0);
this.buffer = newBuffer;
}
break;
}
}
append(utf16In) {
this.ensureRemaining(utf16In.length);
this.appendArray(utf16In);
}
appendArray(utf16In) {
switch (this.type) {
case 0 /* BYTE */:
this.appendArrayByte(utf16In);
break;
case 1 /* CHAR */:
this.appendArrayChar(utf16In);
break;
case 2 /* INT */:
this.appendArrayInt(utf16In);
break;
}
}
appendArrayByte(utf16In) {
assert(this.prevHighSurrogate === -1);
let input = utf16In;
let inOffset = 0;
let inLimit = utf16In.length;
let outByte = this.buffer;
let outOffset = this.position;
while (inOffset < inLimit) {
let c = input[inOffset];
if (c <= 0xFF) {
outByte[outOffset] = c;
}
else {
utf16In = utf16In.subarray(inOffset, inLimit);
this.position = outOffset;
if (!Character.isHighSurrogate(c)) {
this.byteToCharBuffer(utf16In.length);
this.appendArrayChar(utf16In);
return;
}
else {
this.byteToIntBuffer(utf16In.length);
this.appendArrayInt(utf16In);
return;
}
}
inOffset++;
outOffset++;
}
this.position = outOffset;
}
appendArrayChar(utf16In) {
assert(this.prevHighSurrogate === -1);
let input = utf16In;
let inOffset = 0;
let inLimit = utf16In.length;
let outChar = this.buffer;
let outOffset = this.position;
while (inOffset < inLimit) {
let c = input[inOffset];
if (!Character.isHighSurrogate(c)) {
outChar[outOffset] = c;
}
else {
utf16In = utf16In.subarray(inOffset, inLimit);
this.position = outOffset;
this.charToIntBuffer(utf16In.length);
this.appendArrayInt(utf16In);
return;
}
inOffset++;
outOffset++;
}
this.position = outOffset;
}
appendArrayInt(utf16In) {
let input = utf16In;
let inOffset = 0;
let inLimit = utf16In.length;
let outInt = this.buffer;
let outOffset = this.position;
while (inOffset < inLimit) {
let c = input[inOffset];
inOffset++;
if (this.prevHighSurrogate !== -1) {
if (Character.isLowSurrogate(c)) {
outInt[outOffset] = String.fromCharCode(this.prevHighSurrogate, c).codePointAt(0);
outOffset++;
this.prevHighSurrogate = -1;
}
else {
// Dangling high surrogate
outInt[outOffset] = this.prevHighSurrogate;
outOffset++;
if (Character.isHighSurrogate(c)) {
this.prevHighSurrogate = c;
}
else {
outInt[outOffset] = c;
outOffset++;
this.prevHighSurrogate = -1;
}
}
}
else if (Character.isHighSurrogate(c)) {
this.prevHighSurrogate = c;
}
else {
outInt[outOffset] = c;
outOffset++;
}
}
if (this.prevHighSurrogate !== -1) {
// Dangling high surrogate
outInt[outOffset] = this.prevHighSurrogate;
outOffset++;
}
this.position = outOffset;
}
byteToCharBuffer(toAppend) {
// CharBuffers hold twice as much per unit as ByteBuffers, so start with half the capacity.
let newBuffer = new Uint16Array(Math.max(this.position + toAppend, this.buffer.length >> 1));
newBuffer.set(this.buffer.subarray(0, this.position), 0);
this.type = 1 /* CHAR */;
this.buffer = newBuffer;
}
byteToIntBuffer(toAppend) {
// IntBuffers hold four times as much per unit as ByteBuffers, so start with one quarter the capacity.
let newBuffer = new Int32Array(Math.max(this.position + toAppend, this.buffer.length >> 2));
newBuffer.set(this.buffer.subarray(0, this.position), 0);
this.type = 2 /* INT */;
this.buffer = newBuffer;
}
charToIntBuffer(toAppend) {
// IntBuffers hold two times as much per unit as ByteBuffers, so start with one half the capacity.
let newBuffer = new Int32Array(Math.max(this.position + toAppend, this.buffer.length >> 1));
newBuffer.set(this.buffer.subarray(0, this.position), 0);
this.type = 2 /* INT */;
this.buffer = newBuffer;
}
}
CodePointBuffer.Builder = Builder;
})(CodePointBuffer = exports.CodePointBuffer || (exports.CodePointBuffer = {}));
//# sourceMappingURL=CodePointBuffer.js.map |
YUI.add('model-list', function (Y, NAME) {
/**
Provides an API for managing an ordered list of Model instances.
@module app
@submodule model-list
@since 3.4.0
**/
/**
Provides an API for managing an ordered list of Model instances.
In addition to providing convenient `add`, `create`, `reset`, and `remove`
methods for managing the models in the list, ModelLists are also bubble targets
for events on the model instances they contain. This means, for example, that
you can add several models to a list, and then subscribe to the `*:change` event
on the list to be notified whenever any model in the list changes.
ModelLists also maintain sort order efficiently as models are added and removed,
based on a custom `comparator` function you may define (if no comparator is
defined, models are sorted in insertion order).
@class ModelList
@extends Base
@uses ArrayList
@constructor
@param {Object} config Config options.
@param {Model|Model[]|ModelList|Object|Object[]} config.items Model
instance, array of model instances, or ModelList to add to this list on
init. The `add` event will not be fired for models added on init.
@since 3.4.0
**/
var AttrProto = Y.Attribute.prototype,
Lang = Y.Lang,
YArray = Y.Array,
/**
Fired when a model is added to the list.
Listen to the `on` phase of this event to be notified before a model is
added to the list. Calling `e.preventDefault()` during the `on` phase will
prevent the model from being added.
Listen to the `after` phase of this event to be notified after a model has
been added to the list.
@event add
@param {Model} model The model being added.
@param {Number} index The index at which the model will be added.
@preventable _defAddFn
**/
EVT_ADD = 'add',
/**
Fired when a model is created or updated via the `create()` method, but
before the model is actually saved or added to the list. The `add` event
will be fired after the model has been saved and added to the list.
@event create
@param {Model} model The model being created/updated.
@since 3.5.0
**/
EVT_CREATE = 'create',
/**
Fired when an error occurs, such as when an attempt is made to add a
duplicate model to the list, or when a sync layer response can't be parsed.
@event error
@param {Any} error Error message, object, or exception generated by the
error. Calling `toString()` on this should result in a meaningful error
message.
@param {String} src Source of the error. May be one of the following (or any
custom error source defined by a ModelList subclass):
* `add`: Error while adding a model (probably because it's already in the
list and can't be added again). The model in question will be provided
as the `model` property on the event facade.
* `parse`: An error parsing a JSON response. The response in question will
be provided as the `response` property on the event facade.
* `remove`: Error while removing a model (probably because it isn't in the
list and can't be removed). The model in question will be provided as
the `model` property on the event facade.
**/
EVT_ERROR = 'error',
/**
Fired after models are loaded from a sync layer.
@event load
@param {Object} parsed The parsed version of the sync layer's response to
the load request.
@param {Mixed} response The sync layer's raw, unparsed response to the load
request.
@since 3.5.0
**/
EVT_LOAD = 'load',
/**
Fired when a model is removed from the list.
Listen to the `on` phase of this event to be notified before a model is
removed from the list. Calling `e.preventDefault()` during the `on` phase
will prevent the model from being removed.
Listen to the `after` phase of this event to be notified after a model has
been removed from the list.
@event remove
@param {Model} model The model being removed.
@param {Number} index The index of the model being removed.
@preventable _defRemoveFn
**/
EVT_REMOVE = 'remove',
/**
Fired when the list is completely reset via the `reset()` method or sorted
via the `sort()` method.
Listen to the `on` phase of this event to be notified before the list is
reset. Calling `e.preventDefault()` during the `on` phase will prevent
the list from being reset.
Listen to the `after` phase of this event to be notified after the list has
been reset.
@event reset
@param {Model[]} models Array of the list's new models after the reset.
@param {String} src Source of the event. May be either `'reset'` or
`'sort'`.
@preventable _defResetFn
**/
EVT_RESET = 'reset';
function ModelList() {
ModelList.superclass.constructor.apply(this, arguments);
}
Y.ModelList = Y.extend(ModelList, Y.Base, {
// -- Public Properties ----------------------------------------------------
/**
The `Model` class or subclass of the models in this list.
The class specified here will be used to create model instances
automatically based on attribute hashes passed to the `add()`, `create()`,
and `reset()` methods.
You may specify the class as an actual class reference or as a string that
resolves to a class reference at runtime (the latter can be useful if the
specified class will be loaded lazily).
@property model
@type Model|String
@default Y.Model
**/
model: Y.Model,
// -- Protected Properties -------------------------------------------------
/**
Total hack to allow us to identify ModelList instances without using
`instanceof`, which won't work when the instance was created in another
window or YUI sandbox.
@property _isYUIModelList
@type Boolean
@default true
@protected
@since 3.5.0
**/
_isYUIModelList: true,
// -- Lifecycle Methods ----------------------------------------------------
initializer: function (config) {
config || (config = {});
var model = this.model = config.model || this.model;
if (typeof model === 'string') {
// Look for a namespaced Model class on `Y`.
this.model = Y.Object.getValue(Y, model.split('.'));
if (!this.model) {
Y.error('ModelList: Model class not found: ' + model);
}
}
this.publish(EVT_ADD, {defaultFn: this._defAddFn});
this.publish(EVT_RESET, {defaultFn: this._defResetFn});
this.publish(EVT_REMOVE, {defaultFn: this._defRemoveFn});
this.after('*:idChange', this._afterIdChange);
this._clear();
if (config.items) {
this.add(config.items, {silent: true});
}
},
destructor: function () {
this._clear();
},
// -- Public Methods -------------------------------------------------------
/**
Adds the specified model or array of models to this list. You may also pass
another ModelList instance, in which case all the models in that list will
be added to this one as well.
@example
// Add a single model instance.
list.add(new Model({foo: 'bar'}));
// Add a single model, creating a new instance automatically.
list.add({foo: 'bar'});
// Add multiple models, creating new instances automatically.
list.add([
{foo: 'bar'},
{baz: 'quux'}
]);
// Add all the models in another ModelList instance.
list.add(otherList);
@method add
@param {Model|Model[]|ModelList|Object|Object[]} models Model or array of
models to add. May be existing model instances or hashes of model
attributes, in which case new model instances will be created from the
hashes. You may also pass a ModelList instance to add all the models it
contains.
@param {Object} [options] Data to be mixed into the event facade of the
`add` event(s) for the added models.
@param {Number} [options.index] Index at which to insert the added
models. If not specified, the models will automatically be inserted
in the appropriate place according to the current sort order as
dictated by the `comparator()` method, if any.
@param {Boolean} [options.silent=false] If `true`, no `add` event(s)
will be fired.
@return {Model|Model[]} Added model or array of added models.
**/
add: function (models, options) {
var isList = models._isYUIModelList;
if (isList || Lang.isArray(models)) {
return YArray.map(isList ? models.toArray() : models, function (model, index) {
var modelOptions = options || {};
// When an explicit insertion index is specified, ensure that
// the index is increased by one for each subsequent item in the
// array.
if ('index' in modelOptions) {
modelOptions = Y.merge(modelOptions, {
index: modelOptions.index + index
});
}
return this._add(model, modelOptions);
}, this);
} else {
return this._add(models, options);
}
},
/**
Define this method to provide a function that takes a model as a parameter
and returns a value by which that model should be sorted relative to other
models in this list.
By default, no comparator is defined, meaning that models will not be sorted
(they'll be stored in the order they're added).
@example
var list = new Y.ModelList({model: Y.Model});
list.comparator = function (model) {
return model.get('id'); // Sort models by id.
};
@method comparator
@param {Model} model Model being sorted.
@return {Number|String} Value by which the model should be sorted relative
to other models in this list.
**/
// comparator is not defined by default
/**
Creates or updates the specified model on the server, then adds it to this
list if the server indicates success.
@method create
@param {Model|Object} model Model to create. May be an existing model
instance or a hash of model attributes, in which case a new model instance
will be created from the hash.
@param {Object} [options] Options to be passed to the model's `sync()` and
`set()` methods and mixed into the `create` and `add` event facades.
@param {Boolean} [options.silent=false] If `true`, no `add` event(s) will
be fired.
@param {Function} [callback] Called when the sync operation finishes.
@param {Error} callback.err If an error occurred, this parameter will
contain the error. If the sync operation succeeded, _err_ will be
falsy.
@param {Any} callback.response The server's response.
@return {Model} Created model.
**/
create: function (model, options, callback) {
var self = this;
// Allow callback as second arg.
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
if (!model._isYUIModel) {
model = new this.model(model);
}
self.fire(EVT_CREATE, Y.merge(options, {
model: model
}));
return model.save(options, function (err) {
if (!err) {
self.add(model, options);
}
if (callback) {
callback.apply(null, arguments);
}
});
},
/**
Executes the supplied function on each model in this list.
By default, the callback function's `this` object will refer to the model
currently being iterated. Specify a `thisObj` to override the `this` object
if desired.
Note: Iteration is performed on a copy of the internal array of models, so
it's safe to delete a model from the list during iteration.
@method each
@param {Function} callback Function to execute on each model.
@param {Model} callback.model Model instance.
@param {Number} callback.index Index of the current model.
@param {ModelList} callback.list The ModelList being iterated.
@param {Object} [thisObj] Object to use as the `this` object when executing
the callback.
@chainable
@since 3.6.0
**/
each: function (callback, thisObj) {
var items = this._items.concat(),
i, item, len;
for (i = 0, len = items.length; i < len; i++) {
item = items[i];
callback.call(thisObj || item, item, i, this);
}
return this;
},
/**
Executes the supplied function on each model in this list. Returns an array
containing the models for which the supplied function returned a truthy
value.
The callback function's `this` object will refer to this ModelList. Use
`Y.bind()` to bind the `this` object to another object if desired.
@example
// Get an array containing only the models whose "enabled" attribute is
// truthy.
var filtered = list.filter(function (model) {
return model.get('enabled');
});
// Get a new ModelList containing only the models whose "enabled"
// attribute is truthy.
var filteredList = list.filter({asList: true}, function (model) {
return model.get('enabled');
});
@method filter
@param {Object} [options] Filter options.
@param {Boolean} [options.asList=false] If truthy, results will be
returned as a new ModelList instance rather than as an array.
@param {Function} callback Function to execute on each model.
@param {Model} callback.model Model instance.
@param {Number} callback.index Index of the current model.
@param {ModelList} callback.list The ModelList being filtered.
@return {Model[]|ModelList} Array of models for which the callback function
returned a truthy value (empty if it never returned a truthy value). If
the `options.asList` option is truthy, a new ModelList instance will be
returned instead of an array.
@since 3.5.0
*/
filter: function (options, callback) {
var filtered = [],
items = this._items,
i, item, len, list;
// Allow options as first arg.
if (typeof options === 'function') {
callback = options;
options = {};
}
for (i = 0, len = items.length; i < len; ++i) {
item = items[i];
if (callback.call(this, item, i, this)) {
filtered.push(item);
}
}
if (options.asList) {
list = new this.constructor({model: this.model});
if (filtered.length) {
list.add(filtered, {silent: true});
}
return list;
} else {
return filtered;
}
},
/**
If _name_ refers to an attribute on this ModelList instance, returns the
value of that attribute. Otherwise, returns an array containing the values
of the specified attribute from each model in this list.
@method get
@param {String} name Attribute name or object property path.
@return {Any|Any[]} Attribute value or array of attribute values.
@see Model.get()
**/
get: function (name) {
if (this.attrAdded(name)) {
return AttrProto.get.apply(this, arguments);
}
return this.invoke('get', name);
},
/**
If _name_ refers to an attribute on this ModelList instance, returns the
HTML-escaped value of that attribute. Otherwise, returns an array containing
the HTML-escaped values of the specified attribute from each model in this
list.
The values are escaped using `Escape.html()`.
@method getAsHTML
@param {String} name Attribute name or object property path.
@return {String|String[]} HTML-escaped value or array of HTML-escaped
values.
@see Model.getAsHTML()
**/
getAsHTML: function (name) {
if (this.attrAdded(name)) {
return Y.Escape.html(AttrProto.get.apply(this, arguments));
}
return this.invoke('getAsHTML', name);
},
/**
If _name_ refers to an attribute on this ModelList instance, returns the
URL-encoded value of that attribute. Otherwise, returns an array containing
the URL-encoded values of the specified attribute from each model in this
list.
The values are encoded using the native `encodeURIComponent()` function.
@method getAsURL
@param {String} name Attribute name or object property path.
@return {String|String[]} URL-encoded value or array of URL-encoded values.
@see Model.getAsURL()
**/
getAsURL: function (name) {
if (this.attrAdded(name)) {
return encodeURIComponent(AttrProto.get.apply(this, arguments));
}
return this.invoke('getAsURL', name);
},
/**
Returns the model with the specified _clientId_, or `null` if not found.
@method getByClientId
@param {String} clientId Client id.
@return {Model} Model, or `null` if not found.
**/
getByClientId: function (clientId) {
return this._clientIdMap[clientId] || null;
},
/**
Returns the model with the specified _id_, or `null` if not found.
Note that models aren't expected to have an id until they're saved, so if
you're working with unsaved models, it may be safer to call
`getByClientId()`.
@method getById
@param {String|Number} id Model id.
@return {Model} Model, or `null` if not found.
**/
getById: function (id) {
return this._idMap[id] || null;
},
/**
Calls the named method on every model in the list. Any arguments provided
after _name_ will be passed on to the invoked method.
@method invoke
@param {String} name Name of the method to call on each model.
@param {Any} [args*] Zero or more arguments to pass to the invoked method.
@return {Any[]} Array of return values, indexed according to the index of
the model on which the method was called.
**/
invoke: function (name /*, args* */) {
var args = [this._items, name].concat(YArray(arguments, 1, true));
return YArray.invoke.apply(YArray, args);
},
/**
Returns the model at the specified _index_.
@method item
@param {Number} index Index of the model to fetch.
@return {Model} The model at the specified index, or `undefined` if there
isn't a model there.
**/
// item() is inherited from ArrayList.
/**
Loads this list of models from the server.
This method delegates to the `sync()` method to perform the actual load
operation, which is an asynchronous action. Specify a _callback_ function to
be notified of success or failure.
If the load operation succeeds, a `reset` event will be fired.
@method load
@param {Object} [options] Options to be passed to `sync()` and to
`reset()` when adding the loaded models. It's up to the custom sync
implementation to determine what options it supports or requires, if any.
@param {Function} [callback] Called when the sync operation finishes.
@param {Error} callback.err If an error occurred, this parameter will
contain the error. If the sync operation succeeded, _err_ will be
falsy.
@param {Any} callback.response The server's response. This value will
be passed to the `parse()` method, which is expected to parse it and
return an array of model attribute hashes.
@chainable
**/
load: function (options, callback) {
var self = this;
// Allow callback as only arg.
if (typeof options === 'function') {
callback = options;
options = {};
}
options || (options = {});
this.sync('read', options, function (err, response) {
var facade = {
options : options,
response: response
},
parsed;
if (err) {
facade.error = err;
facade.src = 'load';
self.fire(EVT_ERROR, facade);
} else {
// Lazy publish.
if (!self._loadEvent) {
self._loadEvent = self.publish(EVT_LOAD, {
preventable: false
});
}
parsed = facade.parsed = self._parse(response);
self.reset(parsed, options);
self.fire(EVT_LOAD, facade);
}
if (callback) {
callback.apply(null, arguments);
}
});
return this;
},
/**
Executes the specified function on each model in this list and returns an
array of the function's collected return values.
@method map
@param {Function} fn Function to execute on each model.
@param {Model} fn.model Current model being iterated.
@param {Number} fn.index Index of the current model in the list.
@param {Model[]} fn.models Array of models being iterated.
@param {Object} [thisObj] `this` object to use when calling _fn_.
@return {Array} Array of return values from _fn_.
**/
map: function (fn, thisObj) {
return YArray.map(this._items, fn, thisObj);
},
/**
Called to parse the _response_ when the list is loaded from the server.
This method receives a server _response_ and is expected to return an array
of model attribute hashes.
The default implementation assumes that _response_ is either an array of
attribute hashes or a JSON string that can be parsed into an array of
attribute hashes. If _response_ is a JSON string and either `Y.JSON` or the
native `JSON` object are available, it will be parsed automatically. If a
parse error occurs, an `error` event will be fired and the model will not be
updated.
You may override this method to implement custom parsing logic if necessary.
@method parse
@param {Any} response Server response.
@return {Object[]} Array of model attribute hashes.
**/
parse: function (response) {
if (typeof response === 'string') {
try {
return Y.JSON.parse(response) || [];
} catch (ex) {
this.fire(EVT_ERROR, {
error : ex,
response: response,
src : 'parse'
});
return null;
}
}
return response || [];
},
/**
Removes the specified model or array of models from this list. You may also
pass another ModelList instance to remove all the models that are in both
that instance and this instance, or pass numerical indices to remove the
models at those indices.
@method remove
@param {Model|Model[]|ModelList|Number|Number[]} models Models or indices of
models to remove.
@param {Object} [options] Data to be mixed into the event facade of the
`remove` event(s) for the removed models.
@param {Boolean} [options.silent=false] If `true`, no `remove` event(s)
will be fired.
@return {Model|Model[]} Removed model or array of removed models.
**/
remove: function (models, options) {
var isList = models._isYUIModelList;
if (isList || Lang.isArray(models)) {
// We can't remove multiple models by index because the indices will
// change as we remove them, so we need to get the actual models
// first.
models = YArray.map(isList ? models.toArray() : models, function (model) {
if (Lang.isNumber(model)) {
return this.item(model);
}
return model;
}, this);
return YArray.map(models, function (model) {
return this._remove(model, options);
}, this);
} else {
return this._remove(models, options);
}
},
/**
Completely replaces all models in the list with those specified, and fires a
single `reset` event.
Use `reset` when you want to add or remove a large number of items at once
with less overhead, and without firing `add` or `remove` events for each
one.
@method reset
@param {Model[]|ModelList|Object[]} [models] Models to add. May be existing
model instances or hashes of model attributes, in which case new model
instances will be created from the hashes. If a ModelList is passed, all
the models in that list will be added to this list. Calling `reset()`
without passing in any models will clear the list.
@param {Object} [options] Data to be mixed into the event facade of the
`reset` event.
@param {Boolean} [options.silent=false] If `true`, no `reset` event will
be fired.
@chainable
**/
reset: function (models, options) {
models || (models = []);
options || (options = {});
var facade = Y.merge({src: 'reset'}, options);
if (models._isYUIModelList) {
models = models.toArray();
} else {
models = YArray.map(models, function (model) {
return model._isYUIModel ? model : new this.model(model);
}, this);
}
facade.models = models;
if (options.silent) {
this._defResetFn(facade);
} else {
// Sort the models before firing the reset event.
if (this.comparator) {
models.sort(Y.bind(this._sort, this));
}
this.fire(EVT_RESET, facade);
}
return this;
},
/**
Executes the supplied function on each model in this list, and stops
iterating if the callback returns `true`.
By default, the callback function's `this` object will refer to the model
currently being iterated. Specify a `thisObj` to override the `this` object
if desired.
Note: Iteration is performed on a copy of the internal array of models, so
it's safe to delete a model from the list during iteration.
@method some
@param {Function} callback Function to execute on each model.
@param {Model} callback.model Model instance.
@param {Number} callback.index Index of the current model.
@param {ModelList} callback.list The ModelList being iterated.
@param {Object} [thisObj] Object to use as the `this` object when executing
the callback.
@return {Boolean} `true` if the callback returned `true` for any item,
`false` otherwise.
@since 3.6.0
**/
some: function (callback, thisObj) {
var items = this._items.concat(),
i, item, len;
for (i = 0, len = items.length; i < len; i++) {
item = items[i];
if (callback.call(thisObj || item, item, i, this)) {
return true;
}
}
return false;
},
/**
Forcibly re-sorts the list.
Usually it shouldn't be necessary to call this method since the list
maintains its sort order when items are added and removed, but if you change
the `comparator` function after items are already in the list, you'll need
to re-sort.
@method sort
@param {Object} [options] Data to be mixed into the event facade of the
`reset` event.
@param {Boolean} [options.silent=false] If `true`, no `reset` event will
be fired.
@param {Boolean} [options.descending=false] If `true`, the sort is
performed in descending order.
@chainable
**/
sort: function (options) {
if (!this.comparator) {
return this;
}
var models = this._items.concat(),
facade;
options || (options = {});
models.sort(Y.rbind(this._sort, this, options));
facade = Y.merge(options, {
models: models,
src : 'sort'
});
if (options.silent) {
this._defResetFn(facade);
} else {
this.fire(EVT_RESET, facade);
}
return this;
},
/**
Override this method to provide a custom persistence implementation for this
list. The default method just calls the callback without actually doing
anything.
This method is called internally by `load()` and its implementations relies
on the callback being called. This effectively means that when a callback is
provided, it must be called at some point for the class to operate correctly.
@method sync
@param {String} action Sync action to perform. May be one of the following:
* `create`: Store a list of newly-created models for the first time.
* `delete`: Delete a list of existing models.
* `read` : Load a list of existing models.
* `update`: Update a list of existing models.
Currently, model lists only make use of the `read` action, but other
actions may be used in future versions.
@param {Object} [options] Sync options. It's up to the custom sync
implementation to determine what options it supports or requires, if any.
@param {Function} [callback] Called when the sync operation finishes.
@param {Error} callback.err If an error occurred, this parameter will
contain the error. If the sync operation succeeded, _err_ will be
falsy.
@param {Any} [callback.response] The server's response. This value will
be passed to the `parse()` method, which is expected to parse it and
return an array of model attribute hashes.
**/
sync: function (/* action, options, callback */) {
var callback = YArray(arguments, 0, true).pop();
if (typeof callback === 'function') {
callback();
}
},
/**
Returns an array containing the models in this list.
@method toArray
@return {Model[]} Array containing the models in this list.
**/
toArray: function () {
return this._items.concat();
},
/**
Returns an array containing attribute hashes for each model in this list,
suitable for being passed to `Y.JSON.stringify()`.
Under the hood, this method calls `toJSON()` on each model in the list and
pushes the results into an array.
@method toJSON
@return {Object[]} Array of model attribute hashes.
@see Model.toJSON()
**/
toJSON: function () {
return this.map(function (model) {
return model.toJSON();
});
},
// -- Protected Methods ----------------------------------------------------
/**
Adds the specified _model_ if it isn't already in this list.
If the model's `clientId` or `id` matches that of a model that's already in
the list, an `error` event will be fired and the model will not be added.
@method _add
@param {Model|Object} model Model or object to add.
@param {Object} [options] Data to be mixed into the event facade of the
`add` event for the added model.
@param {Boolean} [options.silent=false] If `true`, no `add` event will be
fired.
@return {Model} The added model.
@protected
**/
_add: function (model, options) {
var facade, id;
options || (options = {});
if (!model._isYUIModel) {
model = new this.model(model);
}
id = model.get('id');
if (this._clientIdMap[model.get('clientId')]
|| (Lang.isValue(id) && this._idMap[id])) {
this.fire(EVT_ERROR, {
error: 'Model is already in the list.',
model: model,
src : 'add'
});
return;
}
facade = Y.merge(options, {
index: 'index' in options ? options.index : this._findIndex(model),
model: model
});
if (options.silent) {
this._defAddFn(facade);
} else {
this.fire(EVT_ADD, facade);
}
return model;
},
/**
Adds this list as a bubble target for the specified model's events.
@method _attachList
@param {Model} model Model to attach to this list.
@protected
**/
_attachList: function (model) {
// Attach this list and make it a bubble target for the model.
model.lists.push(this);
model.addTarget(this);
},
/**
Clears all internal state and the internal list of models, returning this
list to an empty state. Automatically detaches all models in the list.
@method _clear
@protected
**/
_clear: function () {
YArray.each(this._items, this._detachList, this);
this._clientIdMap = {};
this._idMap = {};
this._items = [];
},
/**
Compares the value _a_ to the value _b_ for sorting purposes. Values are
assumed to be the result of calling a model's `comparator()` method. You can
override this method to implement custom sorting logic, such as a descending
sort or multi-field sorting.
@method _compare
@param {Mixed} a First value to compare.
@param {Mixed} b Second value to compare.
@return {Number} `-1` if _a_ should come before _b_, `0` if they're
equivalent, `1` if _a_ should come after _b_.
@protected
@since 3.5.0
**/
_compare: function (a, b) {
return a < b ? -1 : (a > b ? 1 : 0);
},
/**
Removes this list as a bubble target for the specified model's events.
@method _detachList
@param {Model} model Model to detach.
@protected
**/
_detachList: function (model) {
var index = YArray.indexOf(model.lists, this);
if (index > -1) {
model.lists.splice(index, 1);
model.removeTarget(this);
}
},
/**
Returns the index at which the given _model_ should be inserted to maintain
the sort order of the list.
@method _findIndex
@param {Model} model The model being inserted.
@return {Number} Index at which the model should be inserted.
@protected
**/
_findIndex: function (model) {
var items = this._items,
max = items.length,
min = 0,
item, middle, needle;
if (!this.comparator || !max) {
return max;
}
needle = this.comparator(model);
// Perform an iterative binary search to determine the correct position
// based on the return value of the `comparator` function.
while (min < max) {
middle = (min + max) >> 1; // Divide by two and discard remainder.
item = items[middle];
if (this._compare(this.comparator(item), needle) < 0) {
min = middle + 1;
} else {
max = middle;
}
}
return min;
},
/**
Calls the public, overrideable `parse()` method and returns the result.
Override this method to provide a custom pre-parsing implementation. This
provides a hook for custom persistence implementations to "prep" a response
before calling the `parse()` method.
@method _parse
@param {Any} response Server response.
@return {Object[]} Array of model attribute hashes.
@protected
@see ModelList.parse()
@since 3.7.0
**/
_parse: function (response) {
return this.parse(response);
},
/**
Removes the specified _model_ if it's in this list.
@method _remove
@param {Model|Number} model Model or index of the model to remove.
@param {Object} [options] Data to be mixed into the event facade of the
`remove` event for the removed model.
@param {Boolean} [options.silent=false] If `true`, no `remove` event will
be fired.
@return {Model} Removed model.
@protected
**/
_remove: function (model, options) {
var index, facade;
options || (options = {});
if (Lang.isNumber(model)) {
index = model;
model = this.item(index);
} else {
index = this.indexOf(model);
}
if (index === -1 || !model) {
this.fire(EVT_ERROR, {
error: 'Model is not in the list.',
index: index,
model: model,
src : 'remove'
});
return;
}
facade = Y.merge(options, {
index: index,
model: model
});
if (options.silent) {
this._defRemoveFn(facade);
} else {
this.fire(EVT_REMOVE, facade);
}
return model;
},
/**
Array sort function used by `sort()` to re-sort the models in the list.
@method _sort
@param {Model} a First model to compare.
@param {Model} b Second model to compare.
@param {Object} [options] Options passed from `sort()` function.
@param {Boolean} [options.descending=false] If `true`, the sort is
performed in descending order.
@return {Number} `-1` if _a_ is less than _b_, `0` if equal, `1` if greater
(for ascending order, the reverse for descending order).
@protected
**/
_sort: function (a, b, options) {
var result = this._compare(this.comparator(a), this.comparator(b));
// Early return when items are equal in their sort comparison.
if (result === 0) {
return result;
}
// Flips sign when the sort is to be peformed in descending order.
return options && options.descending ? -result : result;
},
// -- Event Handlers -------------------------------------------------------
/**
Updates the model maps when a model's `id` attribute changes.
@method _afterIdChange
@param {EventFacade} e
@protected
**/
_afterIdChange: function (e) {
var newVal = e.newVal,
prevVal = e.prevVal,
target = e.target;
if (Lang.isValue(prevVal)) {
if (this._idMap[prevVal] === target) {
delete this._idMap[prevVal];
} else {
// The model that changed isn't in this list. Probably just a
// bubbled change event from a nested Model List.
return;
}
} else {
// The model had no previous id. Verify that it exists in this list
// before continuing.
if (this.indexOf(target) === -1) {
return;
}
}
if (Lang.isValue(newVal)) {
this._idMap[newVal] = target;
}
},
// -- Default Event Handlers -----------------------------------------------
/**
Default event handler for `add` events.
@method _defAddFn
@param {EventFacade} e
@protected
**/
_defAddFn: function (e) {
var model = e.model,
id = model.get('id');
this._clientIdMap[model.get('clientId')] = model;
if (Lang.isValue(id)) {
this._idMap[id] = model;
}
this._attachList(model);
this._items.splice(e.index, 0, model);
},
/**
Default event handler for `remove` events.
@method _defRemoveFn
@param {EventFacade} e
@protected
**/
_defRemoveFn: function (e) {
var model = e.model,
id = model.get('id');
this._detachList(model);
delete this._clientIdMap[model.get('clientId')];
if (Lang.isValue(id)) {
delete this._idMap[id];
}
this._items.splice(e.index, 1);
},
/**
Default event handler for `reset` events.
@method _defResetFn
@param {EventFacade} e
@protected
**/
_defResetFn: function (e) {
// When fired from the `sort` method, we don't need to clear the list or
// add any models, since the existing models are sorted in place.
if (e.src === 'sort') {
this._items = e.models.concat();
return;
}
this._clear();
if (e.models.length) {
this.add(e.models, {silent: true});
}
}
}, {
NAME: 'modelList'
});
Y.augment(ModelList, Y.ArrayList);
}, 'patched-v3.18.0', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});
|
define([], function(){
return {
$get: function() {
}
};
}) |
var test = require('tape');
var resolve = require('../');
test('#62: deep module references and the pathFilter', function(t){
t.plan(9);
var resolverDir = __dirname + '/pathfilter/deep_ref';
var pathFilter = function(pkg, x, remainder){
t.equal(pkg.version, "1.2.3");
t.equal(x, resolverDir + '/node_modules/deep/ref');
t.equal(remainder, "ref");
return "alt";
};
resolve('deep/ref', { basedir : resolverDir }, function (err, res, pkg) {
if (err) t.fail(err);
t.equal(pkg.version, "1.2.3");
t.equal(res, resolverDir + '/node_modules/deep/ref.js');
});
resolve('deep/deeper/ref', { basedir: resolverDir },
function(err, res, pkg) {
if(err) t.fail(err);
t.notEqual(pkg, undefined);
t.equal(pkg.version, "1.2.3");
t.equal(res, resolverDir + '/node_modules/deep/deeper/ref.js');
});
resolve('deep/ref', { basedir : resolverDir, pathFilter : pathFilter },
function (err, res, pkg) {
if (err) t.fail(err);
t.equal(res, resolverDir + '/node_modules/deep/alt.js');
});
});
|
/*!
@fullcalendar/rrule v4.0.0-beta.4
Docs & License: https://fullcalendar.io/
(c) 2019 Adam Shaw
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rrule'), require('@fullcalendar/core')) :
typeof define === 'function' && define.amd ? define(['exports', 'rrule', '@fullcalendar/core'], factory) :
(global = global || self, factory(global.FullCalendarRrule = {}, global.rrule, global.FullCalendar));
}(this, function (exports, rrule, core) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var EVENT_DEF_PROPS = {
rrule: null,
duration: core.createDuration
};
var recurring = {
parse: function (rawEvent, allDayDefault, leftoverProps, dateEnv) {
if (rawEvent.rrule != null) {
var props = core.refineProps(rawEvent, EVENT_DEF_PROPS, {}, leftoverProps);
var parsed = parseRRule(props.rrule, allDayDefault, dateEnv);
if (parsed) {
return {
allDay: parsed.allDay,
duration: props.duration,
typeData: parsed.rrule
};
}
}
return null;
},
expand: function (rrule$$1, eventDef, framingRange) {
return rrule$$1.between(framingRange.start, framingRange.end);
}
};
var main = core.createPlugin({
recurringTypes: [recurring]
});
function parseRRule(input, allDayDefault, dateEnv) {
if (typeof input === 'string') {
return {
rrule: rrule.rrulestr(input),
allDay: false
};
}
else if (typeof input === 'object' && input) { // non-null object
var refined = __assign({}, input); // copy
var allDay = allDayDefault;
if (typeof refined.dtstart === 'string') {
var dtstartMeta = dateEnv.createMarkerMeta(refined.dtstart);
if (dtstartMeta) {
refined.dtstart = dtstartMeta.marker;
allDay = dtstartMeta.isTimeUnspecified;
}
else {
delete refined.dtstart;
}
}
if (typeof refined.until === 'string') {
refined.until = dateEnv.createMarker(refined.until);
}
if (refined.freq != null) {
refined.freq = convertConstant(refined.freq);
}
if (refined.wkst != null) {
refined.wkst = convertConstant(refined.wkst);
}
else {
refined.wkst = (dateEnv.weekDow - 1 + 7) % 7; // convert Sunday-first to Monday-first
}
if (refined.byweekday != null) {
refined.byweekday = convertConstants(refined.byweekday); // the plural version
}
if (allDay == null) { // if not specific event after allDayDefault
allDay = true;
}
return {
rrule: new rrule.RRule(refined),
allDay: allDay
};
}
return null;
}
function convertConstants(input) {
if (Array.isArray(input)) {
return input.map(convertConstant);
}
return convertConstant(input);
}
function convertConstant(input) {
if (typeof input === 'string') {
return rrule.RRule[input.toUpperCase()];
}
return input;
}
exports.default = main;
Object.defineProperty(exports, '__esModule', { value: true });
}));
|
/*global define*/
define([
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
'../Core/DeveloperError',
'../Core/Event',
'./createPropertyDescriptor',
'./NodeTransformationProperty',
'./PropertyBag'
], function(
defaultValue,
defined,
defineProperties,
DeveloperError,
Event,
createPropertyDescriptor,
NodeTransformationProperty,
PropertyBag) {
'use strict';
function createNodeTransformationProperty(value) {
return new NodeTransformationProperty(value);
}
function createNodeTransformationPropertyBag(value) {
return new PropertyBag(value, createNodeTransformationProperty);
}
/**
* A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
* The position and orientation of the model is determined by the containing {@link Entity}.
* <p>
* Cesium includes support for glTF geometry, materials, animations, and skinning.
* Cameras and lights are not currently supported.
* </p>
*
* @alias ModelGraphics
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.uri] A string Property specifying the URI of the glTF asset.
* @param {Property} [options.show=true] A boolean Property specifying the visibility of the model.
* @param {Property} [options.scale=1.0] A numeric Property specifying a uniform linear scale.
* @param {Property} [options.minimumPixelSize=0.0] A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
* @param {Property} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
* @param {Property} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
* @param {Property} [options.runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started.
* @param {Property} [options.nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
* @param {Property} [options.shadows=ShadowMode.ENABLED] An enum Property specifying whether the model casts or receives shadows from each light source.
* @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to.
* @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed.
* @param {Property} [options.silhouetteColor=Color.RED] A Property specifying the {@link Color} of the silhouette.
* @param {Property} [options.silhouetteSize=0.0] A numeric Property specifying the size of the silhouette in pixels.
* @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} that blends with the model's rendered color.
* @param {Property} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model.
* @param {Property} [options.colorBlendAmount=0.5] A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
*
* @see {@link http://cesiumjs.org/2014/03/03/Cesium-3D-Models-Tutorial/|3D Models Tutorial}
* @demo {@link http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html|Cesium Sandcastle 3D Models Demo}
*/
function ModelGraphics(options) {
this._show = undefined;
this._showSubscription = undefined;
this._scale = undefined;
this._scaleSubscription = undefined;
this._minimumPixelSize = undefined;
this._minimumPixelSizeSubscription = undefined;
this._maximumScale = undefined;
this._maximumScaleSubscription = undefined;
this._incrementallyLoadTextures = undefined;
this._incrementallyLoadTexturesSubscription = undefined;
this._shadows = undefined;
this._shadowsSubscription = undefined;
this._uri = undefined;
this._uriSubscription = undefined;
this._runAnimations = undefined;
this._runAnimationsSubscription = undefined;
this._nodeTransformations = undefined;
this._nodeTransformationsSubscription = undefined;
this._heightReference = undefined;
this._heightReferenceSubscription = undefined;
this._distanceDisplayCondition = undefined;
this._distanceDisplayConditionSubscription = undefined;
this._silhouetteColor = undefined;
this._silhouetteColorSubscription = undefined;
this._silhouetteSize = undefined;
this._silhouetteSizeSubscription = undefined;
this._color = undefined;
this._colorSubscription = undefined;
this._colorBlendMode = undefined;
this._colorBlendModeSubscription = undefined;
this._colorBlendAmount = undefined;
this._colorBlendAmountSubscription = undefined;
this._definitionChanged = new Event();
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
defineProperties(ModelGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof ModelGraphics.prototype
* @type {Event}
* @readonly
*/
definitionChanged : {
get : function() {
return this._definitionChanged;
}
},
/**
* Gets or sets the boolean Property specifying the visibility of the model.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default true
*/
show : createPropertyDescriptor('show'),
/**
* Gets or sets the numeric Property specifying a uniform linear scale
* for this model. Values greater than 1.0 increase the size of the model while
* values less than 1.0 decrease it.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default 1.0
*/
scale : createPropertyDescriptor('scale'),
/**
* Gets or sets the numeric Property specifying the approximate minimum
* pixel size of the model regardless of zoom. This can be used to ensure that
* a model is visible even when the viewer zooms out. When <code>0.0</code>,
* no minimum size is enforced.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default 0.0
*/
minimumPixelSize : createPropertyDescriptor('minimumPixelSize'),
/**
* Gets or sets the numeric Property specifying the maximum scale
* size of a model. This property is used as an upper limit for
* {@link ModelGraphics#minimumPixelSize}.
* @memberof ModelGraphics.prototype
* @type {Property}
*/
maximumScale : createPropertyDescriptor('maximumScale'),
/**
* Get or sets the boolean Property specifying whether textures
* may continue to stream in after the model is loaded.
* @memberof ModelGraphics.prototype
* @type {Property}
*/
incrementallyLoadTextures : createPropertyDescriptor('incrementallyLoadTextures'),
/**
* Get or sets the enum Property specifying whether the model
* casts or receives shadows from each light source.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default ShadowMode.ENABLED
*/
shadows : createPropertyDescriptor('shadows'),
/**
* Gets or sets the string Property specifying the URI of the glTF asset.
* @memberof ModelGraphics.prototype
* @type {Property}
*/
uri : createPropertyDescriptor('uri'),
/**
* Gets or sets the boolean Property specifying if glTF animations should be run.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default true
*/
runAnimations : createPropertyDescriptor('runAnimations'),
/**
* Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are
* names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
* @memberof ModelGraphics.prototype
* @type {PropertyBag}
*/
nodeTransformations : createPropertyDescriptor('nodeTransformations', undefined, createNodeTransformationPropertyBag),
/**
* Gets or sets the Property specifying the {@link HeightReference}.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default HeightReference.NONE
*/
heightReference : createPropertyDescriptor('heightReference'),
/**
* Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.
* @memberof ModelGraphics.prototype
* @type {Property}
*/
distanceDisplayCondition : createPropertyDescriptor('distanceDisplayCondition'),
/**
* Gets or sets the Property specifying the {@link Color} of the silhouette.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default Color.RED
*/
silhouetteColor: createPropertyDescriptor('silhouetteColor'),
/**
* Gets or sets the numeric Property specifying the size of the silhouette in pixels.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default 0.0
*/
silhouetteSize : createPropertyDescriptor('silhouetteSize'),
/**
* Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default Color.WHITE
*/
color : createPropertyDescriptor('color'),
/**
* Gets or sets the enum Property specifying how the color blends with the model.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default ColorBlendMode.HIGHLIGHT
*/
colorBlendMode : createPropertyDescriptor('colorBlendMode'),
/**
* A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.
* A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
* any value in-between resulting in a mix of the two.
* @memberof ModelGraphics.prototype
* @type {Property}
* @default 0.5
*/
colorBlendAmount : createPropertyDescriptor('colorBlendAmount')
});
/**
* Duplicates this instance.
*
* @param {ModelGraphics} [result] The object onto which to store the result.
* @returns {ModelGraphics} The modified result parameter or a new instance if one was not provided.
*/
ModelGraphics.prototype.clone = function(result) {
if (!defined(result)) {
return new ModelGraphics(this);
}
result.show = this.show;
result.scale = this.scale;
result.minimumPixelSize = this.minimumPixelSize;
result.maximumScale = this.maximumScale;
result.incrementallyLoadTextures = this.incrementallyLoadTextures;
result.shadows = this.shadows;
result.uri = this.uri;
result.runAnimations = this.runAnimations;
result.nodeTransformations = this.nodeTransformations;
result.heightReference = this._heightReference;
result.distanceDisplayCondition = this.distanceDisplayCondition;
result.silhouetteColor = this.silhouetteColor;
result.silhouetteSize = this.silhouetteSize;
result.color = this.color;
result.colorBlendMode = this.colorBlendMode;
result.colorBlendAmount = this.colorBlendAmount;
return result;
};
/**
* Assigns each unassigned property on this object to the value
* of the same property on the provided source object.
*
* @param {ModelGraphics} source The object to be merged into this object.
*/
ModelGraphics.prototype.merge = function(source) {
//>>includeStart('debug', pragmas.debug);
if (!defined(source)) {
throw new DeveloperError('source is required.');
}
//>>includeEnd('debug');
this.show = defaultValue(this.show, source.show);
this.scale = defaultValue(this.scale, source.scale);
this.minimumPixelSize = defaultValue(this.minimumPixelSize, source.minimumPixelSize);
this.maximumScale = defaultValue(this.maximumScale, source.maximumScale);
this.incrementallyLoadTextures = defaultValue(this.incrementallyLoadTextures, source.incrementallyLoadTextures);
this.shadows = defaultValue(this.shadows, source.shadows);
this.uri = defaultValue(this.uri, source.uri);
this.runAnimations = defaultValue(this.runAnimations, source.runAnimations);
this.heightReference = defaultValue(this.heightReference, source.heightReference);
this.distanceDisplayCondition = defaultValue(this.distanceDisplayCondition, source.distanceDisplayCondition);
this.silhouetteColor = defaultValue(this.silhouetteColor, source.silhouetteColor);
this.silhouetteSize = defaultValue(this.silhouetteSize, source.silhouetteSize);
this.color = defaultValue(this.color, source.color);
this.colorBlendMode = defaultValue(this.colorBlendMode, source.colorBlendMode);
this.colorBlendAmount = defaultValue(this.colorBlendAmount, source.colorBlendAmount);
var sourceNodeTransformations = source.nodeTransformations;
if (defined(sourceNodeTransformations)) {
var targetNodeTransformations = this.nodeTransformations;
if (defined(targetNodeTransformations)) {
targetNodeTransformations.merge(sourceNodeTransformations);
} else {
this.nodeTransformations = new PropertyBag(sourceNodeTransformations, createNodeTransformationProperty);
}
}
};
return ModelGraphics;
});
|
(function () {
"use strict";
function UserGroupEditController($scope, $location, $routeParams, userGroupsResource, localizationService, contentEditingHelper, editorService, overlayService) {
var infiniteMode = $scope.model && $scope.model.infiniteMode;
var id = infiniteMode ? $scope.model.id : $routeParams.id;
var create = infiniteMode ? $scope.model.create : $routeParams.create;
var vm = this;
var contentPickerOpen = false;
vm.page = {};
vm.page.rootIcon = "icon-folder";
vm.page.submitButtonLabelKey = infiniteMode ? "buttons_saveAndClose" : "buttons_save";
vm.userGroup = {};
vm.labels = {};
vm.showBackButton = !infiniteMode;
vm.goToPage = goToPage;
vm.openSectionPicker = openSectionPicker;
vm.openContentPicker = openContentPicker;
vm.openMediaPicker = openMediaPicker;
vm.openUserPicker = openUserPicker;
vm.removeSection = removeSection;
vm.removeAssignedPermissions = removeAssignedPermissions;
vm.removeUser = removeUser;
vm.clearStartNode = clearStartNode;
vm.save = save;
vm.openGranularPermissionsPicker = openGranularPermissionsPicker;
vm.setPermissionsForNode = setPermissionsForNode;
function init() {
vm.loading = true;
var labelKeys = [
"general_cancel",
"defaultdialogs_selectContentStartNode",
"defaultdialogs_selectMediaStartNode",
"defaultdialogs_selectNode",
"general_groups",
"content_contentRoot",
"media_mediaRoot"
];
localizationService.localizeMany(labelKeys).then(function (values) {
vm.labels.cancel = values[0];
vm.labels.selectContentStartNode = values[1];
vm.labels.selectMediaStartNode = values[2];
vm.labels.selectNode = values[3];
vm.labels.groups = values[4];
vm.labels.contentRoot = values[5];
vm.labels.mediaRoot = values[6];
});
localizationService.localize("general_add").then(function (name) {
vm.labels.add = name;
});
localizationService.localize("user_noStartNode").then(function (name) {
vm.labels.noStartNode = name;
});
if (create) {
// get user group scaffold
userGroupsResource.getUserGroupScaffold().then(function (userGroup) {
vm.userGroup = userGroup;
setSectionIcon(vm.userGroup.sections);
makeBreadcrumbs();
vm.loading = false;
});
} else {
// get user group
userGroupsResource.getUserGroup(id).then(function (userGroup) {
vm.userGroup = userGroup;
formatGranularPermissionSelection();
setSectionIcon(vm.userGroup.sections);
makeBreadcrumbs();
vm.loading = false;
});
}
}
function save() {
vm.page.saveButtonState = "busy";
contentEditingHelper.contentEditorPerformSave({
saveMethod: userGroupsResource.saveUserGroup,
scope: $scope,
content: vm.userGroup,
rebindCallback: function (orignal, saved) { }
}).then(function (saved) {
vm.userGroup = saved;
if (infiniteMode) {
$scope.model.submit(vm.userGroup);
} else {
formatGranularPermissionSelection();
setSectionIcon(vm.userGroup.sections);
makeBreadcrumbs();
vm.page.saveButtonState = "success";
}
}, function (err) {
vm.page.saveButtonState = "error";
});
}
function goToPage(ancestor) {
$location.path(ancestor.path);
}
function openSectionPicker() {
var currentSelection = [];
Utilities.copy(vm.userGroup.sections, currentSelection);
var sectionPicker = {
selection: currentSelection,
submit: function (model) {
vm.userGroup.sections = model.selection;
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.sectionPicker(sectionPicker);
}
function openContentPicker() {
var contentPicker = {
title: vm.labels.selectContentStartNode,
section: "content",
treeAlias: "content",
hideSubmitButton: true,
hideHeader: false,
submit: function (model) {
if (model.selection) {
vm.userGroup.contentStartNode = model.selection[0];
if (vm.userGroup.contentStartNode.id === "-1") {
vm.userGroup.contentStartNode.name = vm.labels.contentRoot;
vm.userGroup.contentStartNode.icon = "icon-folder";
}
}
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.treePicker(contentPicker);
}
function openMediaPicker() {
var mediaPicker = {
title: vm.labels.selectMediaStartNode,
section: "media",
treeAlias: "media",
entityType: "media",
hideSubmitButton: true,
hideHeader: false,
submit: function (model) {
if (model.selection) {
vm.userGroup.mediaStartNode = model.selection[0];
if (vm.userGroup.mediaStartNode.id === "-1") {
vm.userGroup.mediaStartNode.name = vm.labels.mediaRoot;
vm.userGroup.mediaStartNode.icon = "icon-folder";
}
}
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.treePicker(mediaPicker);
}
function openUserPicker() {
var currentSelection = [];
Utilities.copy(vm.userGroup.users, currentSelection);
var userPicker = {
selection: currentSelection,
submit: function (model) {
vm.userGroup.users = model.selection;
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.userPicker(userPicker);
}
/**
* The granular permissions structure gets returned from the server in the dictionary format with each key being the permission category
* however the list to display the permissions isn't via the dictionary way so we need to format it
*/
function formatGranularPermissionSelection() {
vm.userGroup.assignedPermissions.forEach(function (node) {
formatGranularPermissionSelectionForNode(node);
});
}
function formatGranularPermissionSelectionForNode(node) {
//the dictionary is assigned via node.permissions we will reformat to node.allowedPermissions
node.allowedPermissions = [];
Object.values(node.permissions).forEach(function (permissions) {
permissions.forEach(function (p) {
if (p.checked) {
node.allowedPermissions.push(p);
}
});
});
}
function openGranularPermissionsPicker() {
var contentPicker = {
title: vm.labels.selectNode,
section: "content",
treeAlias: "content",
hideSubmitButton: true,
submit: function (model) {
if (model.selection) {
var node = model.selection[0];
//check if this is already in our selection
var found = _.find(vm.userGroup.assignedPermissions, function (i) {
return i.id === node.id;
});
node = found ? found : node;
setPermissionsForNode(node);
}
},
close: function () {
editorService.close();
}
};
editorService.treePicker(contentPicker);
contentPickerOpen = true;
}
function setPermissionsForNode(node) {
//clone the current defaults to pass to the model
if (!node.permissions) {
node.permissions = Utilities.copy(vm.userGroup.defaultPermissions);
}
vm.nodePermissions = {
node: node,
submit: function (model) {
if (model && model.node && model.node.permissions) {
formatGranularPermissionSelectionForNode(node);
if (!vm.userGroup.assignedPermissions) {
vm.userGroup.assignedPermissions = [];
}
//check if this is already in our selection
var found = _.find(vm.userGroup.assignedPermissions, function (i) {
return i.id === node.id;
});
if (!found) {
vm.userGroup.assignedPermissions.push(node);
}
}
editorService.close();
if (contentPickerOpen) {
editorService.close();
contentPickerOpen = false;
}
},
close: function () {
editorService.close();
}
};
editorService.nodePermissions(vm.nodePermissions);
}
function removeSection(index) {
vm.userGroup.sections.splice(index, 1);
}
function removeAssignedPermissions(index) {
vm.userGroup.assignedPermissions.splice(index, 1);
}
function removeUser(index) {
const dialog = {
view: "views/users/views/overlays/remove.html",
username: vm.userGroup.users[index].username,
userGroupName: vm.userGroup.name.toLowerCase(),
submitButtonLabelKey: "defaultdialogs_yesRemove",
submitButtonStyle: "danger",
submit: function () {
vm.userGroup.users.splice(index, 1);
overlayService.close();
},
close: function () {
overlayService.close();
}
};
overlayService.open(dialog);
}
function clearStartNode(type) {
if (type === "content") {
vm.userGroup.contentStartNode = null;
} else if (type === "media") {
vm.userGroup.mediaStartNode = null;
}
}
function makeBreadcrumbs() {
vm.breadcrumbs = [
{
"name": vm.labels.groups,
"path": "/users/users/groups"
},
{
"name": vm.userGroup.name
}
];
}
function setSectionIcon(sections) {
sections.forEach(function (section) {
section.icon = "icon-section";
});
}
init();
}
angular.module("umbraco").controller("Umbraco.Editors.Users.GroupController", UserGroupEditController);
})();
|
'use strict';
var WhereIterable = function (iterable, predicate) {
var self = this;
self._iterable = iterable;
self._predicate = predicate;
};
module.exports = WhereIterable;
var WhereIterator = require('../iterators/where');
WhereIterable.prototype.getIterator = function () {
var self = this;
return new WhereIterator(self._iterable.getIterator(), self._predicate);
};
WhereIterable.prototype.getColumnNames = function () {
var self = this;
return self._iterable.getColumnNames();
};
|
'use strict';
var getRandomNumber = function (min, max) {
return Math.floor((Math.random() * (max - min + 1)) + min);
};
var generateSecret = function () {
var secret = '';
var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
var length = getRandomNumber(10, 20);
for (var i = 0; i < length; i++) {
secret += characters.charAt(Math.floor(Math.random() * characters.length));
}
return secret;
};
module.exports = generateSecret;
|
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["json2csv"] = factory();
else
root["json2csv"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Module dependencies.
*/
var os = __webpack_require__(2);
var lodashGet = __webpack_require__(3);
var lodashFlatten = __webpack_require__(4);
var lodashUniq = __webpack_require__(5);
var lodashSet = __webpack_require__(6);
var lodashCloneDeep = __webpack_require__(7);
var flatten = __webpack_require__(9);
/**
* @name Json2CsvParams
* @type {Object}
* @property {Array} data - array of JSON objects
* @property {Array} fields - see documentation for details
* @property {String[]} [fieldNames] - names for fields at the same indexes. Must be same length as fields array
* (Optional. Maintained for backwards compatibility. Use fields config object for more features)
* @property {String} [del=","] - delimiter of columns
* @property {String} [defaultValue="<empty>"] - default value to use when missing data
* @property {String} [quotes='"'] - quotes around cell values and column names
* @property {String} [doubleQuotes='"""'] - the value to replace double quotes in strings
* @property {Boolean} [hasCSVColumnTitle=true] - determines whether or not CSV file will contain a title column
* @property {String} [eol=''] - it gets added to each row of data
* @property {String} [newLine] - overrides the default OS line ending (\n on Unix \r\n on Windows)
* @property {Boolean} [flatten=false] - flattens nested JSON using flat (https://www.npmjs.com/package/flat)
* @property {String} [unwindPath] - similar to MongoDB's $unwind, Deconstructs an array field from the input JSON to output a row for each element
* @property {Boolean} [excelStrings] - converts string data into normalized Excel style data
* @property {Boolean} [includeEmptyRows=false] - includes empty rows
*/
/**
* Main function that converts json to csv.
*
* @param {Json2CsvParams} params Function parameters containing data, fields,
* delimiter (default is ','), hasCSVColumnTitle (default is true)
* and default value (default is '')
* @param {Function} [callback] Callback function
* if error, returning error in call back.
* if csv is created successfully, returning csv output to callback.
*/
module.exports = function (params, callback) {
var hasCallback = typeof callback === 'function';
var err;
try {
checkParams(params);
} catch (err) {
if (hasCallback) {
return process.nextTick(function () {
callback(err);
});
} else {
throw err;
}
}
var titles = createColumnTitles(params);
var csv = createColumnContent(params, titles);
if (hasCallback) {
return process.nextTick(function () {
callback(null, csv);
});
} else {
return csv;
}
};
/**
* Check passing params.
*
* Note that this modifies params.
*
* @param {Json2CsvParams} params Function parameters containing data, fields,
* delimiter, default value, mark quotes and hasCSVColumnTitle
*/
function checkParams(params) {
params.data = params.data || [];
// if data is an Object, not in array [{}], then just create 1 item array.
// So from now all data in array of object format.
if (!Array.isArray(params.data)) {
params.data = [params.data];
}
if (params.flatten) {
params.data = params.data.map(flatten);
}
// Set params.fields default to first data element's keys
if (!params.fields && (params.data.length === 0 || typeof params.data[0] !== 'object')) {
throw new Error('params should include "fields" and/or non-empty "data" array of objects');
}
if (!params.fields) {
var dataFields = params.data.map(function (item) {
return Object.keys(item);
});
dataFields = lodashFlatten(dataFields);
params.fields = lodashUniq(dataFields);
}
//#check fieldNames
if (params.fieldNames && params.fieldNames.length !== params.fields.length) {
throw new Error('fieldNames and fields should be of the same length, if fieldNames is provided.');
}
// Get fieldNames from fields
params.fieldNames = params.fields.map(function (field, i) {
if (params.fieldNames && typeof field === 'string') {
return params.fieldNames[i];
}
return (typeof field === 'string') ? field : (field.label || field.value);
});
//#check delimiter
params.del = params.del || ',';
//#check end of line character
params.eol = params.eol || '';
//#check quotation mark
params.quotes = typeof params.quotes === 'string' ? params.quotes : '"';
//#check double quotes
params.doubleQuotes = typeof params.doubleQuotes === 'string' ? params.doubleQuotes : Array(3).join(params.quotes);
//#check default value
params.defaultValue = params.defaultValue;
//#check hasCSVColumnTitle, if it is not explicitly set to false then true.
params.hasCSVColumnTitle = params.hasCSVColumnTitle !== false;
//#check include empty rows, defaults to false
params.includeEmptyRows = params.includeEmptyRows || false;
}
/**
* Create the title row with all the provided fields as column headings
*
* @param {Json2CsvParams} params Function parameters containing data, fields and delimiter
* @returns {String} titles as a string
*/
function createColumnTitles(params) {
var str = '';
//if CSV has column title, then create it
if (params.hasCSVColumnTitle) {
params.fieldNames.forEach(function (element) {
if (str !== '') {
str += params.del;
}
str += JSON.stringify(element).replace(/\"/g, params.quotes);
});
}
return str;
}
/**
* Replace the quotation marks of the field element if needed (can be a not string-like item)
*
* @param {string} stringifiedElement The field element after JSON.stringify()
* @param {string} quotes The params.quotes value. At this point we know that is not equal to double (")
*/
function replaceQuotationMarks(stringifiedElement, quotes) {
var lastCharIndex = stringifiedElement.length - 1;
//check if it's an string-like element
if (stringifiedElement[0] === '"' && stringifiedElement[lastCharIndex] === '"') {
//split the stringified field element because Strings are immutable
var splitElement = stringifiedElement.split('');
//replace the quotation marks
splitElement[0] = quotes;
splitElement[lastCharIndex] = quotes;
//join again
stringifiedElement = splitElement.join('');
}
return stringifiedElement;
}
/**
* Create the content column by column and row by row below the title
*
* @param {Object} params Function parameters containing data, fields and delimiter
* @param {String} str Title row as a string
* @returns {String} csv string
*/
function createColumnContent(params, str) {
var dataRows = createDataRows(params);
dataRows.forEach(function (dataElement) {
//if null do nothing, if empty object without includeEmptyRows do nothing
if (dataElement && (Object.getOwnPropertyNames(dataElement).length > 0 || params.includeEmptyRows)) {
var line = '';
var eol = params.newLine || os.EOL || '\n';
params.fields.forEach(function (fieldElement) {
var val;
var defaultValue = params.defaultValue;
if (typeof fieldElement === 'object' && 'default' in fieldElement) {
defaultValue = fieldElement.default;
}
if (fieldElement && (typeof fieldElement === 'string' || typeof fieldElement.value === 'string')) {
var path = (typeof fieldElement === 'string') ? fieldElement : fieldElement.value;
val = lodashGet(dataElement, path, defaultValue);
} else if (fieldElement && typeof fieldElement.value === 'function') {
var field = {
label: fieldElement.label,
default: fieldElement.default
};
val = fieldElement.value(dataElement, field, params.data);
}
if (val === null || val === undefined){
val = defaultValue;
}
if (val !== undefined) {
var stringifiedElement = JSON.stringify(val);
if (typeof val === 'object') stringifiedElement = JSON.stringify(stringifiedElement);
if (params.quotes !== '"') {
stringifiedElement = replaceQuotationMarks(stringifiedElement, params.quotes);
}
//JSON.stringify('\\') results in a string with two backslash
//characters in it. I.e. '\\\\'.
stringifiedElement = stringifiedElement.replace(/\\\\/g, '\\');
if (params.excelStrings && typeof val === 'string') {
stringifiedElement = '"="' + stringifiedElement + '""';
}
line += stringifiedElement;
}
line += params.del;
});
//remove last delimeter
line = line.substring(0, line.length - 1);
//Replace single quotes with double quotes. Single quotes are preceeded by
//a backslash. Be careful not to remove backslash content from the string.
line = line.split('\\\\').map(function (portion) {
return portion.replace(/\\"/g, params.doubleQuotes);
}).join('\\\\');
//Remove the final excess backslashes from the stringified value.
line = line.replace(/\\\\/g, '\\');
//If header exists, add it, otherwise, print only content
if (str !== '') {
str += eol + line + params.eol;
} else {
str = line + params.eol;
}
}
});
return str;
}
/**
* Performs the unwind logic if necessary to convert single JSON document into multiple rows
* @param params
*/
function createDataRows(params) {
var dataRows = params.data;
if (params.unwindPath) {
dataRows = [];
params.data.forEach(function(dataEl) {
var unwindArray = lodashGet(dataEl, params.unwindPath);
if (Array.isArray(unwindArray)) {
unwindArray.forEach(function(unwindEl) {
var dataCopy = lodashCloneDeep(dataEl);
lodashSet(dataCopy, params.unwindPath, unwindEl);
dataRows.push(dataCopy);
});
} else {
dataRows.push(dataEl);
}
});
}
return dataRows;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/***/ },
/* 1 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
(function () {
try {
cachedSetTimeout = setTimeout;
} catch (e) {
cachedSetTimeout = function () {
throw new Error('setTimeout is not defined');
}
}
try {
cachedClearTimeout = clearTimeout;
} catch (e) {
cachedClearTimeout = function () {
throw new Error('clearTimeout is not defined');
}
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ },
/* 2 */
/***/ function(module, exports) {
exports.endianness = function () { return 'LE' };
exports.hostname = function () {
if (typeof location !== 'undefined') {
return location.hostname
}
else return '';
};
exports.loadavg = function () { return [] };
exports.uptime = function () { return 0 };
exports.freemem = function () {
return Number.MAX_VALUE;
};
exports.totalmem = function () {
return Number.MAX_VALUE;
};
exports.cpus = function () { return [] };
exports.type = function () { return 'Browser' };
exports.release = function () {
if (typeof navigator !== 'undefined') {
return navigator.appVersion;
}
return '';
};
exports.networkInterfaces
= exports.getNetworkInterfaces
= function () { return {} };
exports.arch = function () { return 'javascript' };
exports.platform = function () { return 'browser' };
exports.tmpdir = exports.tmpDir = function () {
return '/tmp';
};
exports.EOL = '\n';
/***/ },
/* 3 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Symbol = root.Symbol,
splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = isKey(path, object) ? [path] : castPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(string);
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 4 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Built-in value references. */
var Symbol = root.Symbol,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array ? array.length : 0;
return length ? baseFlatten(array, 1) : [];
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
module.exports = flatten;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 5 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array ? array.length : 0;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
if (value !== value) {
return baseFindIndex(array, baseIsNaN, fromIndex);
}
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/**
* Checks if a cache value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
Set = getNative(root, 'Set'),
nativeCreate = getNative(Object, 'create');
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each
* element is kept.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length)
? baseUniq(array)
: [];
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = uniq;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 6 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Symbol = root.Symbol,
splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = isKey(path, object) ? [path] : castPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(string);
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
module.exports = set;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, module) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
// Don't return `map.set` because it's not chainable in IE 11.
map.set(pair[0], pair[1]);
return map;
}
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
// Don't return `set.add` because it's not chainable in IE 11.
set.add(value);
return set;
}
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array ? array.length : 0;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
Symbol = root.Symbol,
Uint8Array = root.Uint8Array,
getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeKeys = overArg(Object.keys, Object);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
this.__data__ = new ListCache(entries);
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
}
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
return this.__data__['delete'](key);
}
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var cache = this.__data__;
if (cache instanceof ListCache) {
var pairs = cache.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
return this;
}
cache = this.__data__ = new MapCache(pairs);
}
cache.set(key, value);
return this;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @param {boolean} [isFull] Specify a clone including symbols.
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
var result;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
if (isHostObject(value)) {
return object ? value : {};
}
result = initCloneObject(isFunc ? {} : value);
if (!isDeep) {
return copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, baseClone, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
if (!isArr) {
var props = isFull ? getAllKeys(value) : keys(value);
}
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
});
return result;
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} prototype The object to inherit from.
* @returns {Object} Returns the new object.
*/
function baseCreate(proto) {
return isObject(proto) ? objectCreate(proto) : {};
}
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
/**
* The base implementation of `getTag`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
return objectToString.call(value);
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var result = new buffer.constructor(buffer.length);
buffer.copy(result);
return result;
}
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
assignValue(object, key, newValue === undefined ? source[key] : newValue);
}
return object;
}
/**
* Copies own symbol properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Creates an array of the own enumerable symbol properties of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge < 14, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : undefined;
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object, isDeep, cloneFunc);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object, isDeep, cloneFunc);
case symbolTag:
return cloneSymbol(object);
}
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, true, true);
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = cloneDeep;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(8)(module)))
/***/ },
/* 8 */
/***/ function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
var isBuffer = __webpack_require__(10)
var flat = module.exports = flatten
flatten.flatten = flatten
flatten.unflatten = unflatten
function flatten(target, opts) {
opts = opts || {}
var delimiter = opts.delimiter || '.'
var maxDepth = opts.maxDepth
var output = {}
function step(object, prev, currentDepth) {
currentDepth = currentDepth ? currentDepth : 1
Object.keys(object).forEach(function(key) {
var value = object[key]
var isarray = opts.safe && Array.isArray(value)
var type = Object.prototype.toString.call(value)
var isbuffer = isBuffer(value)
var isobject = (
type === "[object Object]" ||
type === "[object Array]"
)
var newKey = prev
? prev + delimiter + key
: key
if (!isarray && !isbuffer && isobject && Object.keys(value).length &&
(!opts.maxDepth || currentDepth < maxDepth)) {
return step(value, newKey, currentDepth + 1)
}
output[newKey] = value
})
}
step(target)
return output
}
function unflatten(target, opts) {
opts = opts || {}
var delimiter = opts.delimiter || '.'
var overwrite = opts.overwrite || false
var result = {}
var isbuffer = isBuffer(target)
if (isbuffer || Object.prototype.toString.call(target) !== '[object Object]') {
return target
}
// safely ensure that the key is
// an integer.
function getkey(key) {
var parsedKey = Number(key)
return (
isNaN(parsedKey) ||
key.indexOf('.') !== -1
) ? key
: parsedKey
}
Object.keys(target).forEach(function(key) {
var split = key.split(delimiter)
var key1 = getkey(split.shift())
var key2 = getkey(split[0])
var recipient = result
while (key2 !== undefined) {
var type = Object.prototype.toString.call(recipient[key1])
var isobject = (
type === "[object Object]" ||
type === "[object Array]"
)
// do not write over falsey, non-undefined values if overwrite is false
if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') {
return
}
if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) {
recipient[key1] = (
typeof key2 === 'number' &&
!opts.object ? [] : {}
)
}
recipient = recipient[key1]
if (split.length > 0) {
key1 = getkey(split.shift())
key2 = getkey(split[0])
}
}
// unflatten again for 'messy objects'
recipient[key1] = unflatten(target[key], opts)
})
return result
}
/***/ },
/* 10 */
/***/ function(module, exports) {
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
/***/ }
/******/ ])
});
; |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
crypto = require('crypto'),
Profile = mongoose.model('Profile');
/**
* A Validation function for local strategy properties
*/
var validateLocalStrategyProperty = function(property) {
return ((this.provider !== 'local' && !this.updated) || property.length);
};
/**
* A Validation function for optional local strategy properties
*/
var validateLocalStrategyProperty_Optional = function() {
return (this.provider === 'local' && !this.updated);
};
/**
* A Validation function for local strategy password
*/
var validateLocalStrategyPassword = function(password) {
return (this.provider !== 'local' || (password && password.length > 6));
};
/**
* User Schema
*/
var UserSchema = new Schema({
firstName: {
type: String,
trim: true,
default: '',
validate: [validateLocalStrategyProperty, 'Please fill in your first name']
},
lastName: {
type: String,
trim: true,
default: '',
validate: [validateLocalStrategyProperty, 'Please fill in your last name']
},
displayName: {
type: String,
trim: true
},
email: {
type: String,
trim: true,
default: '',
validate: [validateLocalStrategyProperty, 'Please fill in your .edu email'],
match: [/.+\@.+\.edu+/, 'Please fill a valid email address']
},
emailValidated: {
type: Boolean,
default: false
},
username: {
type: String,
unique: 'testing error message',
required: 'Please fill in a username',
trim: true
},
password: {
type: String,
default: '',
validate: [validateLocalStrategyPassword, 'Password should be longer']
},
salt: {
type: String
},
provider: {
type: String,
required: 'Provider is required'
},
providerData: {},
additionalProvidersData: {},
roles: {
type: String,
trim: true,
default: 'Student'
},
updated: {
type: Date
},
created: {
type: Date,
default: Date.now
},
school: {
type: String,
trim: true,
default: ''
},
zipCode: {
type: String,
trim: true,
default: '',
validate: [validateLocalStrategyProperty, 'Please fill in your zip code'],
match: [/(^\d{5}$)|(^\d{5}-\d{4}$)/, 'Please fill in your zip code in the correct format']
},
interests: {
type: [String],
trim: true,
default: []
},
isActive: {
type: Boolean,
default: true
},
/* File handling */
profilePic: {
type: String,
default: 'default.png'
},
resumeDoc: {
type: String,
default: ''
},
profile: {
type: Schema.ObjectId,
ref: 'Profile'
},
/* File handling */
notifications: {
type: [Schema.ObjectId],
ref: 'Notification',
default: []
},
enableEmailNotification: {
type: Boolean,
default: true
},
/* For reset password */
resetPasswordToken: {
type: String
},
resetPasswordExpires: {
type: Date
}
});
/**
* Hook a pre save method to hash the password
*/
UserSchema.pre('save', function(next) {
if (this.password && this.password.length > 6) {
var profile = new Profile({ user : this });
this.profile = profile;
this.salt = new Buffer(crypto.randomBytes(16).toString('base64'), 'base64');
this.password = this.hashPassword(this.password);
profile.save(next);
}
next();
});
/**
* Create instance method for hashing a password
*/
UserSchema.methods.hashPassword = function(password) {
if (this.salt && password) {
return crypto.pbkdf2Sync(password, this.salt, 10000, 64).toString('base64');
} else {
return password;
}
};
/**
* Create instance method for authenticating user
*/
UserSchema.methods.authenticate = function(password) {
return this.password === this.hashPassword(password);
};
/**
* Find possible not used username
*/
UserSchema.statics.findUniqueUsername = function(username, suffix, callback) {
var _this = this;
var possibleUsername = username + (suffix || '');
_this.findOne({
username: possibleUsername
}, function(err, user) {
if (!err) {
if (!user) {
callback(possibleUsername);
} else {
return _this.findUniqueUsername(username, (suffix || 0) + 1, callback);
}
} else {
callback(null);
}
});
};
mongoose.model('User', UserSchema);
|
System.register(["github:aurelia/templating@0.8.7/system/index"], function($__export) {
return { setters: [function(m) { for (var p in m) $__export(p, m[p]); }], execute: function() {} };
}); |
/*!
* Bootstrap-select v1.13.6 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2019 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
!function(e,n){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&module.exports?module.exports=n(require("jquery")):n(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"Nic nen\xed vybr\xe1no",noneResultsText:"\u017d\xe1dn\xe9 v\xfdsledky {0}",countSelectedText:"Ozna\u010deno {0} z {1}",maxOptionsText:["Limit p\u0159ekro\u010den ({n} {var} max)","Limit skupiny p\u0159ekro\u010den ({n} {var} max)",["polo\u017eek","polo\u017eka"]],multipleSeparator:", ",selectAllText:"Vybrat V\u0161e",deselectAllText:"Odzna\u010dit V\u0161e"}}); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.