OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 typedef SimpleStringResource<char, v8::String::ExternalAsciiStringResource> | 53 typedef SimpleStringResource<char, v8::String::ExternalAsciiStringResource> |
54 SimpleAsciiStringResource; | 54 SimpleAsciiStringResource; |
55 typedef SimpleStringResource<uc16, v8::String::ExternalStringResource> | 55 typedef SimpleStringResource<uc16, v8::String::ExternalStringResource> |
56 SimpleTwoByteStringResource; | 56 SimpleTwoByteStringResource; |
57 | 57 |
58 | 58 |
59 const char* const ExternalizeStringExtension::kSource = | 59 const char* const ExternalizeStringExtension::kSource = |
60 "native function externalizeString();" | 60 "native function externalizeString();" |
61 "native function isAsciiString();"; | 61 "native function isAsciiString();"; |
62 | 62 |
63 | 63 v8::Handle<v8::FunctionTemplate> |
64 v8::Handle<v8::FunctionTemplate> ExternalizeStringExtension::GetNativeFunction( | 64 ExternalizeStringExtension::GetNativeFunctionTemplate( |
65 v8::Handle<v8::String> str) { | 65 v8::Isolate* isolate, v8::Handle<v8::String> str) { |
66 if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) { | 66 if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) { |
67 return v8::FunctionTemplate::New(ExternalizeStringExtension::Externalize); | 67 return v8::FunctionTemplate::New(ExternalizeStringExtension::Externalize); |
68 } else { | 68 } else { |
69 ASSERT(strcmp(*v8::String::Utf8Value(str), "isAsciiString") == 0); | 69 ASSERT(strcmp(*v8::String::Utf8Value(str), "isAsciiString") == 0); |
70 return v8::FunctionTemplate::New(ExternalizeStringExtension::IsAscii); | 70 return v8::FunctionTemplate::New(ExternalizeStringExtension::IsAscii); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 void ExternalizeStringExtension::Externalize( | 75 void ExternalizeStringExtension::Externalize( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 args.GetReturnValue().Set(is_one_byte); | 143 args.GetReturnValue().Set(is_one_byte); |
144 } | 144 } |
145 | 145 |
146 | 146 |
147 void ExternalizeStringExtension::Register() { | 147 void ExternalizeStringExtension::Register() { |
148 static ExternalizeStringExtension externalize_extension; | 148 static ExternalizeStringExtension externalize_extension; |
149 static v8::DeclareExtension declaration(&externalize_extension); | 149 static v8::DeclareExtension declaration(&externalize_extension); |
150 } | 150 } |
151 | 151 |
152 } } // namespace v8::internal | 152 } } // namespace v8::internal |
OLD | NEW |