41 |
41 |
42 // ECMA 15.10.5 |
42 // ECMA 15.10.5 |
43 |
43 |
44 const ClassInfo RegExpPrototype::info = {"RegExpPrototype", 0, 0, 0}; |
44 const ClassInfo RegExpPrototype::info = {"RegExpPrototype", 0, 0, 0}; |
45 |
45 |
|
46 static const Identifier* execPropertyName = 0; |
|
47 static const Identifier* testPropertyName = 0; |
|
48 |
|
49 |
|
50 struct cleanupStaticRegexpObject { |
|
51 ~cleanupStaticRegexpObject() |
|
52 { |
|
53 delete execPropertyName; |
|
54 delete testPropertyName; |
|
55 |
|
56 execPropertyName = 0; |
|
57 testPropertyName = 0; |
|
58 } |
|
59 }; |
|
60 static cleanupStaticRegexpObject deleteStaticRegexpObject; |
|
61 |
46 RegExpPrototype::RegExpPrototype(ExecState *exec, |
62 RegExpPrototype::RegExpPrototype(ExecState *exec, |
47 ObjectPrototype *objProto, |
63 ObjectPrototype *objProto, |
48 FunctionPrototype *funcProto) |
64 FunctionPrototype *funcProto) |
49 : JSObject(objProto) |
65 : JSObject(objProto) |
50 { |
66 { |
51 static const Identifier* execPropertyName = new Identifier("exec"); |
67 if(!execPropertyName) |
52 static const Identifier* testPropertyName = new Identifier("test"); |
68 execPropertyName = new Identifier("exec"); |
|
69 if(!testPropertyName) |
|
70 testPropertyName = new Identifier("test"); |
53 |
71 |
54 putDirectFunction(new RegExpProtoFunc(exec, funcProto, RegExpProtoFunc::Exec, 0, *execPropertyName), DontEnum); |
72 putDirectFunction(new RegExpProtoFunc(exec, funcProto, RegExpProtoFunc::Exec, 0, *execPropertyName), DontEnum); |
55 putDirectFunction(new RegExpProtoFunc(exec, funcProto, RegExpProtoFunc::Test, 0, *testPropertyName), DontEnum); |
73 putDirectFunction(new RegExpProtoFunc(exec, funcProto, RegExpProtoFunc::Test, 0, *testPropertyName), DontEnum); |
56 putDirectFunction(new RegExpProtoFunc(exec, funcProto, RegExpProtoFunc::ToString, 0, exec->propertyNames().toString), DontEnum); |
74 putDirectFunction(new RegExpProtoFunc(exec, funcProto, RegExpProtoFunc::ToString, 0, exec->propertyNames().toString), DontEnum); |
57 } |
75 } |