~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tools/eliminator/node_modules/uglify-js/lib/parse-js.js

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
679
679
        this.end = end;
680
680
};
681
681
 
682
 
NodeWithToken.prototype.toString = function() { return this.name; };
 
682
NodeWithToken.prototype = {
 
683
  get length() {
 
684
    return this.name.length;
 
685
  },
 
686
  set length(v) {
 
687
    return this.name.length = v;
 
688
  },
 
689
  replace: function() { return this.name.replace.apply(this.name, arguments); },
 
690
  concat: function() { return this.name.concat.apply(this.name, arguments); },
 
691
  indexOf: function() { return this.name.indexOf.apply(this.name, arguments); },
 
692
  lastIndexOf: function() { return this.name.lastIndexOf.apply(this.name, arguments); },
 
693
  lastIndexOf: function() { return this.name.lastIndexOf.apply(this.name, arguments); },
 
694
  match: function() { return this.name.match.apply(this.name, arguments); },
 
695
  search: function() { return this.name.search.apply(this.name, arguments); },
 
696
  slice: function() { return this.name.slice.apply(this.name, arguments); },
 
697
  split: function() { return this.name.split.apply(this.name, arguments); },
 
698
  substr: function() { return this.name.substr.apply(this.name, arguments); },
 
699
  substring: function() { return this.name.substring.apply(this.name, arguments); },
 
700
  toString: function() { return this.name; },
 
701
  toJSON: function() { return this.name; },
 
702
  valueOf: function() { return this.name; },
 
703
};
683
704
 
684
705
function parse($TEXT, exigent_mode, embed_tokens) {
685
706
 
765
786
                return ex;
766
787
        };
767
788
 
768
 
        function add_tokens(str, start, end) {
769
 
                return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end);
770
 
        };
771
 
 
772
789
        function maybe_embed_tokens(parser) {
773
790
                if (embed_tokens) return function() {
774
791
                        var start = S.token;
775
792
                        var ast = parser.apply(this, arguments);
776
 
                        ast[0] = add_tokens(ast[0], start, prev());
 
793
                        ast.start = start;
 
794
                        ast.end = prev;
777
795
                        return ast;
778
796
                };
779
797
                else return parser;
1314
1332
 
1315
1333
function member(name, array) {
1316
1334
        for (var i = array.length; --i >= 0;)
1317
 
                if (array[i] === name)
 
1335
                if (array[i] == name)
1318
1336
                        return true;
1319
1337
        return false;
1320
1338
};