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

« back to all changes in this revision

Viewing changes to src/library_path.js

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
      }
60
60
      return root + dir;
61
61
    },
62
 
    basename: function(path, ext) {
 
62
    basename: function(path) {
63
63
      // EMSCRIPTEN return '/'' for '/', not an empty string
64
64
      if (path === '/') return '/';
65
 
      var f = PATH.splitPath(path)[2];
66
 
      if (ext && f.substr(-1 * ext.length) === ext) {
67
 
        f = f.substr(0, f.length - ext.length);
68
 
      }
69
 
      return f;
 
65
      var lastSlash = path.lastIndexOf('/');
 
66
      if (lastSlash === -1) return path;
 
67
      return path.substr(lastSlash+1);
70
68
    },
71
69
    extname: function(path) {
72
70
      return PATH.splitPath(path)[3];
73
71
    },
74
72
    join: function() {
75
73
      var paths = Array.prototype.slice.call(arguments, 0);
76
 
      return PATH.normalize(paths.filter(function(p, index) {
77
 
        if (typeof p !== 'string') {
78
 
          throw new TypeError('Arguments to path.join must be strings');
79
 
        }
80
 
        return p;
81
 
      }).join('/'));
 
74
      return PATH.normalize(paths.join('/'));
 
75
    },
 
76
    join2: function(l, r) {
 
77
      return PATH.normalize(l + '/' + r);
82
78
    },
83
79
    resolve: function() {
84
80
      var resolvedPath = '',
134
130
      return outputParts.join('/');
135
131
    }
136
132
  }
137
 
});
 
 
b'\\ No newline at end of file'
 
133
});