OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 26 matching lines...) Expand all Loading... |
37 "native function triggerAssertFalse();" | 37 "native function triggerAssertFalse();" |
38 "native function triggerSlowAssertFalse();"; | 38 "native function triggerSlowAssertFalse();"; |
39 | 39 |
40 | 40 |
41 v8::Handle<v8::FunctionTemplate> | 41 v8::Handle<v8::FunctionTemplate> |
42 TriggerFailureExtension::GetNativeFunctionTemplate( | 42 TriggerFailureExtension::GetNativeFunctionTemplate( |
43 v8::Isolate* isolate, | 43 v8::Isolate* isolate, |
44 v8::Handle<v8::String> str) { | 44 v8::Handle<v8::String> str) { |
45 if (strcmp(*v8::String::Utf8Value(str), "triggerCheckFalse") == 0) { | 45 if (strcmp(*v8::String::Utf8Value(str), "triggerCheckFalse") == 0) { |
46 return v8::FunctionTemplate::New( | 46 return v8::FunctionTemplate::New( |
| 47 isolate, |
47 TriggerFailureExtension::TriggerCheckFalse); | 48 TriggerFailureExtension::TriggerCheckFalse); |
48 } else if (strcmp(*v8::String::Utf8Value(str), "triggerAssertFalse") == 0) { | 49 } else if (strcmp(*v8::String::Utf8Value(str), "triggerAssertFalse") == 0) { |
49 return v8::FunctionTemplate::New( | 50 return v8::FunctionTemplate::New( |
| 51 isolate, |
50 TriggerFailureExtension::TriggerAssertFalse); | 52 TriggerFailureExtension::TriggerAssertFalse); |
51 } else { | 53 } else { |
52 CHECK_EQ(0, strcmp(*v8::String::Utf8Value(str), "triggerSlowAssertFalse")); | 54 CHECK_EQ(0, strcmp(*v8::String::Utf8Value(str), "triggerSlowAssertFalse")); |
53 return v8::FunctionTemplate::New( | 55 return v8::FunctionTemplate::New( |
| 56 isolate, |
54 TriggerFailureExtension::TriggerSlowAssertFalse); | 57 TriggerFailureExtension::TriggerSlowAssertFalse); |
55 } | 58 } |
56 } | 59 } |
57 | 60 |
58 | 61 |
59 void TriggerFailureExtension::TriggerCheckFalse( | 62 void TriggerFailureExtension::TriggerCheckFalse( |
60 const v8::FunctionCallbackInfo<v8::Value>& args) { | 63 const v8::FunctionCallbackInfo<v8::Value>& args) { |
61 CHECK(false); | 64 CHECK(false); |
62 } | 65 } |
63 | 66 |
64 | 67 |
65 void TriggerFailureExtension::TriggerAssertFalse( | 68 void TriggerFailureExtension::TriggerAssertFalse( |
66 const v8::FunctionCallbackInfo<v8::Value>& args) { | 69 const v8::FunctionCallbackInfo<v8::Value>& args) { |
67 ASSERT(false); | 70 ASSERT(false); |
68 } | 71 } |
69 | 72 |
70 | 73 |
71 void TriggerFailureExtension::TriggerSlowAssertFalse( | 74 void TriggerFailureExtension::TriggerSlowAssertFalse( |
72 const v8::FunctionCallbackInfo<v8::Value>& args) { | 75 const v8::FunctionCallbackInfo<v8::Value>& args) { |
73 SLOW_ASSERT(false); | 76 SLOW_ASSERT(false); |
74 } | 77 } |
75 | 78 |
76 | 79 |
77 void TriggerFailureExtension::Register() { | 80 void TriggerFailureExtension::Register() { |
78 static TriggerFailureExtension trigger_failure_extension; | 81 static TriggerFailureExtension trigger_failure_extension; |
79 static v8::DeclareExtension declaration(&trigger_failure_extension); | 82 static v8::DeclareExtension declaration(&trigger_failure_extension); |
80 } | 83 } |
81 | 84 |
82 } } // namespace v8::internal | 85 } } // namespace v8::internal |
OLD | NEW |