~cyphermox/cordova-cli/flatten

« back to all changes in this revision

Viewing changes to node_modules/cordova/node_modules/jshint/tests/next/fixtures/reason/proto.js

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2013-12-12 05:26:53 UTC
  • Revision ID: mathieu-tl@ubuntu.com-20131212052653-eatjt8zguqua5qmq
testing the flattenage, yo

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function RangeIterator(range) {
2
 
  this.range = range;
3
 
  this.current = this.range.low;
4
 
}
5
 
 
6
 
function hasKey(object, key) {
7
 
  var original = object.__proto__, result;
8
 
  object.__proto__ = null;
9
 
  result = key in object;
10
 
  object.__proto__ = original;
11
 
  return result;
12
 
}
13
 
 
14
 
RangeIterator.prototype.next = function next() {
15
 
  if (this.current > this.range.high) {
16
 
    throw new Error();
17
 
  } else {
18
 
    return this.current++;
19
 
  }
20
 
};
21
 
 
22
 
function Range(low, high) {
23
 
  this.low = low;
24
 
  this.high = high;
25
 
}
26
 
 
27
 
function SubArray(length) {
28
 
  var result = arguments.length === 1 ? Array(length) : Array.apply(this, arguments);
29
 
  result.__proto__ = SubArray.prototype;
30
 
  return result;
31
 
}
32
 
 
33
 
SubArray.prototype.__proto__ = Array.prototype;
34
 
 
35
 
// Nothing wrong with a function named __proto__
36
 
function __proto__() {
37
 
        return "I have a stupid name!";
38
 
}