Author: ptw
Date: 2007-10-10 09:43:37 -0700 (Wed, 10 Oct 2007)
New Revision: 6785
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
Log:
Change 20071001-ptw-m by [EMAIL PROTECTED] on 2007-10-01 19:55:05 EDT
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Remove old .make trampolines
Bugs Fixed:
LPP-4181 'Remove vestigial .make methods from built-ins'
Technical Reviewer: hminsky (Message-ID: <[EMAIL PROTECTED]>)
QA Reviewer: promanik (Message-Id: <[EMAIL PROTECTED]>)
Details:
We decided we don't need to rewrite all new calls to .make calls,
so these old trampolines can be removed.
Tests:
smokecheck in SWF and DHTML, calendar, amazon
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs 2007-10-10 15:58:02 UTC
(rev 6784)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs 2007-10-10 16:43:37 UTC
(rev 6785)
@@ -136,8 +136,9 @@
/**
* Instance initialize method
*
- * Called by Instance.make as the last operation on a new instance of a class.
- * Arguments are the arguments that were passed to make.
+ * Called by Instance constructor as the last operation on a new
+ * instance of a class. Arguments are the arguments that were passed
+ * to make.
*
* Can be overridden in subclasses, but must call superclass initialze
* if so.
@@ -175,43 +176,7 @@
}
-/**
- * Default Instance factory
- *
- * Make a new instance of a class.
- *
- * @access private
- *
- * @devnote This is just for coherence with the Class interface.
- * Normally new instances will be created by `new _class_`.
- */
-Instance.make = function make () {
- // Should not be called in the new world...
- if ($debug) {
- Debug.info("`%w.%s` is deprecated. Use `new %w` instead.", this,
arguments.callee, this);
- }
- {
- #pragma "passThrough=true"
- if (arguments.length > 0) {
- // We have to work hard to break a conventional constructor into a
- // constructor and initializer when there are args, because
- // Javascript does not support apply of new.
- var constructor = this;
- function xtor () { this.constructor = constructor; };
- xtor.prototype = constructor.prototype;
- var o = new xtor();
- constructor.apply(o, arguments);
- return o;
- }
- return new this();
- }
-};
-
if ($debug) {
- Instance.make._dbg_typename = 'Instance static function';
-};
-
-if ($debug) {
Instance.prototype.addProperty('validateClassStructure', function
validateClassStructure () {
// Verifies that superclass links for nextMethod are correct
var prototype = this.constructor.prototype;
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2007-10-10
15:58:02 UTC (rev 6784)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2007-10-10
16:43:37 UTC (rev 6785)
@@ -10,98 +10,6 @@
*/
/**
- * Trampoline for 'conventional' constructors
- * @access private
- */
-Function.prototype.make = function () {
- #pragma "passThrough=true"
- if (arguments.length > 0) {
- // We have to work too hard to break a conventional constructor
- // into a constructor and initializer when there are args, because
- // Javascript does not support apply of new.
- function xtor () {};
- xtor.prototype = this.prototype;
- var o = new xtor;
- this.apply(o, arguments);
- return o;
- } else {
- return new this;
- }
-}
-
-// Object, Array, and Function constructors can be called as functions
-
-/**
- * @access private
- */
-Object.make = Object;
-
-/**
- * @access private
- */
-Array.make = Array;
-
-/**
- * @access private
- */
-Function.make = Function;
-
-// The String, Boolean, Number, and Date constructors when called as
-// functions, convert rather than constructing, so we have to handle
-// them specifically. We wouldn't have to if you could say `new
-// this.apply(this, arguments)` but Javascript doesn't permit that...
-
-/**
- * @access private
- */
-String.make = function (value) {
- switch (arguments.length) {
- case 0:
- value = "";
- }
- #pragma "passThrough=true"
- return new String(value);
-}
-/**
- * @access private
- */
-Boolean.make = function (value) {
- #pragma "passThrough=true"
- return new Boolean(value);
-}
-/**
- * @access private
- */
-Number.make = function (value) {
- switch (arguments.length) {
- case 0:
- value = +0;
- }
- #pragma "passThrough=true"
- return new Number(value);
-}
-/**
- * @access private
- */
-Date.make = function (year, month, date, hours, minutes, seconds, ms) {
- switch (arguments.length) {
- case 2:
- date = 1;
- case 3:
- hours = 0;
- case 4:
- minutes = 0;
- case 5:
- seconds = 0;
- case 6:
- ms = 0;
- }
- #pragma "passThrough=true"
- return new Date(year, month, date, hours, minutes, seconds, ms);
-}
-
-
-/**
* DHTML/SWF compatibility
*
* @todo 2006-04-07 ptw Remove when _root is eradicated from .lzs
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs 2007-10-10 15:58:02 UTC
(rev 6784)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs 2007-10-10 16:43:37 UTC
(rev 6785)
@@ -1044,7 +1044,7 @@
// TODO: [2005-03-24 ptw] Remove this if we ever enable
// warnings in the LFC as this will be redundant
if ($debug) {
- if ((! x) || (! (x.make instanceof Function))) { Debug.error('Class
for tag %s has not been defined yet', e.name); }
+ if ((! x) || (! (x instanceof Function))) { Debug.error('Class for tag
%s has not been defined yet', e.name); }
}
// TODO: [2005-04-20 ptw] Don't know what this means, preserved
// for posterity:
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins