envjs 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -1
- data/lib/envjs/env.js +3815 -133
- data/lib/envjs/runtime.rb +3 -3
- metadata +2 -2
data/lib/envjs/runtime.rb
CHANGED
@@ -73,6 +73,7 @@ puts = function() {
|
|
73
73
|
EOJS
|
74
74
|
|
75
75
|
master = global["$master"] = evaluate("new Object")
|
76
|
+
master["runtime"] = self
|
76
77
|
master.symbols = [ "Johnson", "Ruby", "print", "debug", "puts", "load", "reload", "whichInterpreter", "multiwindow" ]
|
77
78
|
master.symbols.each { |symbol| master[symbol] = global[symbol] }
|
78
79
|
|
@@ -307,6 +308,7 @@ EOJS
|
|
307
308
|
|
308
309
|
( class << self; self; end ).send :define_method, :evaluate do |*args|
|
309
310
|
( script, file, line, global, scope, fn ) = *args
|
311
|
+
raise "cannot evaluate nil script" if script.nil?
|
310
312
|
# print "eval in " + script[0,50].inspect + scope.inspect + " " + ( scope ? scope.isInner.inspect : "none" ) + "\n"
|
311
313
|
global = nil
|
312
314
|
scope ||= inner
|
@@ -314,16 +316,15 @@ EOJS
|
|
314
316
|
compiled_script = scripts[fn]
|
315
317
|
end
|
316
318
|
compiled_script ||= compile(script, file, line, global)
|
317
|
-
# compiled_script = compile(script, file, line, global)
|
318
319
|
if fn && !scripts[fn]
|
319
320
|
scripts[fn] = compiled_script
|
320
321
|
end
|
321
|
-
# p "?", script
|
322
322
|
evaluate_compiled_script(compiled_script,scope)
|
323
323
|
end
|
324
324
|
|
325
325
|
( class << self; self; end ).send :define_method, :reevaluate do |*args|
|
326
326
|
( script, file, line, global, scope, fn ) = *args
|
327
|
+
raise "cannot evaluate nil script" if script.nil?
|
327
328
|
# print "eval in " + script[0,50].inspect + (scope ? scope.toString() : "nil") + "\n"
|
328
329
|
global = nil
|
329
330
|
scope ||= inner
|
@@ -345,7 +346,6 @@ EOJS
|
|
345
346
|
end
|
346
347
|
|
347
348
|
load Envjs::ENVJS
|
348
|
-
|
349
349
|
end
|
350
350
|
end
|
351
351
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Resig
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2010-02-
|
14
|
+
date: 2010-02-18 00:00:00 -08:00
|
15
15
|
default_executable: envjsrb
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|