File: mathgl.js

package info (click to toggle)
mathgl 8.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248,044 kB
  • sloc: cpp: 87,365; ansic: 3,299; javascript: 3,284; pascal: 1,562; python: 52; sh: 51; makefile: 47; f90: 22
file content (29 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** main mathgl namespace */
var mathgl = {
  version: '0.1.0'
}


/**
 * Auxiliary functions.
 */

/** trivial bind implementation */
mathgl.bind = function(func, context) {
  return function() {
    func.apply(context, arguments);
  };
}


/** clone */
mathgl.clone = function(obj) {
  if (obj === null || typeof(obj) != 'object') {
    return obj;
  }
  var temp = new obj.constructor();
  for (var key in obj) {
    temp[key] = mathgl.clone(obj[key]);
  }
  return temp;
}