Chromium Code Reviews| Index: Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
| diff --git a/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp b/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
| index 5a9f5004db3bb89481fccb72a5893a99aa26bc11..81a3d2c5fee6bc6d8026e1d274ec56190d1797ed 100644 |
| --- a/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
| +++ b/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
| @@ -37,10 +37,27 @@ namespace WebCore { |
| namespace DartOscillatorNodeInternal { |
| -void typeSetter(Dart_NativeArguments) |
| +void typeSetter(Dart_NativeArguments args) |
| { |
| - // FIXME: proper implementation. |
| - DART_UNIMPLEMENTED(); |
| + Dart_Handle exception = 0; |
| + { |
| + OscillatorNode* receiver = DartDOMWrapper::receiver<OscillatorNode>(args); |
| + |
| + String type = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1), exception); |
|
siva
2013/10/19 00:03:48
you could use DartUtilities::dartToString(args, 1,
rmacnak
2013/10/21 23:44:47
Done.
|
| + if (exception) |
| + goto fail; |
| + |
| + if (type == "sine" || type == "square" || type == "sawtooth" || type == "triangle") { |
| + receiver->setType(type); |
| + return; |
| + } |
| + |
| + exception = Dart_NewStringFromCString("Illegal OscillatorNode type"); |
| + } |
| + |
| +fail: |
| + Dart_ThrowException(exception); |
| + ASSERT_NOT_REACHED(); |
| } |
| } |