Changeset 97
- Timestamp:
- 12/25/07 07:10:00 (1 year ago)
- Files:
-
- branches/1.9/bin (added)
- branches/1.9/bin/walnut.exe (added)
- branches/1.9/bin/walnut.lib (added)
- branches/1.9/makefile (modified) (2 diffs)
- branches/1.9/source/icon.res (added)
- branches/1.9/source/main.d (modified) (1 diff)
- branches/1.9/source/methods.d (modified) (133 diffs)
- branches/1.9/source/structure.d (modified) (14 diffs)
- branches/1.9/source/value.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.9/makefile
r96 r97 14 14 ################# Variables ################# 15 15 16 DFLAGS=-O -release -quiet -c 17 LFLAGS=/ma 18 OBJS=value.obj main.obj methods.obj structure.obj text.obj test.obj 19 SRC=value.d main.d methods.d structure.d text.d test.d 16 DFLAGS=-O -release -quiet -c -Isource 17 LFLAGS=/ma/NOL 18 OBJS=bin\value.obj bin\methods.obj bin\structure.obj bin\text.obj bin\test.obj 20 19 21 20 ################# Make Rules ################ 22 21 23 walnut.exe : 24 rcc -r -32 source\icon.rc -otemporary\icon.res 25 cd source 26 dmd $(DFLAGS) -od..\temporary $(SRC) 27 cd ..\temporary 28 lib -c ..\walnut.lib $(OBJS) 29 dmd -L$(LFLAGS) ..\walnut.exe $(OBJS) icon.res 30 cd .. 22 defaulttarget: bin\walnut.lib bin\walnut.exe 31 23 32 walnut.lib : walnut.exe 24 bin\walnut.lib : $(OBJS) 25 lib -c bin\walnut.lib $(OBJS) 33 26 34 value.obj : value.d 35 dmd -c $(DFLAGS) -inline value.d 27 bin\walnut.exe : bin\walnut.lib bin\main.obj 28 rcc -r -32 source\icon.rc -osource\icon.res 29 dmd bin\walnut.exe -L$(LFLAGS) bin\main.obj bin\walnut.lib source\icon.res 30 31 bin\main.obj : source\main.d 32 dmd -c $(DFLAGS) -odbin source\main.d 33 34 bin\methods.obj : source\methods.d 35 dmd -c $(DFLAGS) -inline -odbin source\methods.d 36 37 bin\structure.obj : source\structure.d 38 dmd -c $(DFLAGS) -odbin source\structure.d 39 40 bin\test.obj : source\test.d 41 dmd -c $(DFLAGS) -odbin source\test.d 42 43 bin\text.obj : source\text.d 44 dmd -c $(DFLAGS) -odbin source\text.d 45 46 bin\value.obj : source\value.d 47 dmd -c $(DFLAGS) -inline -odbin source\value.d 36 48 37 49 ################### Utilities ################ 38 39 defaulttarget: walnut.exe40 50 41 51 release: 42 52 make clean 43 53 make 44 cd temporary45 del $(OBJS)46 cd ..47 54 48 55 clean: 49 cd temporary 50 del $(OBJS) walnut.map 51 cd .. 52 del walnut.bak 53 54 test: 55 rcc -r -32 source\icon.rc -otemporary\icon.res 56 cd source 57 dmd -unittest $(DFLAGS) -od..\temporary $(SRC) 58 cd ..\temporary 59 lib -c ..\walnut.lib $(OBJS) 60 dmd -L$(LFLAGS) ..\walnut.exe $(OBJS) icon.res 61 cd .. 56 del /Q bin\*.* 62 57 63 58 doc: 64 59 cd source 65 dmd -D $(DFLAGS) -Dd..\documentation -od..\temporary $(SRC)60 dmd -D $(DFLAGS) -Dd..\documentation 66 61 cd .. 67 62 … … 69 64 del backupSource.7z 70 65 cd source 71 7z a ..\backupSource.7z $(SRC) icon.res ..\ win32.mak ..\linux.mak..\documentation\license.txt ..\documentation\readme.txt66 7z a ..\backupSource.7z $(SRC) icon.res ..\makefile ..\documentation\license.txt ..\documentation\readme.txt 72 67 cd .. branches/1.9/source/main.d
r95 r97 16 16 structure, 17 17 text; 18 19 pragma(lib,"bin\\walnut.lib"); 18 20 19 21 enum EXIT { branches/1.9/source/methods.d
r96 r97 39 39 Synopsis: Global_eval is called to evaluate a buffer of source code. The method is used even to evaluate file contents; the main script. 40 40 */ 41 static Value Global_eval( inout Value self, inoutValue cc, Value[] arguments ...) {41 static Value Global_eval(Value self, Value cc, Value[] arguments ...) { 42 42 if(!arguments.length || arguments[0].type != TYPE.STRING) 43 43 return UNDEFINED; … … 321 321 Synopsis: Global_parseInt is called to cast a string into an integer. 322 322 */ 323 static Value Global_parseInt( inout Value self, inoutValue cc, Value[] arguments ...) {323 static Value Global_parseInt(Value self, Value cc, Value[] arguments ...) { 324 324 uint base; 325 325 char* s; … … 343 343 Synopsis: Global_parseFloat is called to cast a string into a double. 344 344 */ 345 static Value Global_parseFloat( inout Value self, inoutValue cc, Value[] arguments ...) {345 static Value Global_parseFloat(Value self, Value cc, Value[] arguments ...) { 346 346 if(arguments.length) 347 347 return cast(Value) arguments[0].toDouble(); … … 356 356 Synopsis: 357 357 */ 358 static Value Global_escape( inout Value self, inoutValue cc, Value[] arguments ...) {358 static Value Global_escape(Value self, Value cc, Value[] arguments ...) { 359 359 return UNDEFINED; 360 360 } … … 367 367 Synopsis: 368 368 */ 369 static Value Global_unescape( inout Value self, inoutValue cc, Value[] arguments ...) {369 static Value Global_unescape(Value self, Value cc, Value[] arguments ...) { 370 370 return UNDEFINED; 371 371 } … … 377 377 Synopsis: 378 378 */ 379 static Value Global_isNaN( inout Value self, inoutValue cc, Value[] arguments ...) {379 static Value Global_isNaN(Value self, Value cc, Value[] arguments ...) { 380 380 return cast(Value) (arguments.length && arguments[0].toDouble() != double.nan? true : false); 381 381 } … … 387 387 Synopsis: 388 388 */ 389 static Value Global_isFinite( inout Value self, inoutValue cc, Value[] arguments ...) {389 static Value Global_isFinite(Value self, Value cc, Value[] arguments ...) { 390 390 return cast(Value) (arguments.length && isfinite(arguments[0].toDouble)? true : false ); 391 391 } … … 397 397 Synopsis: 398 398 */ 399 static Value Global_decodeURI( inout Value self, inoutValue cc, Value[] arguments ...) {399 static Value Global_decodeURI(Value self, Value cc, Value[] arguments ...) { 400 400 scope(failure) return UNDEFINED; 401 401 return cast(Value) decode(arguments[0].toString()); … … 408 408 Synopsis: 409 409 */ 410 static Value Global_decodeURIComponent( inout Value self, inoutValue cc, Value[] arguments ...) {410 static Value Global_decodeURIComponent(Value self, Value cc, Value[] arguments ...) { 411 411 scope(failure) return UNDEFINED; 412 412 return cast(Value) decodeComponent(arguments[0].toString()); … … 419 419 Synopsis: 420 420 */ 421 static Value Global_encodeURI( inout Value self, inoutValue cc, Value[] arguments ...) {421 static Value Global_encodeURI(Value self, Value cc, Value[] arguments ...) { 422 422 scope(failure) return UNDEFINED; 423 423 return cast(Value) encode(arguments[0].toString()); … … 430 430 Synopsis: 431 431 */ 432 static Value Global_encodeURIComponent( inout Value self, inoutValue cc, Value[] arguments ...) {432 static Value Global_encodeURIComponent(Value self, Value cc, Value[] arguments ...) { 433 433 scope(failure) return UNDEFINED; 434 434 return cast(Value) encodeComponent(arguments[0].toString()); … … 441 441 Synopsis: 442 442 */ 443 static Value Global_Object( inout Value self, inoutValue cc, Value[] arguments ...) {443 static Value Global_Object(Value self, Value cc, Value[] arguments ...) { 444 444 return Object_prototype_constructor(self,cc,arguments); 445 445 } … … 451 451 Synopsis: Is perfectly equivalent to "new Object()" 452 452 */ 453 static Value Object_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...) {453 static Value Object_prototype_constructor(Value self, Value cc, Value[] arguments ...) { 454 454 Value v; 455 455 v.type = TYPE.OBJECT; … … 465 465 on all types. 466 466 */ 467 static Value Object_prototype_toString( inout Value self, inoutValue cc, Value[] arguments ...) {467 static Value Object_prototype_toString(Value self, Value cc, Value[] arguments ...) { 468 468 return cast(Value) self.toString(); 469 469 } … … 475 475 Synopsis: 476 476 */ 477 static Value Object_prototype_toSource( inout Value self, inoutValue cc, Value[] arguments ...) {477 static Value Object_prototype_toSource(Value self, Value cc, Value[] arguments ...) { 478 478 char[] buffer = "{"; 479 479 bool any = false; … … 497 497 Synopsis: 498 498 */ 499 static Value Object_prototype_valueOf( inout Value self, inoutValue cc, Value[] arguments ...) {499 static Value Object_prototype_valueOf(Value self, Value cc, Value[] arguments ...) { 500 500 return self[TEXT___value__]; 501 501 } … … 507 507 Synopsis: 508 508 */ 509 static Value Object_prototype_hasOwnProperty( inout Value self, inoutValue cc, Value[] arguments ...) {509 static Value Object_prototype_hasOwnProperty(Value self, Value cc, Value[] arguments ...) { 510 510 if(!arguments.length) 511 511 return FALSE; … … 519 519 Synopsis: 520 520 */ 521 static Value Object_prototype_isPrototypeOf( inout Value self, inoutValue cc, Value[] arguments ...) {521 static Value Object_prototype_isPrototypeOf(Value self, Value cc, Value[] arguments ...) { 522 522 if(self.type == TYPE.OBJECT && arguments.length) { 523 523 Value current = arguments[0]; … … 537 537 Synopsis: 538 538 */ 539 static Value Object_prototype_propertyIsEnumerable( inout Value self, inoutValue cc, Value[] arguments ...) {539 static Value Object_prototype_propertyIsEnumerable(Value self, Value cc, Value[] arguments ...) { 540 540 if(!arguments.length) 541 541 return FALSE; … … 544 544 545 545 /** 546 BUGS: Binds null at Value. nf, cannot generate a function from arguments.546 BUGS: Binds null at Value.f, cannot generate a function from arguments. 547 547 Standards: ECMA 15.3.1 548 548 Arguments: arguments[0] = String or Function … … 550 550 Synopsis: 551 551 */ 552 static Value Global_Function( inout Value self, inoutValue cc, Value[] arguments ...) {552 static Value Global_Function(Value self, Value cc, Value[] arguments ...) { 553 553 Value v; 554 554 v.type = TYPE.FUNCTION; 555 v. nf = null;555 v.f = null; 556 556 return v; 557 557 } 558 558 559 559 /** 560 BUGS: Binds null at Value. nf, cannot generate a function from arguments.560 BUGS: Binds null at Value.f, cannot generate a function from arguments. 561 561 Standards: ECMA 15.3.2.1 562 562 Arguments: arguments[0] = String or Function … … 564 564 Synopsis: 565 565 */ 566 static Value Function_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...) {566 static Value Function_prototype_constructor(Value self, Value cc, Value[] arguments ...) { 567 567 Value o, v; 568 568 o.type = TYPE.OBJECT; 569 569 o[TEXT_prototype] = Global[TEXT_Function][TEXT_prototype]; 570 570 o[TEXT___value__].type = TYPE.FUNCTION; 571 o[TEXT___value__]. nf = null;571 o[TEXT___value__].f = null; 572 572 return o; 573 573 } … … 580 580 Synopsis: 581 581 */ 582 static Value Function_prototype_apply( inout Value self, inoutValue cc, Value[] arguments ...) {582 static Value Function_prototype_apply(Value self, Value cc, Value[] arguments ...) { 583 583 return UNDEFINED; 584 584 } … … 591 591 Synopsis: 592 592 */ 593 static Value Function_prototype_call( inout Value self, inoutValue cc, Value[] arguments ...) {593 static Value Function_prototype_call(Value self, Value cc, Value[] arguments ...) { 594 594 if(self.type == TYPE.FUNCTION) 595 return self. nf(self,cc,arguments);595 return self.f(self,cc,arguments); 596 596 } 597 597 … … 602 602 Synopsis: 603 603 */ 604 static Value Global_Array( inout Value self, inoutValue cc, Value[] arguments ...) {604 static Value Global_Array(Value self, Value cc, Value[] arguments ...) { 605 605 /// ECMA 15.4.1.1 606 606 return Array_prototype_constructor(self,cc,arguments); … … 613 613 Synopsis: 614 614 */ 615 static Value Array_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...) {615 static Value Array_prototype_constructor(Value self, Value cc, Value[] arguments ...) { 616 616 Value o; 617 617 Value[] v; … … 633 633 Synopsis: 634 634 */ 635 static Value Array_prototype_toLocaleString( inout Value self, inoutValue cc, Value[] arguments ...) {635 static Value Array_prototype_toLocaleString(Value self, Value cc, Value[] arguments ...) { 636 636 char[] r = "["; 637 637 char c = ','; // this character needs to be locale "list separator" … … 653 653 Synopsis: 654 654 */ 655 static Value Array_prototype_toSource( inout Value self, inoutValue cc, Value[] arguments ...) {655 static Value Array_prototype_toSource(Value self, Value cc, Value[] arguments ...) { 656 656 char[] r = "["; 657 657 if(self.a.length) { … … 672 672 Synopsis: 673 673 */ 674 static Value Array_prototype_concat( inout Value self, inoutValue cc, Value[] arguments ...) {674 static Value Array_prototype_concat(Value self, Value cc, Value[] arguments ...) { 675 675 for(int i = 0; i < arguments.length; i++) { 676 676 if(arguments[i].type == TYPE.ARRAY) { … … 689 689 Synopsis: 690 690 */ 691 static Value Array_prototype_join( inout Value self, inoutValue cc, Value[] arguments ...) {691 static Value Array_prototype_join(Value self, Value cc, Value[] arguments ...) { 692 692 char[] s = ""; 693 693 if(arguments.length) … … 707 707 Synopsis: 708 708 */ 709 static Value Array_prototype_pop( inout Value self, inoutValue cc, Value[] arguments ...) {709 static Value Array_prototype_pop(Value self, Value cc, Value[] arguments ...) { 710 710 if(!self.a.length) 711 711 return UNDEFINED; … … 721 721 Synopsis: 722 722 */ 723 static Value Array_prototype_push( inout Value self, inoutValue cc, Value[] arguments ...) {723 static Value Array_prototype_push(Value self, Value cc, Value[] arguments ...) { 724 724 self.a[$..(arguments.length+$)] = arguments[]; 725 725 return self; … … 732 732 Synopsis: 733 733 */ 734 static Value Array_prototype_reverse( inout Value self, inoutValue cc, Value[] arguments ...) {734 static Value Array_prototype_reverse(Value self, Value cc, Value[] arguments ...) { 735 735 self.a.reverse; 736 736 return self; … … 743 743 Synopsis: 744 744 */ 745 static Value Array_prototype_shift( inout Value self, inoutValue cc, Value[] arguments ...) {745 static Value Array_prototype_shift(Value self, Value cc, Value[] arguments ...) { 746 746 if(!self.a.length) 747 747 return UNDEFINED; … … 757 757 Synopsis: 758 758 */ 759 static Value Array_prototype_slice( inout Value self, inoutValue cc, Value[] arguments ...) {759 static Value Array_prototype_slice(Value self, Value cc, Value[] arguments ...) { 760 760 if(!arguments.length) 761 761 return UNDEFINED; … … 775 775 Synopsis: 776 776 */ 777 static Value Array_prototype_sort( inout Value self, inoutValue cc, Value[] arguments ...) {777 static Value Array_prototype_sort(Value self, Value cc, Value[] arguments ...) { 778 778 if(arguments.length && arguments[0].type == TYPE.FUNCTION) { 779 // sort using arguments[0]. nf as the comparison function.779 // sort using arguments[0].f as the comparison function. 780 780 return self; 781 781 } … … 790 790 Synopsis: 791 791 */ 792 static Value Array_prototype_splice( inout Value self, inoutValue cc, Value[] arguments ...) {792 static Value Array_prototype_splice(Value self, Value cc, Value[] arguments ...) { 793 793 if(!arguments.length) 794 794 return self; … … 817 817 Synopsis: 818 818 */ 819 static Value Array_prototype_unshift( inout Value self, inoutValue cc, Value[] arguments ...) {819 static Value Array_prototype_unshift(Value self, Value cc, Value[] arguments ...) { 820 820 Value[] a; 821 821 a.length = (arguments.length + self.a.length); … … 831 831 Synopsis: 832 832 */ 833 static Value Global_String( inout Value self, inoutValue cc, Value[] arguments ...) {833 static Value Global_String(Value self, Value cc, Value[] arguments ...) { 834 834 return cast(Value) (arguments.length? arguments[0].toString() : TEXT_); 835 835 } … … 841 841 Synopsis: 842 842 */ 843 static Value String_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...) {843 static Value String_prototype_constructor(Value self, Value cc, Value[] arguments ...) { 844 844 Value o; 845 845 o.type = TYPE.OBJECT; … … 855 855 Synopsis: 856 856 */ 857 static Value String_fromCharCode( inout Value self, inoutValue cc, Value[] arguments ...) {857 static Value String_fromCharCode(Value self, Value cc, Value[] arguments ...) { 858 858 Value v; 859 859 v.type = TYPE.STRING; … … 870 870 Synopsis: 871 871 */ 872 static Value String_prototype_charAt( inout Value self, inoutValue cc, Value[] arguments ...) {872 static Value String_prototype_charAt(Value self, Value cc, Value[] arguments ...) { 873 873 if(arguments.length) 874 874 return cast(Value) self.toString()[arguments[0].toInteger()]; … … 881 881 Synopsis: 882 882 */ 883 static Value String_prototype_charCodeAt( inout Value self, inoutValue cc, Value[] arguments ...) {883 static Value String_prototype_charCodeAt(Value self, Value cc, Value[] arguments ...) { 884 884 if(arguments.length) 885 885 return cast(Value) cast(int) self.toString()[arguments[0].toInteger()]; … … 892 892 Synopsis: 893 893 */ 894 static Value String_prototype_concat( inout Value self, inoutValue cc, Value[] arguments ...) {894 static Value String_prototype_concat(Value self, Value cc, Value[] arguments ...) { 895 895 Value v = self.toString(); 896 896 foreach(Value arg; arguments) { … … 906 906 Synopsis: 907 907 */ 908 static Value String_prototype_indexOf( inout Value self, inoutValue cc, Value[] arguments ...) {908 static Value String_prototype_indexOf(Value self, Value cc, Value[] arguments ...) { 909 909 if(arguments.length) { 910 910 if(arguments.length > 1) … … 920 920 Synopsis: 921 921 */ 922 static Value String_prototype_lastIndexOf( inout Value self, inoutValue cc, Value[] arguments ...) {922 static Value String_prototype_lastIndexOf(Value self, Value cc, Value[] arguments ...) { 923 923 if(arguments.length) { 924 924 if(arguments.length > 1) … … 935 935 Synopsis: 936 936 */ 937 static Value String_prototype_localeCompare( inout Value self, inoutValue cc, Value[] arguments ...) {937 static Value String_prototype_localeCompare(Value self, Value cc, Value[] arguments ...) { 938 938 return UNDEFINED; 939 939 } … … 946 946 Synopsis: 947 947 */ 948 static Value String_prototype_match( inout Value self, inoutValue cc, Value[] arguments ...) {948 static Value String_prototype_match(Value self, Value cc, Value[] arguments ...) { 949 949 if(arguments.length && arguments[0].type == TYPE.REGEXP) { 950 950 char[][] m = arguments[0].r.match(self.toString()); … … 964 964 Synopsis: 965 965 */ 966 static Value String_prototype_replace( inout Value self, inoutValue cc, Value[] arguments ...) {966 static Value String_prototype_replace(Value self, Value cc, Value[] arguments ...) { 967 967 if(arguments.length > 1) { 968 968 if(arguments[0].type == TYPE.REGEXP) … … 979 979 Synopsis: 980 980 */ 981 static Value String_prototype_search( inout Value self, inoutValue cc, Value[] arguments ...) {981 static Value String_prototype_search(Value self, Value cc, Value[] arguments ...) { 982 982 if(arguments.length && arguments[0].type == TYPE.REGEXP) 983 983 return cast(Value) arguments[0].r.find(self.toString()); … … 991 991 Synopsis: 992 992 */ 993 static Value String_prototype_slice( inout Value self, inoutValue cc, Value[] arguments ...) {993 static Value String_prototype_slice(Value self, Value cc, Value[] arguments ...) { 994 994 if(!arguments.length) 995 995 return UNDEFINED; … … 1008 1008 Synopsis: 1009 1009 */ 1010 static Value String_prototype_split( inout Value self, inoutValue cc, Value[] arguments ...) {1010 static Value String_prototype_split(Value self, Value cc, Value[] arguments ...) { 1011 1011 Value[] a = []; 1012 1012 int i,j,k, lim = int.max; … … 1052 1052 Synopsis: 1053 1053 */ 1054 static Value String_prototype_substr( inout Value self, inoutValue cc, Value[] arguments ...) {1054 static Value String_prototype_substr(Value self, Value cc, Value[] arguments ...) { 1055 1055 int s, len; 1056 1056 if(arguments.length) { … … 1073 1073 Synopsis: 1074 1074 */ 1075 static Value String_prototype_substring( inout Value self, inoutValue cc, Value[] arguments ...) {1075 static Value String_prototype_substring(Value self, Value cc, Value[] arguments ...) { 1076 1076 int s, x, e = self.s.length; 1077 1077 if(arguments.length) { … … 1098 1098 Synopsis: 1099 1099 */ 1100 static Value String_prototype_toLowerCase( inout Value self, inoutValue cc, Value[] arguments ...) {1100 static Value String_prototype_toLowerCase(Value self, Value cc, Value[] arguments ...) { 1101 1101 return cast(Value) std.string.tolower(self.toString()); 1102 1102 } … … 1108 1108 Synopsis: 1109 1109 */ 1110 static Value String_prototype_toLocaleLowerCase( inout Value self, inoutValue cc, Value[] arguments ...) {1110 static Value String_prototype_toLocaleLowerCase(Value self, Value cc, Value[] arguments ...) { 1111 1111 foreach(char c; self.toString()) { 1112 1112 c = std.uni.toUniLower(c); … … 1121 1121 Synopsis: 1122 1122 */ 1123 static Value String_prototype_toUpperCase( inout Value self, inoutValue cc, Value[] arguments ...) {1123 static Value String_prototype_toUpperCase(Value self, Value cc, Value[] arguments ...) { 1124 1124 return cast(Value) std.string.toupper(self.toString()); 1125 1125 } … … 1131 1131 Synopsis: 1132 1132 */ 1133 static Value String_prototype_toLocaleUpperCase( inout Value self, inoutValue cc, Value[] arguments ...) {1133 static Value String_prototype_toLocaleUpperCase(Value self, Value cc, Value[] arguments ...) { 1134 1134 foreach(char c; self.toString()) { 1135 1135 c = std.uni.toUniUpper(c); … … 1144 1144 Synopsis: returns a boolean value for the value provided. 1145 1145 */ 1146 static Value Global_Boolean( inout Value self, inoutValue cc, Value[] arguments ...){1146 static Value Global_Boolean(Value self, Value cc, Value[] arguments ...){ 1147 1147 return (arguments.length && arguments[0].b)? TRUE : FALSE; 1148 1148 } … … 1154 1154 Synopsis: Creates an Object containing a boolean value. 1155 1155 */ 1156 static Value Boolean_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...){1156 static Value Boolean_prototype_constructor(Value self, Value cc, Value[] arguments ...){ 1157 1157 Value o; 1158 1158 o.type = TYPE.OBJECT; … … 1168 1168 Synopsis: returns a numerical value for the value provided. 1169 1169 */ 1170 static Value Global_Number( inout Value self, inoutValue cc, Value[] arguments ...) {1170 static Value Global_Number(Value self, Value cc, Value[] arguments ...) { 1171 1171 return cast(Value) (arguments.length? arguments[0].toDouble() : 0.0); 1172 1172 } … … 1178 1178 Synopsis: Creates an Object containing a numerical value. 1179 1179 */ 1180 static Value Number_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...) {1180 static Value Number_prototype_constructor(Value self, Value cc, Value[] arguments ...) { 1181 1181 Value o; 1182 1182 o.type = TYPE.OBJECT; … … 1193 1193 Synopsis: 1194 1194 */ 1195 static Value Number_prototype_toFixed( inout Value self, inoutValue cc, Value[] arguments ...) {1195 static Value Number_prototype_toFixed(Value self, Value cc, Value[] arguments ...) { 1196 1196 if(!arguments.length || arguments[0].toDouble() == double.nan) 1197 1197 return cast(Value) double.nan; … … 1206 1206 Synopsis: 1207 1207 */ 1208 static Value Number_prototype_toExponential( inout Value self, inoutValue cc, Value[] arguments ...) {1208 static Value Number_prototype_toExponential(Value self, Value cc, Value[] arguments ...) { 1209 1209 if(!arguments.length || arguments[0].toDouble() == double.nan) 1210 1210 return cast(Value) double.nan; … … 1219 1219 Synopsis: 1220 1220 */ 1221 static Value Number_prototype_toPrecision( inout Value self, inoutValue cc, Value[] arguments ...) {1221 static Value Number_prototype_toPrecision(Value self, Value cc, Value[] arguments ...) { 1222 1222 if(!arguments.length || arguments[0].toDouble() == double.nan) 1223 1223 return cast(Value) double.nan; … … 1231 1231 Synopsis: 1232 1232 */ 1233 static Value Math_abs( inout Value self, inoutValue cc, Value[] arguments ...) {1233 static Value Math_abs(Value self, Value cc, Value[] arguments ...) { 1234 1234 return cast(Value) (arguments.length? fabs(arguments[0].toDouble()) : double.nan); 1235 1235 } … … 1241 1241 Synopsis: 1242 1242 */ 1243 static Value Math_acos( inout Value self, inoutValue cc, Value[] arguments ...) {1243 static Value Math_acos(Value self, Value cc, Value[] arguments ...) { 1244 1244 return cast(Value) (arguments.length? acos(arguments[0].toDouble()) : double.nan); 1245 1245 } … … 1251 1251 Synopsis: 1252 1252 */ 1253 static Value Math_asin( inout Value self, inoutValue cc, Value[] arguments ...) {1253 static Value Math_asin(Value self, Value cc, Value[] arguments ...) { 1254 1254 return cast(Value) (arguments.length? asin(arguments[0].toDouble()) : double.nan); 1255 1255 } … … 1261 1261 Synopsis: 1262 1262 */ 1263 static Value Math_atan( inout Value self, inoutValue cc, Value[] arguments ...) {1263 static Value Math_atan(Value self, Value cc, Value[] arguments ...) { 1264 1264 return cast(Value) (arguments.length? atan(arguments[0].toDouble()) : double.nan); 1265 1265 } … … 1271 1271 Synopsis: 1272 1272 */ 1273 static Value Math_atan2( inout Value self, inoutValue cc, Value[] arguments ...) {1273 static Value Math_atan2(Value self, Value cc, Value[] arguments ...) { 1274 1274 return cast(Value) (arguments.length >= 2? atan2(arguments[0].toDouble(), arguments[1].toDouble()) : double.nan); 1275 1275 } … … 1281 1281 Synopsis: 1282 1282 */ 1283 static Value Math_ceil( inout Value self, inoutValue cc, Value[] arguments ...) {1283 static Value Math_ceil(Value self, Value cc, Value[] arguments ...) { 1284 1284 return cast(Value) (arguments.length? ceil(arguments[0].toDouble()) : double.nan); 1285 1285 } … … 1291 1291 Synopsis: 1292 1292 */ 1293 static Value Math_cos( inout Value self, inoutValue cc, Value[] arguments ...) {1293 static Value Math_cos(Value self, Value cc, Value[] arguments ...) { 1294 1294 return cast(Value) (arguments.length? cos(arguments[0].toDouble()) : double.nan); 1295 1295 } … … 1301 1301 Synopsis: 1302 1302 */ 1303 static Value Math_exp( inout Value self, inoutValue cc, Value[] arguments ...) {1303 static Value Math_exp(Value self, Value cc, Value[] arguments ...) { 1304 1304 return cast(Value) (arguments.length? exp(arguments[0].toDouble()) : double.nan); 1305 1305 } … … 1311 1311 Synopsis: 1312 1312 */ 1313 static Value Math_floor( inout Value self, inoutValue cc, Value[] arguments ...) {1313 static Value Math_floor(Value self, Value cc, Value[] arguments ...) { 1314 1314 return cast(Value) (arguments.length? std.math.floor(arguments[0].toDouble()) : double.nan); 1315 1315 } … … 1321 1321 Synopsis: 1322 1322 */ 1323 static Value Math_log( inout Value self, inoutValue cc, Value[] arguments ...) {1323 static Value Math_log(Value self, Value cc, Value[] arguments ...) { 1324 1324 return cast(Value) (arguments.length? log(arguments[0].toDouble()) : double.nan); 1325 1325 } … … 1331 1331 Synopsis: 1332 1332 */ 1333 static Value Math_max( inout Value self, inoutValue cc, Value[] arguments ...) {1333 static Value Math_max(Value self, Value cc, Value[] arguments ...) { 1334 1334 Value max = -double.infinity; 1335 1335 foreach(Value v; arguments){ … … 1349 1349 Synopsis: 1350 1350 */ 1351 static Value Math_min( inout Value self, inoutValue cc, Value[] arguments ...) {1351 static Value Math_min(Value self, Value cc, Value[] arguments ...) { 1352 1352 Value min = double.infinity; 1353 1353 foreach(Value v; arguments){ … … 1367 1367 Synopsis: 1368 1368 */ 1369 static Value Math_pow( inout Value self, inoutValue cc, Value[] arguments ...) {1369 static Value Math_pow(Value self, Value cc, Value[] arguments ...) { 1370 1370 return cast(Value) (arguments.length >= 2? std.math.pow(arguments[0].toDouble(), arguments[1].toDouble()) : double.nan); 1371 1371 } … … 1378 1378 Synopsis: 1379 1379 */ 1380 static Value Math_random( inout Value self, inoutValue cc, Value[] arguments ...) {1380 static Value Math_random(Value self, Value cc, Value[] arguments ...) { 1381 1381 ulong x = std.random.rand(); 1382 1382 x <<= 21; … … 1394 1394 Synopsis: 1395 1395 */ 1396 static Value Math_round( inout Value self, inoutValue cc, Value[] arguments ...) {1396 static Value Math_round(Value self, Value cc, Value[] arguments ...) { 1397 1397 if(!arguments.length) 1398 1398 return cast(Value) double.nan; … … 1406 1406 Synopsis: 1407 1407 */ 1408 static Value Math_sin( inout Value self, inoutValue cc, Value[] arguments ...) {1408 static Value Math_sin(Value self, Value cc, Value[] arguments ...) { 1409 1409 return cast(Value) (arguments.length? sin(arguments[0].toDouble()) : double.nan); 1410 1410 } … … 1416 1416 Synopsis: 1417 1417 */ 1418 static Value Math_sqrt( inout Value self, inoutValue cc, Value[] arguments ...) {1418 static Value Math_sqrt(Value self, Value cc, Value[] arguments ...) { 1419 1419 return cast(Value) (arguments.length? sqrt(arguments[0].toDouble()) : double.nan); 1420 1420 } … … 1426 1426 Synopsis: 1427 1427 */ 1428 static Value Math_tan( inout Value self, inoutValue cc, Value[] arguments ...) {1428 static Value Math_tan(Value self, Value cc, Value[] arguments ...) { 1429 1429 return cast(Value) (arguments.length? tan(arguments[0].toDouble()) : double.nan); 1430 1430 } … … 1436 1436 Synopsis: 1437 1437 */ 1438 static Value Global_Date( inout Value self, inoutValue cc, Value[] arguments ...) {1438 static Value Global_Date(Value self, Value cc, Value[] arguments ...) { 1439 1439 d_time t = UTCtoLocalTime(getUTCtime()); 1440 1440 return cast(Value) std.date.toString(t); … … 1448 1448 Synopsis: 1449 1449 */ 1450 static Value Date_prototype_constructor( inout Value self, inoutValue cc, Value[] arguments ...) {1450 static Value Date_prototype_constructor(Value self, Value cc, Value[] arguments ...) { 1451 1451 Value o; 1452 1452 o.type = TYPE.OBJECT; … … 1483 1483 Synopsis: 1484 1484 */ 1485 static Value Date_parse( inout Value self, inoutValue cc, Value[] arguments ...) {1485 static Value Date_parse(Value self, Value cc, Value[] arguments ...) { 1486 1486 return cast(Value) (arguments.length? parse(arguments[0].toString()) : d_time_nan); 1487 1487 } … … 1493 1493 Synopsis: 1494 1494 */ 1495 static Value Date_UTC( inout Value self, inoutValue cc, Value[] arguments ...) {1495 static Value Date_UTC(Value self, Value cc, Value[] arguments ...) { 1496 1496 d_time y,m,d,h,mn,s,ms,type; 1497 1497 for(int i = 0; i < arguments.length & 7; i++) { … … 1521 1521 Synopsis: 1522 1522 */ 1523 static Value Date_prototype_toDateString( inout Value self, inoutValue cc, Value[] arguments ...) {1523 static Value Date_prototype_toDateString(Value self, Value cc, Value[] arguments ...) { 1524 1524 return cast(Value) toDateString(LocalTimetoUTC(self.toDate())); 1525 1525 } … … 1531 1531 Synopsis: 1532 1532 */ 1533 static Value Date_prototype_toTimeString( inout Value self, inoutValue cc, Value[] arguments ...) {1533 static Value Date_prototype_toTimeString(Value self, Value cc, Value[] arguments ...) { 1534 1534 return cast(Value) toTimeString(LocalTimetoUTC(self.toDate())); 1535 1535 } … … 1541 1541 Synopsis: 1542 1542 */ 1543 static Value Date_prototype_toLocaleString( inout Value self, inoutValue cc, Value[] arguments ...) {1543 static Value Date_prototype_toLocaleString(Value self, Value cc, Value[] arguments ...) { 1544 1544 return cast(Value) std.date.toString(self.toDate()); 1545 1545 } … … 1551 1551 Synopsis: 1552 1552 */ 1553 static Value Date_prototype_toLocaleDateString( inout Value self, inoutValue cc, Value[] arguments ...) {1553 static Value Date_prototype_toLocaleDateString(Value self, Value cc, Value[] arguments ...) { 1554 1554 return cast(Value) toDateString(self.toDate()); 1555 1555 } … … 1561 1561 Synopsis: 1562 1562 */ 1563 static Value Date_prototype_toLocaleTimeString( inout Value self, inoutValue cc, Value[] arguments ...) {1563 static Value Date_prototype_toLocaleTimeString(Value self, Value cc, Value[] arguments ...) { 1564 1564 return cast(Value) toTimeString(self.toDate()); 1565 1565 } … … 1571 1571 Synopsis: 1572 1572 */ 1573 static Value Date_prototype_getTime( inout Value self, inoutValue cc, Value[] arguments ...) {1573 static Value Date_prototype_getTime(Value self, Value cc, Value[] arguments ...) { 1574 1574 return cast(Value) self.toDate(); 1575 1575 } … … 1582 1582 Synopsis: 1583 1583 */ 1584 static Value Date_prototype_getFullYear( inout Value self, inoutValue cc, Value[] arguments ...) {1584 static Value Date_prototype_getFullYear(Value self, Value cc, Value[] arguments ...) { 1585 1585 Value v = self.toDate(); 1586 1586 v = (v.dt != d_time_nan? YearFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1594 1594 Synopsis: 1595 1595 */ 1596 static Value Date_prototype_getUTCFullYear( inout Value self, inoutValue cc, Value[] arguments ...) {1596 static Value Date_prototype_getUTCFullYear(Value self, Value cc, Value[] arguments ...) { 1597 1597 Value v = self.toDate(); 1598 1598 v = (v.dt != d_time_nan? YearFromTime(v.dt) : d_time_nan); … … 1606 1606 Synopsis: 1607 1607 */ 1608 static Value Date_prototype_getMonth( inout Value self, inoutValue cc, Value[] arguments ...) {1608 static Value Date_prototype_getMonth(Value self, Value cc, Value[] arguments ...) { 1609 1609 Value v = self.toDate(); 1610 1610 v = (v.dt != d_time_nan? MonthFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1618 1618 Synopsis: 1619 1619 */ 1620 static Value Date_prototype_getUTCMonth( inout Value self, inoutValue cc, Value[] arguments ...) {1620 static Value Date_prototype_getUTCMonth(Value self, Value cc, Value[] arguments ...) { 1621 1621 Value v = self.toDate(); 1622 1622 v = (v.dt != d_time_nan? YearFromTime(v.dt) : d_time_nan); … … 1630 1630 Synopsis: 1631 1631 */ 1632 static Value Date_prototype_getDate( inout Value self, inoutValue cc, Value[] arguments ...) {1632 static Value Date_prototype_getDate(Value self, Value cc, Value[] arguments ...) { 1633 1633 Value v = self.toDate(); 1634 1634 v = (v.dt != d_time_nan? DateFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1642 1642 Synopsis: 1643 1643 */ 1644 static Value Date_prototype_getUTCDate( inout Value self, inoutValue cc, Value[] arguments ...) {1644 static Value Date_prototype_getUTCDate(Value self, Value cc, Value[] arguments ...) { 1645 1645 Value v = self.toDate(); 1646 1646 v = (v.dt != d_time_nan? YearFromTime(v.dt) : d_time_nan); … … 1654 1654 Synopsis: 1655 1655 */ 1656 static Value Date_prototype_getDay( inout Value self, inoutValue cc, Value[] arguments ...) {1656 static Value Date_prototype_getDay(Value self, Value cc, Value[] arguments ...) { 1657 1657 Value v = self.toDate(); 1658 1658 v = (v.dt != d_time_nan? WeekDay(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1666 1666 Synopsis: 1667 1667 */ 1668 static Value Date_prototype_getUTCDay( inout Value self, inoutValue cc, Value[] arguments ...) {1668 static Value Date_prototype_getUTCDay(Value self, Value cc, Value[] arguments ...) { 1669 1669 Value v = self.toDate(); 1670 1670 v = (v.dt != d_time_nan? WeekDay(v.dt) : d_time_nan); … … 1678 1678 Synopsis: 1679 1679 */ 1680 static Value Date_prototype_getHours( inout Value self, inoutValue cc, Value[] arguments ...) {1680 static Value Date_prototype_getHours(Value self, Value cc, Value[] arguments ...) { 1681 1681 Value v = self.toDate(); 1682 1682 v = (v.dt != d_time_nan? HourFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1690 1690 Synopsis: 1691 1691 */ 1692 static Value Date_prototype_getUTCHours( inout Value self, inoutValue cc, Value[] arguments ...) {1692 static Value Date_prototype_getUTCHours(Value self, Value cc, Value[] arguments ...) { 1693 1693 Value v = self.toDate(); 1694 1694 v = (v.dt != d_time_nan? HourFromTime(v.dt) : d_time_nan); … … 1702 1702 Synopsis: 1703 1703 */ 1704 static Value Date_prototype_getMinutes( inout Value self, inoutValue cc, Value[] arguments ...) {1704 static Value Date_prototype_getMinutes(Value self, Value cc, Value[] arguments ...) { 1705 1705 Value v = self.toDate(); 1706 1706 v = (v.dt != d_time_nan? MinFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1714 1714 Synopsis: 1715 1715 */ 1716 static Value Date_prototype_getUTCMinutes( inout Value self, inoutValue cc, Value[] arguments ...) {1716 static Value Date_prototype_getUTCMinutes(Value self, Value cc, Value[] arguments ...) { 1717 1717 Value v = self.toDate(); 1718 1718 v = (v.dt != d_time_nan? MinFromTime(v.dt) : d_time_nan); … … 1726 1726 Synopsis: 1727 1727 */ 1728 static Value Date_prototype_getSeconds( inout Value self, inoutValue cc, Value[] arguments ...) {1728 static Value Date_prototype_getSeconds(Value self, Value cc, Value[] arguments ...) { 1729 1729 Value v = self.toDate(); 1730 1730 v = (v.dt != d_time_nan? SecFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1738 1738 Synopsis: 1739 1739 */ 1740 static Value Date_prototype_getUTCSeconds( inout Value self, inoutValue cc, Value[] arguments ...) {1740 static Value Date_prototype_getUTCSeconds(Value self, Value cc, Value[] arguments ...) { 1741 1741 Value v = self.toDate(); 1742 1742 v = (v.dt != d_time_nan? SecFromTime(v.dt) : d_time_nan); … … 1750 1750 Synopsis: 1751 1751 */ 1752 static Value Date_prototype_getMilliseconds( inout Value self, inoutValue cc, Value[] arguments ...) {1752 static Value Date_prototype_getMilliseconds(Value self, Value cc, Value[] arguments ...) { 1753 1753 Value v = self.toDate(); 1754 1754 v = (v.dt != d_time_nan? msFromTime(UTCtoLocalTime(v.dt)) : d_time_nan); … … 1762 1762 Synopsis: 1763 1763 */ 1764 static Value Date_prototype_getUTCMilliseconds( inout Value self, inoutValue cc, Value[] arguments ...) {1764 static Value Date_prototype_getUTCMilliseconds(Value self, Value cc, Value[] arguments ...) { 1765 1765 Value v = self.toDate(); 1766 1766 v = (v.dt != d_time_nan? msFromTime(v.dt) : d_time_nan); … … 1774 1774 Synopsis: 1775 1775 */ 1776 static Value Date_prototype_getTimezoneOffset( inout Value self, inoutValue cc, Value[] arguments ...) {1776 static Value Date_prototype_getTimezoneOffset(Value self, Value cc, Value[] arguments ...) { 1777 1777 Value v = self.toDate(); 1778 1778 v.dt = ((v.dt - UTCtoLocalTime(v.dt)) / 60_000); … … 1786 1786 Synopsis: 1787 1787 */ 1788 static Value Date_prototype_setTime( inout Value self, inoutValue cc, Value[] arguments ...) {1788 static Value Date_prototype_setTime(Value self, Value cc, Value[] arguments ...) { 1789 1789 self = (arguments.length? arguments[0].toDate() : d_time_nan); 1790 1790 return self; … … 1797 1797 Synopsis: 1798 1798 */ 1799 static Value Date_prototype_setMilliseconds( inout Value self, inoutValue cc, Value[] arguments ...) {1799 static Value Date_prototype_setMilliseconds(Value self, Value cc, Value[] arguments ...) { 1800 1800 d_time t, t2, ms; 1801 1801 if(!arguments.length) … … 1816 1816 Synopsis: 1817 1817 */ 1818 static Value Date_prototype_setUTCMilliseconds( inout Value self, inoutValue cc, Value[] arguments ...) {1818 static Value Date_prototype_setUTCMilliseconds(Value self, Value cc, Value[] arguments ...) { 1819 1819 d_time t, t2, ms; 1820 1820 if(!arguments.length) … … 1835 1835 Synopsis: 1836 1836 */ 1837 static Value Date_prototype_setSeconds( inout Value self, inoutValue cc, Value[] arguments ...) {1837 static Value Date_prototype_setSeconds(Value self, Value cc, Value[] arguments ...) { 1838 1838 d_time s,ms,t,t2; 1839 1839 if(self.dt != d_time_nan) { … … 1863 1863 Synopsis: 1864 1864 */ 1865 static Value Date_prototype_setUTCSeconds( inout Value self, inoutValue cc, Value[] arguments ...) {1865 static Value Date_prototype_setUTCSeconds(Value self, Value cc, Value[] arguments ...) { 1866 1866 d_time s,ms,t,t2; 1867 1867 if(self.dt != d_time_nan) { … … 1891 1891 Synopsis: 1892 1892 */ 1893 static Value Date_prototype_setMinutes( inout Value self, inoutValue cc, Value[] arguments ...) {1893 static Value Date_prototype_setMinutes(Value self, Value cc, Value[] arguments ...) { 1894 1894 d_time m,s,ms,t,t2; 1895 1895 if(self.dt != d_time_nan) { … … 1925 1925 Synopsis: 1926 1926 */ 1927 static Value Date_prototype_setUTCMinutes( inout Value self, inoutValue cc, Value[] arguments ...) {1927 static Value Date_prototype_setUTCMinutes(Value self, Value cc, Value[] arguments ...) { 1928 1928 d_time m,s,ms,t,t2; 1929 1929 if(self.dt != d_time_nan) {
