|
|
| version 1.1, 2001/03/09 08:19:46 | version 1.3, 2001/03/10 12:12:49 |
|---|---|
| Line 16 VClass *string_class; | Line 16 VClass *string_class; |
| static void _length(Request& r, Array *) { | static void _length(Request& r, Array *) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| Value& value=*new(pool) VDouble(pool, r.self->as_string().size()); | Value& value=*new(pool) VDouble(pool, r.self->as_string().size()); |
| r.wcontext->write(value); | r.wcontext->write(value, String::Untaint_lang::NO /*always object, not string*/); |
| } | } |
| static void _int(Request& r, Array *) { | static void _int(Request& r, Array *) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| Value& value=*new(pool) VInt(pool, static_cast<int>(r.self->get_double())); | Value& value=*new(pool) VInt(pool, static_cast<int>(r.self->get_double())); |
| r.wcontext->write(value); | r.wcontext->write(value, String::Untaint_lang::NO /*always object, not string*/); |
| } | } |
| static void _double(Request& r, Array *) { | static void _double(Request& r, Array *) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| Value& value=*new(pool) VDouble(pool, r.self->get_double()); | Value& value=*new(pool) VDouble(pool, r.self->get_double()); |
| r.wcontext->write(value); | r.wcontext->write(value, String::Untaint_lang::NO /*always object, not string*/); |
| } | } |
| void initialize_string_class(Pool& pool) { | void initialize_string_class(Pool& pool, VClass& vclass) { |
| string_class=new(pool) VClass(pool); | |
| // ^string.length[] | // ^string.length[] |
| String& LENGTH_NAME=*new(pool) String(pool); | String& LENGTH_NAME=*new(pool) String(pool); |
| LENGTH_NAME.APPEND_CONST("length"); | LENGTH_NAME.APPEND_CONST("length"); |
| Line 44 void initialize_string_class(Pool& pool) | Line 42 void initialize_string_class(Pool& pool) |
| 0/*params_names*/, 0/*locals_names*/, | 0/*params_names*/, 0/*locals_names*/, |
| 0/*parser_code*/, _length | 0/*parser_code*/, _length |
| ); | ); |
| string_class->add_method(LENGTH_NAME, LENGTH_METHOD); | vclass.add_method(LENGTH_NAME, LENGTH_METHOD); |
| // ^string.int[] | // ^string.int[] |
| String& INT_NAME=*new(pool) String(pool); | String& INT_NAME=*new(pool) String(pool); |
| Line 56 void initialize_string_class(Pool& pool) | Line 54 void initialize_string_class(Pool& pool) |
| 0/*params_names*/, 0/*locals_names*/, | 0/*params_names*/, 0/*locals_names*/, |
| 0/*parser_code*/, _int | 0/*parser_code*/, _int |
| ); | ); |
| string_class->add_method(INT_NAME, INT_METHOD); | vclass.add_method(INT_NAME, INT_METHOD); |
| // ^string.double[] | // ^string.double[] |
| String& DOUBLE_NAME=*new(pool) String(pool); | String& DOUBLE_NAME=*new(pool) String(pool); |
| Line 68 void initialize_string_class(Pool& pool) | Line 66 void initialize_string_class(Pool& pool) |
| 0/*params_names*/, 0/*locals_names*/, | 0/*params_names*/, 0/*locals_names*/, |
| 0/*parser_code*/, _double | 0/*parser_code*/, _double |
| ); | ); |
| string_class->add_method(DOUBLE_NAME, DOUBLE_METHOD); | vclass.add_method(DOUBLE_NAME, DOUBLE_METHOD); |
| } | } |