Skip to content

Commit

Permalink
replaced uses of old (deprecated) delegated method with objectThatDel…
Browse files Browse the repository at this point in the history
…egatesTo() in Worlds implementation
  • Loading branch information
alexwarth committed Jun 29, 2011
1 parent 2e4dae4 commit eb0daab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Worlds2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2008, 2010 Alessandro Warth <[email protected]>
Copyright (c) 2008, 2010, 2011 Alessandro Warth <[email protected]>
Limitations:
* assignments into the properties of "arguments" (e.g., arguments[5] = 1234) don't modify their respective variables
Expand Down Expand Up @@ -96,7 +96,7 @@ ometa WJSTranslator <: BSJSTranslator {
}

compileWJS = function(code) {
var tree = WJSParser.matchAll(code, "topLevel", undefined, function(m, i) { throw fail.delegated({errorPos: i}) })
var tree = WJSParser.matchAll(code, "topLevel", undefined, function(m, i) { throw objectThatDelegatesTo(fail, {errorPos: i}) })
//print("parsed: " + tree)
var code = WJSTranslator.match(tree, 'trans')
//print("compiled: " + code)
Expand Down
8 changes: 4 additions & 4 deletions Worlds2_Library.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2008, 2010 Alessandro Warth <[email protected]>
// Copyright (c) 2008, 2010, 2011 Alessandro Warth <[email protected]>

DEBUG = false;

Expand Down Expand Up @@ -240,9 +240,9 @@ thisWorld.set(wObject, "prototype", Object.prototype)
thisWorld.set(Object.prototype, "hasOwn", function(p) { return thisWorld.has(this, p) })
thisWorld.set(Object.prototype, "toString", function() { return "" + this })

thisWorld.set(worldProto, "sprout", function() { return this.sprout() })
thisWorld.set(worldProto, "commit", function() { return this.commit() })
thisWorld.set(worldProto, "toString", function() { return "[World " + this.getTag() + "]" })
thisWorld.set(worldProto, "sprout", function() { return this.sprout() })
thisWorld.set(worldProto, "commit", function() { return this.commit() })
thisWorld.set(worldProto, "toString", function() { return "[World " + getTag(this) + "]" })

wWorld = function() { }; thisScope.decl("World", wWorld); thisWorld.set(wWorld, "prototype", worldProto)
wBoolean = function() { }; thisScope.decl("Boolean", wBoolean); thisWorld.set(wBoolean, "prototype", {parent: Object.prototype})
Expand Down

0 comments on commit eb0daab

Please sign in to comment.